diff --git a/board/kevin/board.h b/board/kevin/board.h index 12ac648d06..f22812dd89 100644 --- a/board/kevin/board.h +++ b/board/kevin/board.h @@ -29,9 +29,9 @@ /* * We are code space-constrained on kevin, so take 10K that is normally used - * as data RAM (was 30K, now 20K) and use it for code RAM (was 96K, now 106K) + * as data RAM (was 30K, now 22K) and use it for code RAM (was 96K, now 104K) */ -#define RAM_SHIFT_SIZE (10 * 1024) +#define RAM_SHIFT_SIZE (8 * 1024) #undef CONFIG_RO_SIZE #define CONFIG_RO_SIZE (NPCX_PROGRAM_MEMORY_SIZE + RAM_SHIFT_SIZE) #undef CONFIG_RAM_BASE diff --git a/common/flash.c b/common/flash.c index 2bb1679197..cffae7843e 100644 --- a/common/flash.c +++ b/common/flash.c @@ -952,6 +952,13 @@ DECLARE_HOST_COMMAND(EC_CMD_FLASH_WRITE, flash_command_write, EC_VER_MASK(0) | EC_VER_MASK(EC_VER_FLASH_WRITE)); +/* + * Make sure our image sizes are a multiple of flash block erase size so that + * the host can erase the entire image. + */ +BUILD_ASSERT(CONFIG_RO_SIZE % CONFIG_FLASH_ERASE_SIZE == 0); +BUILD_ASSERT(CONFIG_RW_SIZE % CONFIG_FLASH_ERASE_SIZE == 0); + static int flash_command_erase(struct host_cmd_handler_args *args) { const struct ec_params_flash_erase *p = args->params;