diff options
author | Yuval Peress <peress@chromium.org> | 2021-01-14 01:29:08 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-01-15 04:07:55 +0000 |
commit | 9e422c3c05fdd324565049b09be27c446f9dc0ca (patch) | |
tree | b4694ca5abc8c1be1000a1efe7a7bd8a02ddd856 /chip/host | |
parent | 6aa3d78608b681e6374f30747a7f6ab80938bde6 (diff) | |
download | chrome-ec-9e422c3c05fdd324565049b09be27c446f9dc0ca.tar.gz |
Refactor CONFIG_FLASH_SIZE to CONFIG_FLASH_SIZE_BYTES
In Zephyr CONFIG_FLASH_SIZE is a Kconfig value that is used
throughout. The issue is that the units don't match. In
Zephyr the value is in KiB instead of bytes. This refactor
simply renames CONFIG_FLASH_SIZE in platform/ec to include
the unit (via _BYTES).
BRANCH=none
BUG=b:174873770
TEST=make buildall
be generated by the build instead of per board
Signed-off-by: Yuval Peress <peress@chromium.org>
Change-Id: I44bf3c7a20fcf62aaa9ae15715be78db4210f384
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2627638
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'chip/host')
-rw-r--r-- | chip/host/config_chip.h | 6 | ||||
-rw-r--r-- | chip/host/flash.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/chip/host/config_chip.h b/chip/host/config_chip.h index 195744c556..84e254d8a0 100644 --- a/chip/host/config_chip.h +++ b/chip/host/config_chip.h @@ -10,14 +10,14 @@ /* Memory mapping */ #if !defined(TEST_NVMEM) && !defined(TEST_CR50_FUZZ) -#define CONFIG_FLASH_SIZE 0x00020000 +#define CONFIG_FLASH_SIZE_BYTES 0x00020000 #define CONFIG_FLASH_BANK_SIZE 0x1000 #else -#define CONFIG_FLASH_SIZE (512 * 1024) +#define CONFIG_FLASH_SIZE_BYTES (512 * 1024) #define CONFIG_FLASH_BANK_SIZE 0x800 #endif -extern char __host_flash[CONFIG_FLASH_SIZE]; +extern char __host_flash[CONFIG_FLASH_SIZE_BYTES]; #define CONFIG_PROGRAM_MEMORY_BASE ((uintptr_t)__host_flash) #define CONFIG_FLASH_ERASE_SIZE 0x0010 /* erase bank size */ diff --git a/chip/host/flash.c b/chip/host/flash.c index 9f79298d60..486c418065 100644 --- a/chip/host/flash.c +++ b/chip/host/flash.c @@ -14,7 +14,7 @@ #include "util.h" /* This needs to be aligned to the erase bank size for NVCTR. */ -__aligned(CONFIG_FLASH_ERASE_SIZE) char __host_flash[CONFIG_FLASH_SIZE]; +__aligned(CONFIG_FLASH_ERASE_SIZE) char __host_flash[CONFIG_FLASH_SIZE_BYTES]; uint8_t __host_flash_protect[PHYSICAL_BANKS]; /* Override this function to make flash erase/write operation fail */ |