From a1d45ab6536b24cc0b0e5a3b9746f0bc96b69e85 Mon Sep 17 00:00:00 2001 From: Dino Li Date: Wed, 1 Mar 2023 16:18:07 +0800 Subject: zephyr/it8xxx2: RO flash region excludes the PSTATE bank Since it8xxx2 uses a dedicated flash bank to store persistent state, this change excludes the PSTATE bank from the RO flash region. This configuration is the as same CrOS EC OS. BRANCH=none BUG=b:270589902 TEST=Updating EC FW using flashrom utility without verify failure on PSTATE region. Signed-off-by: Dino Li Change-Id: Iea5a4fbfde43675af58acbb85023d18503d3c3c9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4297063 Reviewed-by: Peter Marheine Reviewed-by: Keith Short --- zephyr/shim/chip/it8xxx2/include/flash_chip.h | 3 +-- zephyr/shim/include/config_chip.h | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/zephyr/shim/chip/it8xxx2/include/flash_chip.h b/zephyr/shim/chip/it8xxx2/include/flash_chip.h index 00aaba05fd..b3f51ba378 100644 --- a/zephyr/shim/chip/it8xxx2/include/flash_chip.h +++ b/zephyr/shim/chip/it8xxx2/include/flash_chip.h @@ -27,7 +27,6 @@ * register with persistent state. */ #define CONFIG_FW_PSTATE_SIZE CONFIG_FLASH_BANK_SIZE -#define CONFIG_FW_PSTATE_OFF \ - (CONFIG_RO_STORAGE_OFF + CONFIG_RO_SIZE - CONFIG_FW_PSTATE_SIZE) +#define CONFIG_FW_PSTATE_OFF (CONFIG_RO_STORAGE_OFF + CONFIG_RO_SIZE) #endif /* __CROS_EC_FLASH_CHIP_H */ diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index 9cc4b8510c..28adf77077 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -547,7 +547,11 @@ extern char mock_jump_data[CONFIG_PLATFORM_EC_PRESERVED_END_OF_RAM_SIZE]; #define CONFIG_WP_STORAGE_OFF CONFIG_EC_PROTECTED_STORAGE_OFF #define CONFIG_WP_STORAGE_SIZE CONFIG_EC_PROTECTED_STORAGE_SIZE +#if defined(CONFIG_PLATFORM_EC_FLASH_PSTATE) +#define CONFIG_RO_SIZE (CONFIG_CROS_EC_RO_SIZE - CONFIG_FW_PSTATE_SIZE) +#else #define CONFIG_RO_SIZE CONFIG_CROS_EC_RO_SIZE +#endif #define CONFIG_RW_SIZE CONFIG_CROS_EC_RW_SIZE /* -- cgit v1.2.1