From fe77303bec6c78786a9df1dbdb33af64787e20c8 Mon Sep 17 00:00:00 2001 From: Shawn Nematbakhsh Date: Mon, 7 Sep 2015 14:12:57 -0700 Subject: cleanup: Remove redundant FLASH_SIZE CONFIGs Since there is no more concept of a flash region belonging only to the EC, we only need one FLASH_SIZE config, which represents the actual physical size of flash. BRANCH=None BUG=chrome-os-partner:23796 TEST=With entire patch series, on both Samus and Glados: - Verify 'version' EC console command is correct - Verify 'flashrom -p ec -r read.bin' reads back EC image - Verify software sync correctly flashes both EC and PD RW images Signed-off-by: Shawn Nematbakhsh Change-Id: I18a34a943e02c8a029f330f213a8634a2ca418b6 Reviewed-on: https://chromium-review.googlesource.com/297824 Commit-Ready: Shawn N Tested-by: Mulin Chao Reviewed-by: Randall Spangler --- chip/mec1322/config_flash_layout.h | 7 ++----- chip/mec1322/lfw/ec_lfw.c | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'chip/mec1322') diff --git a/chip/mec1322/config_flash_layout.h b/chip/mec1322/config_flash_layout.h index 6b037df6d0..4822329ae3 100644 --- a/chip/mec1322/config_flash_layout.h +++ b/chip/mec1322/config_flash_layout.h @@ -21,9 +21,9 @@ #define CONFIG_SPI_FLASH /* EC region of SPI resides at end of ROM, protected region follows writable */ -#define CONFIG_EC_PROTECTED_STORAGE_OFF (CONFIG_SPI_FLASH_SIZE - 0x20000) +#define CONFIG_EC_PROTECTED_STORAGE_OFF (CONFIG_FLASH_SIZE - 0x20000) #define CONFIG_EC_PROTECTED_STORAGE_SIZE 0x20000 -#define CONFIG_EC_WRITABLE_STORAGE_OFF (CONFIG_SPI_FLASH_SIZE - 0x40000) +#define CONFIG_EC_WRITABLE_STORAGE_OFF (CONFIG_FLASH_SIZE - 0x40000) #define CONFIG_EC_WRITABLE_STORAGE_SIZE 0x20000 @@ -31,9 +31,6 @@ #ifndef CONFIG_FW_IMAGE_SIZE #define CONFIG_FW_IMAGE_SIZE (96 * 1024) #endif -/* redundant..*/ -#define CONFIG_FLASH_PHYSICAL_SIZE CONFIG_SPI_FLASH_SIZE -#define CONFIG_FLASH_SIZE CONFIG_FLASH_PHYSICAL_SIZE /* Loader resides at the beginning of program memory */ #define CONFIG_LOADER_MEM_OFF 0 diff --git a/chip/mec1322/lfw/ec_lfw.c b/chip/mec1322/lfw/ec_lfw.c index 87940ad2f7..8dffa6da72 100644 --- a/chip/mec1322/lfw/ec_lfw.c +++ b/chip/mec1322/lfw/ec_lfw.c @@ -83,7 +83,7 @@ static int spi_flash_readloc(uint8_t *buf_usr, (offset >> 8) & 0xFF, offset & 0xFF}; - if (offset + bytes > CONFIG_SPI_FLASH_SIZE) + if (offset + bytes > CONFIG_FLASH_SIZE) return EC_ERROR_INVAL; return spi_transaction(SPI_FLASH_DEVICE, cmd, 4, buf_usr, bytes); -- cgit v1.2.1