diff options
author | Randall Spangler <rspangler@chromium.org> | 2013-05-24 15:07:27 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-06-03 14:32:38 -0700 |
commit | b490e866dc14b55a99e53d14ade4543daeba157a (patch) | |
tree | c005129068632cbebb8684c96810ba60f28bbd15 /common | |
parent | e52aba6ecac45d2c27acc78316e835620840408a (diff) | |
download | chrome-ec-b490e866dc14b55a99e53d14ade4543daeba157a.tar.gz |
Clean up flash section defines and increase lm4 image size
The firmware defines had two almost-identical sets. Coalesce into one
consistent set.
Link had 256 KB flash, but only allowed 2 80KB images. Future
LM4-based platforms (slippy/peppy/falco/etc) will now use the entire
flash, with RO=124KB, pstate=4KB, RW=128KB. This matches what the
STM32 platforms do, where pstate is contiguous with the RO firmware.
No functional change to STM32-based platforms.
BUG=chrome-os-partner:19176
BRANCH=none
TEST=build all platforms and dump_fmap ec.bin.
- stm32-based platforms should report RO=61440@0, RW=65536@0x10000
- link should report RO=81920@0, RW=81920@0x14000
- slippy should report RO=129024@0, RW=131072@0x20000
Change-Id: I20b1d95c16250d9a5d228ead06eef03d96548823
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56655
Diffstat (limited to 'common')
-rw-r--r-- | common/firmware_image.lds.S | 4 | ||||
-rw-r--r-- | common/flash_common.c | 12 | ||||
-rw-r--r-- | common/fmap.c | 12 | ||||
-rw-r--r-- | common/system_common.c | 16 |
4 files changed, 22 insertions, 22 deletions
diff --git a/common/firmware_image.lds.S b/common/firmware_image.lds.S index 3cd806dce7..9df21d41f9 100644 --- a/common/firmware_image.lds.S +++ b/common/firmware_image.lds.S @@ -15,11 +15,11 @@ MEMORY SECTIONS { . = ALIGN(CONFIG_FLASH_BANK_SIZE); - .image.RO : AT(CONFIG_FLASH_BASE + CONFIG_SECTION_RO_OFF) { + .image.RO : AT(CONFIG_FLASH_BASE + CONFIG_FW_RO_OFF) { *(.image.RO) } > FLASH =0xff . = ALIGN(CONFIG_FLASH_BANK_SIZE); - .image.RW : AT(CONFIG_FLASH_BASE + CONFIG_SECTION_RW_OFF) { + .image.RW : AT(CONFIG_FLASH_BASE + CONFIG_FW_RW_OFF) { *(.image.RW) BYTE(0xEA) /* Mark end explicitly */ } > FLASH =0xff diff --git a/common/flash_common.c b/common/flash_common.c index 430bcaead8..2192fa2e07 100644 --- a/common/flash_common.c +++ b/common/flash_common.c @@ -610,16 +610,16 @@ static int flash_command_region_info(struct host_cmd_handler_args *args) switch (p->region) { case EC_FLASH_REGION_RO: - r->offset = CONFIG_SECTION_RO_OFF; - r->size = CONFIG_SECTION_RO_SIZE; + r->offset = CONFIG_FW_RO_OFF; + r->size = CONFIG_FW_RO_SIZE; break; case EC_FLASH_REGION_RW: - r->offset = CONFIG_SECTION_RW_OFF; - r->size = CONFIG_SECTION_RW_SIZE; + r->offset = CONFIG_FW_RW_OFF; + r->size = CONFIG_FW_RW_SIZE; break; case EC_FLASH_REGION_WP_RO: - r->offset = CONFIG_SECTION_WP_RO_OFF; - r->size = CONFIG_SECTION_WP_RO_SIZE; + r->offset = CONFIG_FW_WP_RO_OFF; + r->size = CONFIG_FW_WP_RO_SIZE; break; default: return EC_RES_INVALID_PARAM; diff --git a/common/fmap.c b/common/fmap.c index fa676936cb..cac3b61ca2 100644 --- a/common/fmap.c +++ b/common/fmap.c @@ -69,8 +69,8 @@ const struct _ec_fmap { * volatile data (ex, calibration results). */ .area_name = "EC_RO", - .area_offset = CONFIG_SECTION_RO_OFF, - .area_size = CONFIG_SECTION_RO_SIZE, + .area_offset = CONFIG_FW_RO_OFF, + .area_size = CONFIG_FW_RO_SIZE, .area_flags = FMAP_AREA_STATIC | FMAP_AREA_RO, }, { @@ -108,8 +108,8 @@ const struct _ec_fmap { * EC_RO and aligned to hardware specification. */ .area_name = "WP_RO", - .area_offset = CONFIG_SECTION_WP_RO_OFF, - .area_size = CONFIG_SECTION_WP_RO_SIZE, + .area_offset = CONFIG_FW_WP_RO_OFF, + .area_size = CONFIG_FW_WP_RO_SIZE, .area_flags = FMAP_AREA_STATIC | FMAP_AREA_RO, }, @@ -117,8 +117,8 @@ const struct _ec_fmap { { /* 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_offset = CONFIG_FW_RW_OFF, + .area_size = CONFIG_FW_RW_SIZE, .area_flags = FMAP_AREA_STATIC | FMAP_AREA_RO, }, { diff --git a/common/system_common.c b/common/system_common.c index 4df9aa70df..ac85c8051b 100644 --- a/common/system_common.c +++ b/common/system_common.c @@ -218,12 +218,12 @@ enum system_image_copy_t system_get_image_copy(void) uintptr_t my_addr = (uintptr_t)system_get_image_copy - CONFIG_FLASH_BASE; - if (my_addr >= CONFIG_SECTION_RO_OFF && - my_addr < (CONFIG_SECTION_RO_OFF + CONFIG_SECTION_RO_SIZE)) + if (my_addr >= CONFIG_FW_RO_OFF && + my_addr < (CONFIG_FW_RO_OFF + CONFIG_FW_RO_SIZE)) return SYSTEM_IMAGE_RO; - if (my_addr >= CONFIG_SECTION_RW_OFF && - my_addr < (CONFIG_SECTION_RW_OFF + CONFIG_SECTION_RW_SIZE)) + if (my_addr >= CONFIG_FW_RW_OFF && + my_addr < (CONFIG_FW_RW_OFF + CONFIG_FW_RW_SIZE)) return SYSTEM_IMAGE_RW; return SYSTEM_IMAGE_UNKNOWN; @@ -235,11 +235,11 @@ int system_get_image_used(enum system_image_copy_t copy) int size = 0; if (copy == SYSTEM_IMAGE_RO) { - image = (const uint8_t *)CONFIG_SECTION_RO_OFF; - size = CONFIG_SECTION_RO_SIZE; + image = (const uint8_t *)CONFIG_FW_RO_OFF; + size = CONFIG_FW_RO_SIZE; } else if (copy == SYSTEM_IMAGE_RW) { - image = (const uint8_t *)CONFIG_SECTION_RW_OFF; - size = CONFIG_SECTION_RW_SIZE; + image = (const uint8_t *)CONFIG_FW_RW_OFF; + size = CONFIG_FW_RW_SIZE; } if (size <= 0) |