diff options
author | Jack Rosenthal <jrosenth@chromium.org> | 2021-02-02 12:05:52 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-02-03 01:27:11 +0000 |
commit | cdbc16cd010ff66115ddb38faf7356cbfc0395bb (patch) | |
tree | b830b85a43a2c7511ad891bac944752d909edef5 /chip/stm32 | |
parent | 699a10d6818f2b8bb5eb8c918d9dd5f12d461a40 (diff) | |
download | chrome-ec-cdbc16cd010ff66115ddb38faf7356cbfc0395bb.tar.gz |
stm32: assume no vbnv
CONFIG_HOSTCMD_VBNV_CONTEXT is deprecated and removed.
Cleanup preprocessor statements to assume it's never defined. This
makes CONFIG_STM32_RESET_FLAGS_EXTENDED obsolete, since it's now
always defined, so that gets removed too.
BUG=b:178689388
BRANCH=none
TEST=buildall
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Change-Id: Id040ce2ceca95ecde37de0014aafdbfd3087e00d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2668688
Reviewed-by: Edward Hill <ecgh@chromium.org>
Reviewed-by: Craig Hesling <hesling@chromium.org>
Diffstat (limited to 'chip/stm32')
-rw-r--r-- | chip/stm32/bkpdata.c | 18 | ||||
-rw-r--r-- | chip/stm32/bkpdata.h | 16 | ||||
-rw-r--r-- | chip/stm32/system.c | 2 |
3 files changed, 2 insertions, 34 deletions
diff --git a/chip/stm32/bkpdata.c b/chip/stm32/bkpdata.c index bb1a7a5de3..8c85366857 100644 --- a/chip/stm32/bkpdata.c +++ b/chip/stm32/bkpdata.c @@ -54,14 +54,6 @@ int bkpdata_index_lookup(enum system_bbram_idx idx, int *msb) { *msb = 0; -#ifdef CONFIG_HOSTCMD_VBNV_CONTEXT - if (idx >= SYSTEM_BBRAM_IDX_VBNVBLOCK0 && - idx <= SYSTEM_BBRAM_IDX_VBNVBLOCK15) { - *msb = (idx - SYSTEM_BBRAM_IDX_VBNVBLOCK0) % 2; - return BKPDATA_INDEX_VBNV_CONTEXT0 + - (idx - SYSTEM_BBRAM_IDX_VBNVBLOCK0) / 2; - } -#endif #ifdef CONFIG_USB_PD_DUAL_ROLE if (idx == SYSTEM_BBRAM_IDX_PD0) return BKPDATA_INDEX_PD0; @@ -76,21 +68,15 @@ int bkpdata_index_lookup(enum system_bbram_idx idx, int *msb) uint32_t bkpdata_read_reset_flags() { uint32_t flags = bkpdata_read(BKPDATA_INDEX_SAVED_RESET_FLAGS); -#ifdef CONFIG_STM32_RESET_FLAGS_EXTENDED + flags |= bkpdata_read(BKPDATA_INDEX_SAVED_RESET_FLAGS_2) << 16; -#endif + return flags; } __overridable void bkpdata_write_reset_flags(uint32_t save_flags) { -#ifdef CONFIG_STM32_RESET_FLAGS_EXTENDED bkpdata_write(BKPDATA_INDEX_SAVED_RESET_FLAGS, save_flags & 0xffff); bkpdata_write(BKPDATA_INDEX_SAVED_RESET_FLAGS_2, save_flags >> 16); -#else - /* Reset flags are 32-bits, but BBRAM entry is only 16 bits. */ - ASSERT(!(save_flags >> 16)); - bkpdata_write(BKPDATA_INDEX_SAVED_RESET_FLAGS, save_flags); -#endif } diff --git a/chip/stm32/bkpdata.h b/chip/stm32/bkpdata.h index 434043eb52..27715f8219 100644 --- a/chip/stm32/bkpdata.h +++ b/chip/stm32/bkpdata.h @@ -15,26 +15,10 @@ /* We use 16-bit BKP / BBRAM entries. */ #define STM32_BKP_ENTRIES (STM32_BKP_BYTES / 2) -/* - * Use 32-bit for reset flags, if we have space for it: - * - 2 indexes are used unconditionally (SCRATCHPAD and SAVED_RESET_FLAGS) - * - VBNV_CONTEXT requires 8 indexes, so a total of 10 (which is the total - * number of entries on some STM32 variants). - * - Other config options are not a problem (they only take a few entries) - * - * Given this, we can only add an extra entry for the top 16-bit of reset flags - * if VBNV_CONTEXT is not enabled, or if we have more than 10 entries. - */ -#if !defined(CONFIG_HOSTCMD_VBNV_CONTEXT) || STM32_BKP_ENTRIES > 10 -#define CONFIG_STM32_RESET_FLAGS_EXTENDED -#endif - enum bkpdata_index { BKPDATA_INDEX_SCRATCHPAD, /* General-purpose scratchpad */ BKPDATA_INDEX_SAVED_RESET_FLAGS, /* Saved reset flags */ -#ifdef CONFIG_STM32_RESET_FLAGS_EXTENDED BKPDATA_INDEX_SAVED_RESET_FLAGS_2, /* Saved reset flags (cont) */ -#endif #ifdef CONFIG_SOFTWARE_PANIC BKPDATA_INDEX_SAVED_PANIC_REASON, /* Saved panic reason */ BKPDATA_INDEX_SAVED_PANIC_INFO, /* Saved panic data */ diff --git a/chip/stm32/system.c b/chip/stm32/system.c index aec36a48dd..bba2f72fcc 100644 --- a/chip/stm32/system.c +++ b/chip/stm32/system.c @@ -358,10 +358,8 @@ void system_reset(int flags) if (flags & SYSTEM_RESET_STAY_IN_RO) save_flags |= EC_RESET_FLAG_STAY_IN_RO; -#ifdef CONFIG_STM32_RESET_FLAGS_EXTENDED if (flags & SYSTEM_RESET_AP_WATCHDOG) save_flags |= EC_RESET_FLAG_AP_WATCHDOG; -#endif chip_save_reset_flags(save_flags); |