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
This commit is contained in:
Randall Spangler
2012-07-17 10:58:46 -07:00
committed by Gerrit
parent eb93d200be
commit c89edce83f
2 changed files with 29 additions and 8 deletions

View File

@@ -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 */

View File

@@ -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
}
};