From 90ef8b700629381ac62aae4f87612ef84b32cb35 Mon Sep 17 00:00:00 2001 From: Shawn Nematbakhsh Date: Wed, 4 Mar 2015 10:35:25 -0800 Subject: lm4: stm32: Store panic data in backup registers on hard reset On hard reset / hibernate, RAM will be erased and panic data will normally be lost. When software panic data saving is enabled, try to save this data just before hard reset and restore it when we come back up. BUG=chrome-os-partner:37380 TEST=Manual on Samus with WP + SW sync enabled. Boot AP, then run "crash divzero" on console. After hard reset, verify that "panicinfo" dumps data and shows divzero exception code. BRANCH=Samus Signed-off-by: Shawn Nematbakhsh Change-Id: I9516dd4b6db12ef35e512cc4710f9b97d7e663cb Reviewed-on: https://chromium-review.googlesource.com/255912 Reviewed-by: Randall Spangler --- include/panic.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'include/panic.h') diff --git a/include/panic.h b/include/panic.h index 122f0c317c..ea7a40f7b0 100644 --- a/include/panic.h +++ b/include/panic.h @@ -129,13 +129,18 @@ void panic_reboot(void); * Store a panic log and halt the system for a software-related reason, such as * stack overflow or assertion failure. */ -void software_panic(uint32_t panic_reason, uint32_t panic_info); +void software_panic(uint32_t reason, uint32_t info); /** - * Log a watchdog panic in the panic log. Called on the subsequent reboot after - * the watchdog fires. + * Log a panic in the panic log, but don't halt the system. Normally + * called on the subsequent reboot after panic detection. */ -void panic_log_watchdog(void); +void panic_set_reason(uint32_t reason, uint32_t info, uint8_t exception); + +/** + * Retrieve the currently stored panic reason + info. + */ +void panic_get_reason(uint32_t *reason, uint32_t *info, uint8_t *exception); #endif /** -- cgit v1.2.1