rockchip: Implement a panic handler that will reboot the system
authorJulius Werner <jwerner@chromium.org>
Tue, 20 Jun 2017 00:05:30 +0000 (17:05 -0700)
committerJulius Werner <jwerner@chromium.org>
Tue, 12 Dec 2017 23:00:34 +0000 (15:00 -0800)
The current Rockchip platform code retains the "common" default panic
handler which simply hangs the system (until the watchdog kicks in, if
enabled). This is usually not a great user experience.

This patch implements a Rockchip-specific panic handler that calls the
platform's reboot implementation to reset the system.

Change-Id: I4cbe09c48f1b3f86ebdfc0108c186565f9ffc119
Signed-off-by: Julius Werner <jwerner@chromium.org>
plat/rockchip/common/aarch64/plat_helpers.S

index abfb5a7951d95ce8a9cb5195a8aff104bd7899ef..24cb8e45afd4b490aefe9157a4d7eef7b49c67d5 100644 (file)
@@ -23,6 +23,7 @@
        .globl  plat_crash_console_putc
        .globl  plat_my_core_pos
        .globl  plat_reset_handler
+       .globl  plat_panic_handler
 
        /*
         * void plat_reset_handler(void);
@@ -107,6 +108,19 @@ func plat_crash_console_putc
        b       console_core_putc
 endfunc plat_crash_console_putc
 
+       /* --------------------------------------------------------------------
+        * void plat_panic_handler(void)
+        * Call system reset function on panic. Set up an emergency stack so we
+        * can run C functions (it only needs to last for a few calls until we
+        * reboot anyway).
+        * --------------------------------------------------------------------
+        */
+func plat_panic_handler
+       msr     spsel, #0
+       bl      plat_set_my_stack
+       b       rockchip_soc_soft_reset
+endfunc plat_panic_handler
+
        /* --------------------------------------------------------------------
         * void platform_cpu_warmboot (void);
         * cpus online or resume enterpoint