From 220d0bf43c6ec01bac79360b99b75199b04d4ada Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 9 Jul 2019 14:19:20 -0700 Subject: stm32h7: Fail build if CONFIG_FLASH_READOUT_PROTECTION_AS_PSTATE not used As comment indicates, we're not sure that using RSS1 for the write protect PSTATE is safe. BRANCH=none BUG=chromium:888104 TEST=In nocturne_fp board.h file: #undef CONFIG_FLASH_READOUT_PROTECTION_AS_PSTATE => Build fails with error as expected Change-Id: I0236381738e7ecf9b18a8d10dc7ba4b9dc370001 Signed-off-by: Tom Hughes Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1693339 Reviewed-by: Nicolas Boichat --- chip/stm32/flash-stm32h7.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chip/stm32/flash-stm32h7.c b/chip/stm32/flash-stm32h7.c index ba0a8a69f1..960f478cd2 100644 --- a/chip/stm32/flash-stm32h7.c +++ b/chip/stm32/flash-stm32h7.c @@ -161,6 +161,9 @@ static void protect_blocks(uint32_t blocks) * If RDP is not defined, use the option bytes RSS1 bit. * TODO(crbug.com/888104): Validate that using RSS1 for this purpose is safe. */ +#ifndef CONFIG_FLASH_READOUT_PROTECTION_AS_PSTATE +#error "crbug.com/888104: Using RSS1 for write protect PSTATE may not be safe." +#endif static int is_wp_enabled(void) { #ifdef CONFIG_FLASH_READOUT_PROTECTION_AS_PSTATE -- cgit v1.2.1