diff options
-rw-r--r-- | chip/lm4/config.h | 3 | ||||
-rw-r--r-- | chip/stm32/config-stm32f100.h | 2 | ||||
-rw-r--r-- | chip/stm32/config-stm32l15x.h | 2 | ||||
-rw-r--r-- | common/flash_common.c | 4 | ||||
-rw-r--r-- | common/fmap.c | 6 |
5 files changed, 12 insertions, 5 deletions
diff --git a/chip/lm4/config.h b/chip/lm4/config.h index 8433ee1637..b2ce40a4e8 100644 --- a/chip/lm4/config.h +++ b/chip/lm4/config.h @@ -59,6 +59,9 @@ #define CONFIG_SECTION_RW_OFF (CONFIG_SECTION_RO_OFF \ + CONFIG_SECTION_RO_SIZE) +#define CONFIG_SECTION_WP_RO_SIZE (40 * CONFIG_FLASH_BANK_SIZE) +#define CONFIG_SECTION_WP_RO_OFF CONFIG_FLASH_BASE + #define CONFIG_FW_RO_OFF CONFIG_SECTION_RO_OFF #define CONFIG_FW_RO_SIZE CONFIG_SECTION_RO_SIZE #define CONFIG_FW_RW_OFF CONFIG_SECTION_RW_OFF diff --git a/chip/stm32/config-stm32f100.h b/chip/stm32/config-stm32f100.h index dfb59c3cbe..21d91f6695 100644 --- a/chip/stm32/config-stm32f100.h +++ b/chip/stm32/config-stm32f100.h @@ -26,6 +26,8 @@ #define CONFIG_SECTION_RO_SIZE CONFIG_FW_RO_SIZE #define CONFIG_SECTION_RW_OFF CONFIG_FW_RW_OFF #define CONFIG_SECTION_RW_SIZE CONFIG_FW_RW_SIZE +#define CONFIG_SECTION_WP_RO_OFF CONFIG_FW_RO_OFF +#define CONFIG_SECTION_WP_RO_SIZE CONFIG_FW_IMAGE_SIZE /* * Put this after RO to give RW more space. This also makes RO write protect diff --git a/chip/stm32/config-stm32l15x.h b/chip/stm32/config-stm32l15x.h index 5a3fef59a8..ef913bbc0c 100644 --- a/chip/stm32/config-stm32l15x.h +++ b/chip/stm32/config-stm32l15x.h @@ -35,6 +35,8 @@ #define CONFIG_SECTION_RO_SIZE CONFIG_FW_RO_SIZE #define CONFIG_SECTION_RW_OFF CONFIG_FW_RW_OFF #define CONFIG_SECTION_RW_SIZE CONFIG_FW_RW_SIZE +#define CONFIG_SECTION_WP_RO_OFF CONFIG_FW_RO_OFF +#define CONFIG_SECTION_WP_RO_SIZE CONFIG_FW_RO_SIZE /* * The EC uses the top bank of flash to emulate a SPI-like write protect diff --git a/common/flash_common.c b/common/flash_common.c index 6e2587e652..e230ada49c 100644 --- a/common/flash_common.c +++ b/common/flash_common.c @@ -348,8 +348,8 @@ static int flash_command_region_info(struct host_cmd_handler_args *args) r->size = CONFIG_SECTION_RW_SIZE; break; case EC_FLASH_REGION_WP_RO: - r->offset = CONFIG_SECTION_RO_OFF; - r->size = CONFIG_SECTION_RO_SIZE; + r->offset = CONFIG_SECTION_WP_RO_OFF; + r->size = CONFIG_SECTION_WP_RO_SIZE; break; default: return EC_RES_INVALID_PARAM; diff --git a/common/fmap.c b/common/fmap.c index 8035653128..d36cdc1d5b 100644 --- a/common/fmap.c +++ b/common/fmap.c @@ -101,11 +101,11 @@ const struct _ec_fmap { }, { /* The range for write protection, for factory - * finalization. Should include (or identical to) + * finalization. Should include (may be identical to) * EC_RO and aligned to hardware specification. */ .area_name = "WP_RO", - .area_offset = CONFIG_SECTION_RO_OFF, - .area_size = CONFIG_SECTION_RO_SIZE, + .area_offset = CONFIG_SECTION_WP_RO_OFF, + .area_size = CONFIG_SECTION_WP_RO_SIZE, .area_flags = FMAP_AREA_STATIC | FMAP_AREA_RO, }, |