diff options
author | Patryk Duda <pdk@semihalf.com> | 2021-05-28 20:38:08 +0200 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-06-09 22:47:59 +0000 |
commit | db3d4c5ba4718ebe5a2f601db495b512e175552d (patch) | |
tree | 7ac79eaec8e4d4f2737c1936be7c89cfa9750971 /core | |
parent | bd2c57278e3a3c6b351c6aaccc5907d7a6de56cb (diff) | |
download | chrome-ec-db3d4c5ba4718ebe5a2f601db495b512e175552d.tar.gz |
cortex-m/panic: Flush D-cache after panic data is filled
Affected boards (only STM32H7):
- nocturne_fp (dartmonkey)
- nucleo-h743zi
After writing panic information it is good to flush cache to make sure
that all changes are in RAM. Without this, 'panicinfo' will report
incorrect values after reboot.
BUG=b:170432597
BRANCH=none
TEST=Compile dartmonkey firmware and run it on eg. icetower.
In RW, use 'crash' command to trigger panic (do not use
'crash watchdog' it uses different path). Make sure that after
sysjump to RW panic data contains correct information.
Panic data can be dumped using 'panicinfo' command.
Signed-off-by: Patryk Duda <pdk@semihalf.com>
Change-Id: Iabe2b1de00683d95f55a3124b46dfa600f8ac0bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2923503
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'core')
-rw-r--r-- | core/cortex-m/panic.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/cortex-m/panic.c b/core/cortex-m/panic.c index 2052656410..acd806b761 100644 --- a/core/cortex-m/panic.c +++ b/core/cortex-m/panic.c @@ -336,6 +336,11 @@ void __keep report_panic(void) * exception happened in a handler's context. */ #endif + + /* Make sure that all changes are saved into RAM */ + if (IS_ENABLED(CONFIG_ARMV7M_CACHE)) + cpu_clean_invalidate_dcache(); + panic_reboot(); } |