diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2015-05-11 14:23:31 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-05-15 06:42:30 +0000 |
commit | e3dce49334a2b44e337744bc719a27c63261f35e (patch) | |
tree | 3ee485350fafffaf53206036a3a19184068feeb5 /chip/stm32/flash-f.c | |
parent | cba37a13d2342e4c81b0be3c84010baf3d846162 (diff) | |
download | chrome-ec-e3dce49334a2b44e337744bc719a27c63261f35e.tar.gz |
cleanup: Use appropriate image geometry CONFIGs
- Use CONFIG_*_MEM when dealing with images in program memory.
- Use CONFIG_*_STORAGE when dealing with images on storage.
- Use CONFIG_WP when dealing with the entire WP RO region.
BUG=chrome-os-partner:39741,chrome-os-partner:23796
TEST=Manual on Cyan with subsequent commit. Verify that FMAP matches
actual layout of image. Verify flashrom succeeds flashing + verifying EC
image using host command interface.
BRANCH=None
Change-Id: Iadc02daa89fe3bf07b083ed0f7be2e60702a1867
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/270269
Diffstat (limited to 'chip/stm32/flash-f.c')
-rw-r--r-- | chip/stm32/flash-f.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/chip/stm32/flash-f.c b/chip/stm32/flash-f.c index 1fa809a449..090e223ec7 100644 --- a/chip/stm32/flash-f.c +++ b/chip/stm32/flash-f.c @@ -342,12 +342,12 @@ int flash_physical_protect_at_boot(enum flash_wp_range range) for (i = 0; i < 4; ++i) original_val[i] = val[i] = read_optb(i * 2 + 8); - for (block = RO_BANK_OFFSET; - block < RO_BANK_OFFSET + PHYSICAL_BANKS; + for (block = WP_BANK_OFFSET; + block < WP_BANK_OFFSET + PHYSICAL_BANKS; block++) { int byte_off = STM32_OPTB_WRP_OFF(block/8) / 2 - 4; - if (block >= RO_BANK_OFFSET + RO_BANK_COUNT + PSTATE_BANK_COUNT) + if (block >= WP_BANK_OFFSET + WP_BANK_COUNT) cur_range = FLASH_WP_ALL; else cur_range = FLASH_WP_RO; @@ -384,9 +384,8 @@ static int registers_need_reset(void) uint32_t flags = flash_get_protect(); int i; int ro_at_boot = (flags & EC_FLASH_PROTECT_RO_AT_BOOT) ? 1 : 0; - int ro_wp_region_start = RO_BANK_OFFSET; - int ro_wp_region_end = - RO_BANK_OFFSET + RO_BANK_COUNT + PSTATE_BANK_COUNT; + int ro_wp_region_start = WP_BANK_OFFSET; + int ro_wp_region_end = WP_BANK_OFFSET + WP_BANK_COUNT; for (i = ro_wp_region_start; i < ro_wp_region_end; i++) if (flash_physical_get_protect_at_boot(i) != ro_at_boot) |