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.
This commit is contained in:
Sandrine Bailleux 2014-03-06 15:24:14 +00:00
parent 68020e3ffa
commit 4c05b6bc30
2 changed files with 30 additions and 2 deletions

View File

@ -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
/*

View File

@ -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.
******************************************************************************/