diff options
author | Tom Hughes <tomhughes@chromium.org> | 2019-07-02 16:53:45 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-07-24 01:54:09 +0000 |
commit | 6f994b8e3ac868ffb1fba35473c753e65dcd1b5e (patch) | |
tree | 445179be58aa1bb824166c4d4ca84c87c600b42a /chip/stm32/flash-stm32f3.c | |
parent | dd03af6a9a56a1aed1ebe1a591caac2fa699bd52 (diff) | |
download | chrome-ec-6f994b8e3ac868ffb1fba35473c753e65dcd1b5e.tar.gz |
hatch_fp: Add RDP (read protection) support to STM32F4
BRANCH=none
BUG=b:125419658
TEST=Remove "-U" flag in STM32MON_READ_FLAGS in flash_fp_mcu_common.sh
flash_fp_mcu -r foo.bin => success
hexdump foo.bin => valid data
ectool --name=cros_fp flashprotect enable
ectool --name=cros_fp reboot_ec
flash_fp_mcu -r foo.bin => fails
Add "-U" flag back to STM32MON_READ_FLAGS in flash_fp_mcu_common.sh
flash_fp_mcu -r foo.bin => success
hexdump foo.bin => all 0xFF
Change-Id: Ic3ec18262e653b72baf239caa8db12186a63613c
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1692220
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'chip/stm32/flash-stm32f3.c')
-rw-r--r-- | chip/stm32/flash-stm32f3.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/chip/stm32/flash-stm32f3.c b/chip/stm32/flash-stm32f3.c index f0c8028f61..efa74c90cd 100644 --- a/chip/stm32/flash-stm32f3.c +++ b/chip/stm32/flash-stm32f3.c @@ -5,8 +5,10 @@ /* Flash memory module for stm32f3 and stm32f4 */ +#include <stdbool.h> #include "common.h" #include "flash.h" +#include "flash-f.h" #include "hooks.h" #include "registers.h" #include "system.h" @@ -103,6 +105,11 @@ uint32_t flash_physical_get_protect_flags(void) if (entire_flash_locked) flags |= EC_FLASH_PROTECT_ALL_NOW; +#if defined(CONFIG_FLASH_READOUT_PROTECTION_AS_PSTATE) + if (is_flash_rdp_enabled()) + flags |= EC_FLASH_PROTECT_RO_AT_BOOT; +#endif + return flags; } |