diff options
author | Nicolas Boichat <drinkcat@chromium.org> | 2018-09-12 14:25:31 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-09-14 12:08:32 -0700 |
commit | 2c760cf30b95715791eb43701b3d5536558b3a8d (patch) | |
tree | 70902377561991e55997c7215eaf71c1862f33b7 | |
parent | 17ad0ededbc33cd22324e622d7d01fac1fae3e3a (diff) | |
download | chrome-ec-2c760cf30b95715791eb43701b3d5536558b3a8d.tar.gz |
flash: Add CONFIG_FLASH_READOUT_PROTECTION config option
Instead of tying together CONFIG_WP_ALWAYS and RDP protection,
separate the options.
BRANCH=nocturne
BUG=b:111330723
TEST=make buildall -j
Change-Id: I905b573a900ef4dd0431666c525c951582143e09
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1222093
Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r-- | board/coffeecake/board.h | 1 | ||||
-rw-r--r-- | board/cr50/board.h | 1 | ||||
-rw-r--r-- | board/dingdong/board.h | 1 | ||||
-rw-r--r-- | board/glkrvp/board.h | 1 | ||||
-rw-r--r-- | board/glkrvp_ite/board.h | 1 | ||||
-rw-r--r-- | board/hoho/board.h | 1 | ||||
-rw-r--r-- | board/nucleo-f411re/board.h | 1 | ||||
-rw-r--r-- | chip/stm32/flash-f.c | 2 | ||||
-rw-r--r-- | chip/stm32/flash-stm32l4.c | 2 | ||||
-rw-r--r-- | include/config.h | 5 |
10 files changed, 14 insertions, 2 deletions
diff --git a/board/coffeecake/board.h b/board/coffeecake/board.h index 3db2ea11b1..77abfa7f99 100644 --- a/board/coffeecake/board.h +++ b/board/coffeecake/board.h @@ -67,6 +67,7 @@ /* No Write-protect GPIO, force the write-protection */ #define CONFIG_WP_ALWAYS +#define CONFIG_FLASH_READOUT_PROTECTION #ifndef __ASSEMBLER__ diff --git a/board/cr50/board.h b/board/cr50/board.h index 8d5e7b17ea..cd1045d986 100644 --- a/board/cr50/board.h +++ b/board/cr50/board.h @@ -39,6 +39,7 @@ /* Flash configuration */ #undef CONFIG_FLASH_PSTATE #define CONFIG_WP_ALWAYS +#define CONFIG_FLASH_READOUT_PROTECTION #define CONFIG_CMD_FLASH #define CONFIG_CRC8 diff --git a/board/dingdong/board.h b/board/dingdong/board.h index 3636b3f34f..3ecbf7658c 100644 --- a/board/dingdong/board.h +++ b/board/dingdong/board.h @@ -52,6 +52,7 @@ /* No Write-protect GPIO, force the write-protection */ #define CONFIG_WP_ALWAYS +#define CONFIG_FLASH_READOUT_PROTECTION #ifndef __ASSEMBLER__ diff --git a/board/glkrvp/board.h b/board/glkrvp/board.h index 1b330f3d00..fc37732bc8 100644 --- a/board/glkrvp/board.h +++ b/board/glkrvp/board.h @@ -90,6 +90,7 @@ #define GPIO_VOLUME_UP_L GPIO_EC_VOLUP_BTN_ODL #define GPIO_VOLUME_DOWN_L GPIO_EC_VOLDN_BTN_ODL #define CONFIG_WP_ALWAYS +#define CONFIG_FLASH_READOUT_PROTECTION #define CONFIG_I2C #define CONFIG_I2C_MASTER diff --git a/board/glkrvp_ite/board.h b/board/glkrvp_ite/board.h index 4209a06bf8..3d5abee7e0 100644 --- a/board/glkrvp_ite/board.h +++ b/board/glkrvp_ite/board.h @@ -89,6 +89,7 @@ #define CONFIG_VOLUME_BUTTONS #define CONFIG_LID_SWITCH #define CONFIG_WP_ALWAYS +#define CONFIG_FLASH_READOUT_PROTECTION /* Verified boot */ #define CONFIG_SHA256_UNROLLED diff --git a/board/hoho/board.h b/board/hoho/board.h index 0698fe3f74..dd5fe2c767 100644 --- a/board/hoho/board.h +++ b/board/hoho/board.h @@ -62,6 +62,7 @@ /* No Write-protect GPIO, force the write-protection */ #define CONFIG_WP_ALWAYS +#define CONFIG_FLASH_READOUT_PROTECTION #ifndef __ASSEMBLER__ diff --git a/board/nucleo-f411re/board.h b/board/nucleo-f411re/board.h index 0a8dcc6ba8..7ffa0b0f07 100644 --- a/board/nucleo-f411re/board.h +++ b/board/nucleo-f411re/board.h @@ -53,6 +53,7 @@ #define TIM_WATCHDOG 11 #define CONFIG_WP_ALWAYS +#define CONFIG_FLASH_READOUT_PROTECTION /* ADC signal */ enum adc_channel { diff --git a/chip/stm32/flash-f.c b/chip/stm32/flash-f.c index 51fcf806ae..aaf8e69873 100644 --- a/chip/stm32/flash-f.c +++ b/chip/stm32/flash-f.c @@ -505,7 +505,7 @@ int flash_physical_protect_at_boot(uint32_t new_flags) if (original_val[i] != val[i]) write_optb(i * 2 + 8, val[i]); -#ifdef CONFIG_WP_ALWAYS +#ifdef CONFIG_FLASH_READOUT_PROTECTION /* * Set a permanent protection by increasing RDP to level 1, * trying to unprotected the flash will trigger a full erase. diff --git a/chip/stm32/flash-stm32l4.c b/chip/stm32/flash-stm32l4.c index 821d277b7a..97594733c0 100644 --- a/chip/stm32/flash-stm32l4.c +++ b/chip/stm32/flash-stm32l4.c @@ -167,7 +167,7 @@ int flash_physical_protect_at_boot(uint32_t new_flags) } unlock_optb(); -#ifdef CONFIG_WP_ALWAYS +#ifdef CONFIG_FLASH_READOUT_PROTECTION /* * Set a permanent protection by increasing RDP to level 1, * trying to unprotected the flash will trigger a full erase. diff --git a/include/config.h b/include/config.h index 21d58a0ec7..6a241e81fa 100644 --- a/include/config.h +++ b/include/config.h @@ -1441,6 +1441,11 @@ #undef CONFIG_FLASH_PSTATE_LOCKED /* + * Enable readout protection. + */ +#undef CONFIG_FLASH_READOUT_PROTECTION + +/* * For flash that is segemented in different regions. */ #undef CONFIG_FLASH_MULTIPLE_REGION |