aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandrine Bailleux <sandrine.bailleux@arm.com>2014-03-06 15:24:14 +0000
committerSandrine Bailleux <sandrine.bailleux@arm.com>2014-03-12 16:05:32 +0000
commit4c05b6bc30c4d3d7005d3577e1b2d13f7aac2939 (patch)
tree4c5a1101717cb49a34bf66e758126d5ea82cd2ac
parent68020e3ffad699587f8bec6fea1ddf8774e8f0dc (diff)
juno: Implement plat_report_exception() function
As for FVP platforms, Juno provides some LEDs that we can use to report exceptions during the early boot code.
-rw-r--r--plat/juno/aarch64/plat_helpers.S13
-rw-r--r--plat/juno/platform.h19
2 files changed, 30 insertions, 2 deletions
diff --git a/plat/juno/aarch64/plat_helpers.S b/plat/juno/aarch64/plat_helpers.S
index cd6cbde..24bf812 100644
--- a/plat/juno/aarch64/plat_helpers.S
+++ b/plat/juno/aarch64/plat_helpers.S
@@ -39,12 +39,21 @@
* void plat_report_exception(unsigned int type)
* Function to report an unhandled exception
* with platform-specific means.
- * On FVP platform, it updates the LEDs
+ * On Juno platform, it updates the LEDs
* to indicate where we are
* ---------------------------------------------
*/
plat_report_exception:
- /* Juno todo: Come up with a way of reporting errors */
+ mrs x1, CurrentEl
+ lsr x1, x1, #MODE_EL_SHIFT
+ lsl x1, x1, #SYS_LED_EL_SHIFT
+ lsl x0, x0, #SYS_LED_EC_SHIFT
+ mov x2, #(SECURE << SYS_LED_SS_SHIFT)
+ orr x0, x0, x2
+ orr x0, x0, x1
+ mov x1, #VE_SYSREGS_BASE
+ add x1, x1, #V2M_SYS_LED
+ str w0, [x1]
ret
/*
diff --git a/plat/juno/platform.h b/plat/juno/platform.h
index 1730532..2dfa187 100644
--- a/plat/juno/platform.h
+++ b/plat/juno/platform.h
@@ -148,6 +148,25 @@
#define CNTACR_RWVT_SHIFT 0x4
#define CNTACR_RWPT_SHIFT 0x5
+/* V2M motherboard system registers & offsets */
+#define VE_SYSREGS_BASE 0x1c010000
+#define V2M_SYS_LED 0x8
+
+/*
+ * V2M sysled bit definitions. The values written to this
+ * register are defined in arch.h & runtime_svc.h. Only
+ * used by the primary cpu to diagnose any cold boot issues.
+ *
+ * SYS_LED[0] - Security state (S=0/NS=1)
+ * SYS_LED[2:1] - Exception Level (EL3-EL0)
+ * SYS_LED[7:3] - Exception Class (Sync/Async & origin)
+ *
+ */
+#define SYS_LED_SS_SHIFT 0x0
+#define SYS_LED_EL_SHIFT 0x1
+#define SYS_LED_EC_SHIFT 0x3
+
+
/*******************************************************************************
* BL2 specific defines.
******************************************************************************/