aboutsummaryrefslogtreecommitdiff
path: root/plat/st/stm32mp1
diff options
context:
space:
mode:
authorYann Gautier <yann.gautier@st.com>2020-09-15 12:29:53 +0200
committerYann Gautier <yann.gautier@st.com>2020-09-21 17:53:42 +0200
commit6397423ed4a08adea3605f60a168a34c2a7ec526 (patch)
tree005871f3b0f81e7698a1765c5031e33489308c4b /plat/st/stm32mp1
parenta9eda77c22d045dc7f09272b3cba76225177f9f5 (diff)
downloadtrusted-firmware-a-6397423ed4a08adea3605f60a168a34c2a7ec526.tar.gz
stm32mp1: add plat_panic_handler function
The STM32MP1 implementation of this function will call plat_report_exception(). It displays more information about the panic if DEBUG is enabled. The LR register is also filled with R6 content, which hold the faulty address. This allows debugger to reconstruct the backtrace. Change-Id: I6710e8e2ab6658b05c5bbad2f3c545f07f355afb Signed-off-by: Yann Gautier <yann.gautier@st.com>
Diffstat (limited to 'plat/st/stm32mp1')
-rw-r--r--plat/st/stm32mp1/stm32mp1_helper.S17
1 files changed, 17 insertions, 0 deletions
diff --git a/plat/st/stm32mp1/stm32mp1_helper.S b/plat/st/stm32mp1/stm32mp1_helper.S
index b4b699ea43..560e06e20e 100644
--- a/plat/st/stm32mp1/stm32mp1_helper.S
+++ b/plat/st/stm32mp1/stm32mp1_helper.S
@@ -216,6 +216,23 @@ func plat_crash_console_putc
b console_stm32_core_putc
endfunc plat_crash_console_putc
+ /* ----------------------------------------------------------
+ * void plat_panic_handler(void) __dead2;
+ * Report exception + endless loop.
+ *
+ * r6 holds the address where the fault occurred.
+ * Filling lr with this value allows debuggers to reconstruct
+ * the backtrace.
+ * ----------------------------------------------------------
+ */
+func plat_panic_handler
+ mrs r0, cpsr
+ and r0, #MODE32_MASK
+ bl plat_report_exception
+ mov lr, r6
+ b .
+endfunc plat_panic_handler
+
#if DEBUG
.section .rodata.rev_err_str, "aS"
abort_str: