armv8: layerscape: move TZASC and TZPC configs to Kconfig
[oweals/u-boot.git] / arch / arm / cpu / armv8 / psci.S
index 43d5d6bde08896e9cdb9d2d431e558d409b169ab..358df8fee9c32a1d5956e5a1252e48b8f88fa896 100644 (file)
@@ -1,8 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright 2016 Freescale Semiconductor, Inc.
  * Author: Hongbo Zhang <hongbo.zhang@nxp.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  * This file implements LS102X platform PSCI SYSTEM-SUSPEND function
  */
 
@@ -237,6 +236,28 @@ handle_sync:
 
        b       unhandled_exception
 
+#ifdef CONFIG_ARMV8_EA_EL3_FIRST
+/*
+ * Override this function if custom error handling is
+ * needed for asynchronous aborts
+ */
+ENTRY(plat_error_handler)
+       ret
+ENDPROC(plat_error_handler)
+.weak plat_error_handler
+
+handle_error:
+       bl      psci_get_cpu_id
+       bl      psci_get_cpu_stack_top
+       mov     x9, #1
+       msr     spsel, x9
+       mov     sp, x0
+
+       bl      plat_error_handler      /* Platform specific error handling */
+deadloop:
+       b       deadloop                /* Never return */
+#endif
+
        .align  11
        .globl  el3_exception_vectors
 el3_exception_vectors:
@@ -262,7 +283,11 @@ el3_exception_vectors:
        .align  7
        b       unhandled_exception     /* FIQ, Lower EL using AArch64 */
        .align  7
+#ifdef CONFIG_ARMV8_EA_EL3_FIRST
+       b       handle_error            /* SError, Lower EL using AArch64 */
+#else
        b       unhandled_exception     /* SError, Lower EL using AArch64 */
+#endif
        .align  7
        b       unhandled_exception     /* Sync, Lower EL using AArch32 */
        .align  7