diff options
author | Randall Spangler <rspangler@chromium.org> | 2012-07-17 10:58:46 -0700 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-07-17 14:41:00 -0700 |
commit | c89edce83f1002bf221119267bc74f926c70e2c8 (patch) | |
tree | 7c13ebc3085bffa0e3c59d6575aeb0e1b6f58e28 | |
parent | eb93d200bee773836098d9bc0b7afd77c3155b23 (diff) | |
download | chrome-ec-c89edce83f1002bf221119267bc74f926c70e2c8.tar.gz |
Don't waste space on vblock and root key if not doing sig-based EC vboot
BUG=chrome-os-partner:11455
TEST=dump_fmap build/link/ec.bin; shouldn't see VBLOCK or ROOT_KEY sections
Change-Id: I8c1309936d86772fdf9aecdc8d95f0578ef0f65b
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/27661
-rw-r--r-- | chip/lm4/config.h | 27 | ||||
-rw-r--r-- | common/fmap.c | 10 |
2 files changed, 29 insertions, 8 deletions
diff --git a/chip/lm4/config.h b/chip/lm4/config.h index fa829a7aff..292c6e4ae3 100644 --- a/chip/lm4/config.h +++ b/chip/lm4/config.h @@ -47,6 +47,7 @@ - CONFIG_FLASH_ROLLBACK_SIZE) /* Then there are the two major sections. */ +/* TODO: Increase to 128KB, or shrink to 64KB? */ #define CONFIG_SECTION_RO_SIZE (40 * CONFIG_FLASH_BANK_SIZE) #define CONFIG_SECTION_RO_OFF CONFIG_FLASH_BASE @@ -54,9 +55,12 @@ #define CONFIG_SECTION_RW_OFF (CONFIG_SECTION_RO_OFF \ + CONFIG_SECTION_RO_SIZE) -/* The top of each section will hold the vboot stuff, since the firmware vector +#ifdef CONFIG_VBOOT_SIG +/* + * The top of each section will hold the vboot stuff, since the firmware vector * table has to go at the start. The root key will fit in 2K, but the vblocks - * need 4K. */ + * need 4K. + */ #define CONFIG_VBOOT_ROOTKEY_SIZE 0x800 #define CONFIG_VBLOCK_SIZE 0x1000 @@ -66,11 +70,20 @@ - CONFIG_VBOOT_ROOTKEY_SIZE) #define CONFIG_VBOOT_ROOTKEY_OFF (CONFIG_FW_RO_OFF + CONFIG_FW_RO_SIZE) -/* A: firmware, vblock */ -#define CONFIG_FW_RW_OFF CONFIG_SECTION_RW_OFF -#define CONFIG_FW_RW_SIZE (CONFIG_SECTION_RW_SIZE \ - - CONFIG_VBLOCK_SIZE) -#define CONFIG_VBLOCK_RW_OFF (CONFIG_FW_RW_OFF + CONFIG_FW_RW_SIZE) +/* RW: firmware, vblock */ +#define CONFIG_FW_RW_OFF CONFIG_SECTION_RW_OFF +#define CONFIG_FW_RW_SIZE (CONFIG_SECTION_RW_SIZE \ + - CONFIG_VBLOCK_SIZE) +#define CONFIG_VBLOCK_RW_OFF (CONFIG_FW_RW_OFF + CONFIG_FW_RW_SIZE) + +#else /* CONFIG_VBOOT_SIG */ + +#define CONFIG_FW_RO_OFF CONFIG_SECTION_RO_OFF +#define CONFIG_FW_RO_SIZE CONFIG_SECTION_RO_SIZE +#define CONFIG_FW_RW_OFF CONFIG_SECTION_RW_OFF +#define CONFIG_FW_RW_SIZE CONFIG_SECTION_RW_SIZE + +#endif /* CONFIG_VBOOT_SIG */ /****************************************************************************/ /* Customize the build */ diff --git a/common/fmap.c b/common/fmap.c index 82a380f031..ea2b1ba93c 100644 --- a/common/fmap.c +++ b/common/fmap.c @@ -39,8 +39,12 @@ typedef struct _FmapAreaHeader { uint16_t area_flags; } __packed FmapAreaHeader; - +#ifdef CONFIG_VBOOT_SIG #define NUM_EC_FMAP_AREAS 13 +#else +#define NUM_EC_FMAP_AREAS 11 +#endif + const struct _ec_fmap { FmapHeader header; FmapAreaHeader area[NUM_EC_FMAP_AREAS]; @@ -80,12 +84,14 @@ const struct _ec_fmap { }, /* Other RO stuff: FMAP, GBB, etc. */ +#ifdef CONFIG_VBOOT_SIG { .area_name = "ROOT_KEY", .area_offset = CONFIG_VBOOT_ROOTKEY_OFF, .area_size = CONFIG_VBOOT_ROOTKEY_SIZE, .area_flags = FMAP_AREA_STATIC | FMAP_AREA_RO, }, +#endif { .area_name = "FMAP", .area_offset = (uint32_t)&ec_fmap, @@ -144,11 +150,13 @@ const struct _ec_fmap { .area_size = sizeof(version_data.version), .area_flags = FMAP_AREA_STATIC, }, +#ifdef CONFIG_VBOOT_SIG { .area_name = "VBLOCK_A", .area_offset = CONFIG_VBLOCK_RW_OFF, .area_size = CONFIG_VBLOCK_SIZE, .area_flags = FMAP_AREA_STATIC, }, +#endif } }; |