diff options
Diffstat (limited to 'zephyr/shim')
-rw-r--r-- | zephyr/shim/include/config_chip.h | 4 | ||||
-rw-r--r-- | zephyr/shim/src/flash.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index f1aebbb2ff..572183ccb2 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -94,13 +94,13 @@ enum battery_type { #undef CONFIG_EXTERNAL_STORAGE #undef CONFIG_MAPPED_STORAGE #undef CONFIG_FLASH_PSTATE -#undef CONFIG_FLASH_SIZE +#undef CONFIG_FLASH_SIZE_BYTES #ifdef CONFIG_PLATFORM_EC_FLASH #undef CONFIG_CMD_FLASHINFO #undef CONFIG_CMD_FLASH #define CONFIG_FLASH #define CONFIG_SPI_FLASH_W25Q80 /* Internal SPI flash type. */ -#define CONFIG_FLASH_SIZE 0x80000 +#define CONFIG_FLASH_SIZE_BYTES 0x80000 /* TODO(b:176490413): use DT_PROP(DT_INST(inst, DT_DRV_COMPAT), size) ? */ #define CONFIG_MAPPED_STORAGE_BASE 0x64000000 #define CONFIG_FLASH_WRITE_SIZE 0x1 /* minimum write size */ diff --git a/zephyr/shim/src/flash.c b/zephyr/shim/src/flash.c index 12824753e7..e2fff3d139 100644 --- a/zephyr/shim/src/flash.c +++ b/zephyr/shim/src/flash.c @@ -126,7 +126,7 @@ static int flash_set_status_for_prot(int reg1, int reg2) static int flash_check_prot_range(unsigned int offset, unsigned int bytes) { /* Invalid value */ - if (offset + bytes > CONFIG_FLASH_SIZE) + if (offset + bytes > CONFIG_FLASH_SIZE_BYTES) return EC_ERROR_INVAL; /* Check if ranges overlap */ @@ -158,7 +158,7 @@ static int flash_check_prot_reg(unsigned int offset, unsigned int bytes) sr2 = flash_get_status2(); /* Invalid value */ - if (offset + bytes > CONFIG_FLASH_SIZE) + if (offset + bytes > CONFIG_FLASH_SIZE_BYTES) return EC_ERROR_INVAL; /* Compute current protect range */ @@ -181,7 +181,7 @@ static int flash_write_prot_reg(unsigned int offset, unsigned int bytes, uint8_t sr2 = flash_get_status2(); /* Invalid values */ - if (offset + bytes > CONFIG_FLASH_SIZE) + if (offset + bytes > CONFIG_FLASH_SIZE_BYTES) return EC_ERROR_INVAL; /* Compute desired protect range */ |