diff options
-rw-r--r-- | util/config_allowed.txt | 2 | ||||
-rw-r--r-- | zephyr/Kconfig.flash | 24 | ||||
-rw-r--r-- | zephyr/shim/include/config_chip.h | 10 |
3 files changed, 34 insertions, 2 deletions
diff --git a/util/config_allowed.txt b/util/config_allowed.txt index d952250e8f..0a5d140b80 100644 --- a/util/config_allowed.txt +++ b/util/config_allowed.txt @@ -393,8 +393,6 @@ CONFIG_FLASH_MULTIPLE_REGION CONFIG_FLASH_PHYSICAL CONFIG_FLASH_PROTECT_NEXT_BOOT CONFIG_FLASH_PROTECT_RW -CONFIG_FLASH_PSTATE_BANK -CONFIG_FLASH_PSTATE_LOCKED CONFIG_FLASH_READOUT_PROTECTION CONFIG_FLASH_READOUT_PROTECTION_AS_PSTATE CONFIG_FLASH_REGION_TYPE_COUNT diff --git a/zephyr/Kconfig.flash b/zephyr/Kconfig.flash index 8f3c77499a..44c4b0617f 100644 --- a/zephyr/Kconfig.flash +++ b/zephyr/Kconfig.flash @@ -120,6 +120,30 @@ config PLATFORM_EC_FLASH_PSTATE defined, write protect state is maintained solely by the physical flash driver. +if PLATFORM_EC_FLASH_PSTATE + +config PLATFORM_EC_FLASH_PSTATE_BANK + bool "Store the pstate data in its own dedicated bank of flash" + default y + help + Store the pstate data in its own dedicated bank of flash. This allows + disabling the protect-RO-at-boot flag without rewriting the RO + firmware, but costs a bank of flash. + + If this is not defined, the pstate data is stored inside the RO + firmware image itself. This is more space-efficient, but the only way + to clear the flag once it's set is to rewrite the RO firmware (after + removing the WP screw, of course). + +config PLATFORM_EC_FLASH_PSTATE_LOCKED + bool "Lock the pstate by default" + depends on !PLATFORM_EC_FLASH_PSTATE_BANK + help + Lock the pstate by default, Currently only supported when + PLATFORM_EC_FLASH_PSTATE_BANK is not defined. + +endif # PLATFORM_EC_FLASH_PSTATE + config PLATFORM_EC_USE_ZEPHYR_FLASH_PAGE_LAYOUT bool "Use Zephyr flash page layout API to get sector information" default y if SOC_FAMILY_STM32 diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index 0ea6bcd187..2659ac66ce 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -585,6 +585,8 @@ extern char mock_jump_data[CONFIG_PLATFORM_EC_PRESERVED_END_OF_RAM_SIZE]; #undef CONFIG_INTERNAL_STORAGE #undef CONFIG_MAPPED_STORAGE #undef CONFIG_FLASH_PSTATE +#undef CONFIG_FLASH_PSTATE_BANK +#undef CONFIG_FLASH_PSTATE_LOCKED #ifdef CONFIG_PLATFORM_EC_FLASH_CROS #ifdef CONFIG_BOARD_NATIVE_POSIX @@ -620,6 +622,14 @@ extern char mock_jump_data[CONFIG_PLATFORM_EC_PRESERVED_END_OF_RAM_SIZE]; #define CONFIG_FLASH_PSTATE #endif +#ifdef CONFIG_PLATFORM_EC_FLASH_PSTATE_BANK +#define CONFIG_FLASH_PSTATE_BANK +#endif + +#ifdef CONFIG_PLATFORM_EC_FLASH_PSTATE_LOCKED +#define CONFIG_FLASH_PSTATE_LOCKED +#endif + #undef CONFIG_CMD_FLASH #ifdef CONFIG_PLATFORM_EC_CONSOLE_CMD_FLASH #define CONFIG_CMD_FLASH |