summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2015-09-22 18:44:13 -0700
committerchrome-bot <chrome-bot@chromium.org>2015-09-24 18:07:01 -0700
commit854d5a6e7fa47e44797891e6fad392a344003b46 (patch)
tree5a2fd4137eb9660ef5c4d459b88d20f987498fd7 /chip
parent324d6b807f18c456c16dad534f88ef22da34fdc5 (diff)
downloadchrome-ec-854d5a6e7fa47e44797891e6fad392a344003b46.tar.gz
cleanup: Remove CONFIG_FW_IMAGE_SIZE
Since CONFIG_RO_SIZE and CONFIG_RW_SIZE now exist (which may theoretically be different sizes), it is no longer useful to globally define the size of an image. BUG=chromium:535027 BRANCH=None TEST=`make buildall -j`. Also, verify glados / glados_pd continue to function as expected. Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: Ie29959923bc5d02b4d7d6d507ff2191bcb7d24c8 Reviewed-on: https://chromium-review.googlesource.com/301743 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r--chip/mec1322/config_flash_layout.h8
-rw-r--r--chip/mec1322/lfw/ec_lfw.c5
-rw-r--r--chip/npcx/config_flash_layout.h9
3 files changed, 6 insertions, 16 deletions
diff --git a/chip/mec1322/config_flash_layout.h b/chip/mec1322/config_flash_layout.h
index 4822329ae3..e79dd8b70e 100644
--- a/chip/mec1322/config_flash_layout.h
+++ b/chip/mec1322/config_flash_layout.h
@@ -26,12 +26,6 @@
#define CONFIG_EC_WRITABLE_STORAGE_OFF (CONFIG_FLASH_SIZE - 0x40000)
#define CONFIG_EC_WRITABLE_STORAGE_SIZE 0x20000
-
-/* Size of one firmware image in flash */
-#ifndef CONFIG_FW_IMAGE_SIZE
-#define CONFIG_FW_IMAGE_SIZE (96 * 1024)
-#endif
-
/* Loader resides at the beginning of program memory */
#define CONFIG_LOADER_MEM_OFF 0
#define CONFIG_LOADER_SIZE 0x1000
@@ -50,7 +44,7 @@
*/
#define CONFIG_RO_MEM_OFF (CONFIG_LOADER_MEM_OFF + \
CONFIG_LOADER_SIZE)
-#define CONFIG_RO_SIZE CONFIG_FW_IMAGE_SIZE
+#define CONFIG_RO_SIZE (96 * 1024)
#define CONFIG_RW_MEM_OFF CONFIG_RO_MEM_OFF
#define CONFIG_RW_SIZE CONFIG_RO_SIZE
diff --git a/chip/mec1322/lfw/ec_lfw.c b/chip/mec1322/lfw/ec_lfw.c
index 8dffa6da72..3bb3e31398 100644
--- a/chip/mec1322/lfw/ec_lfw.c
+++ b/chip/mec1322/lfw/ec_lfw.c
@@ -95,9 +95,10 @@ int spi_image_load(uint32_t offset)
CONFIG_PROGRAM_MEMORY_BASE);
uint32_t i;
- memset((void *)buf, 0xFF, (CONFIG_FW_IMAGE_SIZE - 4));
+ BUILD_ASSERT(CONFIG_RO_SIZE == CONFIG_RW_SIZE);
+ memset((void *)buf, 0xFF, (CONFIG_RO_SIZE - 4));
- for (i = 0; i < CONFIG_FW_IMAGE_SIZE; i += SPI_CHUNK_SIZE)
+ for (i = 0; i < CONFIG_RO_SIZE; i += SPI_CHUNK_SIZE)
spi_flash_readloc(&buf[i], offset + i, SPI_CHUNK_SIZE);
return 0;
diff --git a/chip/npcx/config_flash_layout.h b/chip/npcx/config_flash_layout.h
index 60e9795890..497be03089 100644
--- a/chip/npcx/config_flash_layout.h
+++ b/chip/npcx/config_flash_layout.h
@@ -31,11 +31,6 @@
#define CONFIG_EC_WRITABLE_STORAGE_OFF 0x20000
#define CONFIG_EC_WRITABLE_STORAGE_SIZE 0x20000
-/* Size of one firmware image in flash */
-#ifndef CONFIG_FW_IMAGE_SIZE
-#define CONFIG_FW_IMAGE_SIZE (96 * 1024) /* 96 KB for FW images */
-#endif
-
/* Header support which is used by booter to copy FW from flash to code ram */
#define NPCX_RO_HEADER
#define CONFIG_RO_HDR_MEM_OFF 0x0
@@ -46,11 +41,11 @@
/* RO firmware offset in flash */
#define CONFIG_RO_MEM_OFF 0
-#define CONFIG_RO_SIZE CONFIG_FW_IMAGE_SIZE /* 96KB for RW FW */
+#define CONFIG_RO_SIZE (96 * 1024) /* 96KB for RO FW */
/* RW firmware offset in flash */
#define CONFIG_RW_MEM_OFF CONFIG_RW_STORAGE_OFF
-#define CONFIG_RW_SIZE CONFIG_FW_IMAGE_SIZE /* 96KB for RW FW */
+#define CONFIG_RW_SIZE (96 * 1024) /* 96KB for RW FW */
/* The storage offset of ec.R*.flat which is used for firmware_image.lds */
#define CONFIG_RO_STORAGE_OFF CONFIG_RO_HDR_SIZE