diff options
-rw-r--r-- | board/hammer/board.h | 2 | ||||
-rw-r--r-- | common/flash.c | 4 | ||||
-rw-r--r-- | include/config.h | 7 |
3 files changed, 13 insertions, 0 deletions
diff --git a/board/hammer/board.h b/board/hammer/board.h index 323f364182..0e20d9f8f2 100644 --- a/board/hammer/board.h +++ b/board/hammer/board.h @@ -10,6 +10,8 @@ /* TODO: Remove CONFIG_SYSTEM_UNLOCKED prior to building MP FW. */ #define CONFIG_SYSTEM_UNLOCKED +/* TODO(b:63378217): Define FLASH_PSTATE_LOCKED prior to building MP FW. */ +#undef CONFIG_FLASH_PSTATE_LOCKED /* 48 MHz SYSCLK clock frequency */ #define CPU_CLOCK 48000000 diff --git a/common/flash.c b/common/flash.c index 46319a9508..99dea9ee98 100644 --- a/common/flash.c +++ b/common/flash.c @@ -98,7 +98,11 @@ BUILD_ASSERT(sizeof(struct persist_state) % CONFIG_FLASH_WRITE_SIZE == 0); #endif const uint32_t pstate_data __attribute__((section(".rodata.pstate"))) = +#ifdef CONFIG_FLASH_PSTATE_LOCKED + PSTATE_MAGIC_LOCKED; +#else PSTATE_MAGIC_UNLOCKED; +#endif #endif /* !CONFIG_FLASH_PSTATE_BANK */ #endif /* CONFIG_FLASH_PSTATE */ diff --git a/include/config.h b/include/config.h index 0ba9da8743..b306792619 100644 --- a/include/config.h +++ b/include/config.h @@ -1072,6 +1072,13 @@ * screw, of course). */ #define CONFIG_FLASH_PSTATE_BANK + +/* + * Lock the PSTATE by default (currently only supported when + * CONFIG_FLASH_PSTATE_BANK is not defined). + */ +#undef CONFIG_FLASH_PSTATE_LOCKED + /* * For flash that is segemented in different regions. */ |