From de025c153b34a06ca7de8da832e1d468d263af3c Mon Sep 17 00:00:00 2001 From: Scott Date: Wed, 31 Aug 2016 09:33:09 -0700 Subject: [PATCH] Cr50: NvMem: Increase partition size from 0x2800 to 0x4000 CONFIG_FLASH_NVMEM_SIZE was set to CFG_TOP_SIZE and then the partition size was computed by dividing this value by 2. Changed this so that now the partition size is set to CFG_TOP_SIZE and the total size is the partition size * 2. Also reduced the CFG_TOP_SIZE to 0x4000 as that should be plenty for TPM requirements and leaves room for future gnubby use. BRANCH=none CQ-DEPEND=CL:379076 BUG=chrome-os-partner:56798 TEST=manual Tested on Kevin, erased the existing NvMem area and verified that TPM was still manufactured and executed the command: trunks_client --own Erased parition 0 and 1 in the new locations and repeated the tests. Change-Id: Ie8910bec641d8d1ff390be5b03b430bf39d18404 Signed-off-by: Scott Reviewed-on: https://chromium-review.googlesource.com/379095 Commit-Ready: Bill Richardson Tested-by: Bill Richardson Tested-by: Scott Collyer Tested-by: Andrey Pronin Reviewed-by: Bill Richardson --- board/cr50/board.h | 9 +++++---- chip/g/config_chip.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/board/cr50/board.h b/board/cr50/board.h index bcb21849f8..52e9ea6039 100644 --- a/board/cr50/board.h +++ b/board/cr50/board.h @@ -21,7 +21,7 @@ /* TODO(crosbug.com/p/44745): For debugging only */ #define CONFIG_CMD_FLASH -/* We're using all of TOP_A for partition A, TOP_B for partition 1 */ +/* We're using TOP_A for partition 0, TOP_B for partition 1 */ #define CONFIG_FLASH_NVMEM /* Offset to start of NvMem area from base of flash */ #define CONFIG_FLASH_NVMEM_OFFSET_A (CFG_TOP_A_OFF) @@ -31,10 +31,11 @@ CONFIG_FLASH_NVMEM_OFFSET_A) #define CONFIG_FLASH_NVMEM_BASE_B (CONFIG_PROGRAM_MEMORY_BASE + \ CONFIG_FLASH_NVMEM_OFFSET_B) -/* Size in bytes of NvMem area */ -#define CONFIG_FLASH_NVMEM_SIZE CFG_TOP_SIZE /* Size partition in NvMem */ -#define NVMEM_PARTITION_SIZE (CONFIG_FLASH_NVMEM_SIZE / NVMEM_NUM_PARTITIONS) +#define NVMEM_PARTITION_SIZE CFG_TOP_SIZE +/* Size in bytes of NvMem area */ +#define CONFIG_FLASH_NVMEM_SIZE (CFG_TOP_SIZE * NVMEM_NUM_PARTITIONS) + /* Go to sleep when nothing else is happening */ #define CONFIG_LOW_POWER_IDLE diff --git a/chip/g/config_chip.h b/chip/g/config_chip.h index b531f5d8b3..ed909fc3e5 100644 --- a/chip/g/config_chip.h +++ b/chip/g/config_chip.h @@ -95,7 +95,7 @@ * use these two areas for the same thing, it's just more convenient to make * them the same size. */ -#define CFG_TOP_SIZE 0x5000 +#define CFG_TOP_SIZE 0x4000 #define CFG_TOP_A_OFF (CFG_FLASH_HALF - CFG_TOP_SIZE) #define CFG_TOP_B_OFF (CONFIG_FLASH_SIZE - CFG_TOP_SIZE)