diff options
author | Hung-Te Lin <hungte@chromium.org> | 2012-07-18 11:46:06 +0800 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-07-18 20:27:42 -0700 |
commit | 7a7d7b7c8697db8dd3d956063d7208b621a313aa (patch) | |
tree | b5a7729286c127a83b1940147427248cdc74eb63 /common/fmap.c | |
parent | 8137b29125dec793c84273b522d8adfa7c1748dc (diff) | |
download | chrome-ec-7a7d7b7c8697db8dd3d956063d7208b621a313aa.tar.gz |
chromeos-ec: Refine FMAP.
Make EC FMAP more compliant to existing devices (EC_RO, EC_RW, RW_FWID),
eliminating unnecessary areas (RO_SETION, EC_IMAGE), and add more detailed
comments to each area.
BUG=chrome-os-partner:11360
TEST=emerge-link chromeos-ec; dump_fmap -x ec.bin
Change-Id: I3d30d6fe0d3cee2e944009dccef488f7215b6395
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/27739
Diffstat (limited to 'common/fmap.c')
-rw-r--r-- | common/fmap.c | 70 |
1 files changed, 33 insertions, 37 deletions
diff --git a/common/fmap.c b/common/fmap.c index ea2b1ba93c..fb50e23dd7 100644 --- a/common/fmap.c +++ b/common/fmap.c @@ -40,9 +40,9 @@ typedef struct _FmapAreaHeader { } __packed FmapAreaHeader; #ifdef CONFIG_VBOOT_SIG -#define NUM_EC_FMAP_AREAS 13 +#define NUM_EC_FMAP_AREAS (7 + 4) #else -#define NUM_EC_FMAP_AREAS 11 +#define NUM_EC_FMAP_AREAS 7 #endif const struct _ec_fmap { @@ -63,19 +63,25 @@ const struct _ec_fmap { { /* RO Firmware */ { - .area_name = "RO_SECTION", + /* Range of RO firmware to be updated. Verified in + * factory finalization by hash. Should not have + * volatile data (ex, calibration results). */ + .area_name = "EC_RO", .area_offset = CONFIG_SECTION_RO_OFF, .area_size = CONFIG_SECTION_RO_SIZE, .area_flags = FMAP_AREA_STATIC | FMAP_AREA_RO, }, { + /* (Optional) RO firmware boot execution code. */ .area_name = "BOOT_STUB", .area_offset = CONFIG_FW_RO_OFF, .area_size = CONFIG_FW_RO_SIZE, .area_flags = FMAP_AREA_STATIC | FMAP_AREA_RO, }, { - .area_name = "RO_FRID", /* FIXME: Where is it? */ + /* RO firmware version ID. Must be NULL terminated + * ASCIIZ, and padded with \0. */ + .area_name = "RO_FRID", .area_offset = CONFIG_FW_RO_OFF + (uint32_t)__version_struct_offset + offsetof(struct version_struct, version), @@ -83,15 +89,7 @@ const struct _ec_fmap { .area_flags = FMAP_AREA_STATIC | FMAP_AREA_RO, }, - /* 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 + /* Other RO stuff: FMAP, WP, KEYS, etc. */ { .area_name = "FMAP", .area_offset = (uint32_t)&ec_fmap, @@ -99,36 +97,43 @@ const struct _ec_fmap { .area_flags = FMAP_AREA_STATIC | FMAP_AREA_RO, }, { - /* A dummy region to identify it as EC firmware */ - .area_name = "EC_IMAGE", + /* The range for write protection, for factory + * finalization. Should include (or identical to) + * EC_RO and aligned to hardware specification. */ + .area_name = "WP_RO", .area_offset = CONFIG_SECTION_RO_OFF, - .area_size = 0, /* Always zero */ + .area_size = CONFIG_SECTION_RO_SIZE, .area_flags = FMAP_AREA_STATIC | FMAP_AREA_RO, }, +#ifdef CONFIG_VBOOT_SIG { - /* The range for write protect, for lagecy firmware - * updater. Should be identical to 'WP_RO'. */ - .area_name = "EC_RO", - .area_offset = CONFIG_SECTION_RO_OFF, - .area_size = CONFIG_SECTION_RO_SIZE, + .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 + + /* RW Firmware */ { - /* The range for autoupdate to update RW */ + /* The range of RW firmware to be auto-updated. */ .area_name = "EC_RW", .area_offset = CONFIG_SECTION_RW_OFF, .area_size = CONFIG_SECTION_RW_SIZE, .area_flags = FMAP_AREA_STATIC | FMAP_AREA_RO, }, { - /* The range for write protect, for factory finalize - * test case. Should be identical to 'EC_RO'. */ - .area_name = "WP_RO", - .area_offset = CONFIG_SECTION_RO_OFF, - .area_size = CONFIG_SECTION_RO_SIZE, - .area_flags = FMAP_AREA_STATIC | FMAP_AREA_RO, + /* RW firmware version ID. Must be NULL terminated + * ASCIIZ, and padded with \0. */ + .area_name = "RW_FWID", + .area_offset = CONFIG_FW_RW_OFF + + (uint32_t)__version_struct_offset + + offsetof(struct version_struct, version), + .area_size = sizeof(version_data.version), + .area_flags = FMAP_AREA_STATIC, }, +#ifdef CONFIG_VBOOT_SIG /* Firmware A */ { .area_name = "RW_SECTION_A", @@ -143,15 +148,6 @@ const struct _ec_fmap { .area_flags = FMAP_AREA_STATIC, }, { - .area_name = "RW_FWID_A", /* FIXME: Where is it? */ - .area_offset = CONFIG_FW_RW_OFF + - (uint32_t)__version_struct_offset + - offsetof(struct version_struct, version), - .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, |