Commit c6ae55cc authored by Marek Vasut's avatar Marek Vasut
Browse files

rcar_gen3: plat: Dump EL3 interrupt error registers



Since the interrupts are handled in EL3, dump the EL3 error registers
in case an error happens.
Signed-off-by: default avatarMarek Vasut <marek.vasut+renesas@gmail.com>
parent d48536e2
...@@ -217,6 +217,8 @@ endfunc platform_mem_init ...@@ -217,6 +217,8 @@ endfunc platform_mem_init
* --------------------------------------------- * ---------------------------------------------
*/ */
func plat_report_exception func plat_report_exception
/* Switch to SP_EL0 */
msr spsel, #0
#if IMAGE_BL2 #if IMAGE_BL2
mov w1, #FIQ_SP_EL0 mov w1, #FIQ_SP_EL0
cmp w0, w1 cmp w0, w1
......
...@@ -24,7 +24,7 @@ void bl2_interrupt_error_id(uint32_t int_id) ...@@ -24,7 +24,7 @@ void bl2_interrupt_error_id(uint32_t int_id)
ERROR("\n"); ERROR("\n");
if (int_id >= SWDT_ERROR_ID) { if (int_id >= SWDT_ERROR_ID) {
ERROR("Unhandled exception occurred.\n"); ERROR("Unhandled exception occurred.\n");
ERROR(" Exception type = FIQ_SP_ELX\n"); ERROR(" Exception type = FIQ_SP_EL0\n");
panic(); panic();
} }
...@@ -32,11 +32,11 @@ void bl2_interrupt_error_id(uint32_t int_id) ...@@ -32,11 +32,11 @@ void bl2_interrupt_error_id(uint32_t int_id)
gicv2_end_of_interrupt((uint32_t) int_id); gicv2_end_of_interrupt((uint32_t) int_id);
rcar_swdt_release(); rcar_swdt_release();
ERROR("Unhandled exception occurred.\n"); ERROR("Unhandled exception occurred.\n");
ERROR(" Exception type = FIQ_SP_ELX\n"); ERROR(" Exception type = FIQ_SP_EL0\n");
ERROR(" SPSR_EL1 = 0x%x\n", (uint32_t) read_spsr_el1()); ERROR(" SPSR_EL3 = 0x%x\n", (uint32_t) read_spsr_el3());
ERROR(" ELR_EL1 = 0x%x\n", (uint32_t) read_elr_el1()); ERROR(" ELR_EL3 = 0x%x\n", (uint32_t) read_elr_el3());
ERROR(" ESR_EL1 = 0x%x\n", (uint32_t) read_esr_el1()); ERROR(" ESR_EL3 = 0x%x\n", (uint32_t) read_esr_el3());
ERROR(" FAR_EL1 = 0x%x\n", (uint32_t) read_far_el1()); ERROR(" FAR_EL3 = 0x%x\n", (uint32_t) read_far_el3());
ERROR("\n"); ERROR("\n");
panic(); panic();
} }
...@@ -78,27 +78,27 @@ void bl2_interrupt_error_type(uint32_t ex_type) ...@@ -78,27 +78,27 @@ void bl2_interrupt_error_type(uint32_t ex_type)
&interrupt_ex[ex_type][0]); &interrupt_ex[ex_type][0]);
ERROR("%s", msg); ERROR("%s", msg);
switch (ex_type) { switch (ex_type) {
case SYNC_EXCEPTION_SP_ELX: case SYNC_EXCEPTION_SP_EL0:
ERROR(" SPSR_EL1 = 0x%x\n", (uint32_t) read_spsr_el1()); ERROR(" SPSR_EL3 = 0x%x\n", (uint32_t) read_spsr_el3());
ERROR(" ELR_EL1 = 0x%x\n", (uint32_t) read_elr_el1()); ERROR(" ELR_EL3 = 0x%x\n", (uint32_t) read_elr_el3());
ERROR(" ESR_EL1 = 0x%x\n", (uint32_t) read_esr_el1()); ERROR(" ESR_EL3 = 0x%x\n", (uint32_t) read_esr_el3());
ERROR(" FAR_EL1 = 0x%x\n", (uint32_t) read_far_el1()); ERROR(" FAR_EL3 = 0x%x\n", (uint32_t) read_far_el3());
break; break;
case IRQ_SP_ELX: case IRQ_SP_EL0:
ERROR(" SPSR_EL1 = 0x%x\n", (uint32_t) read_spsr_el1()); ERROR(" SPSR_EL3 = 0x%x\n", (uint32_t) read_spsr_el3());
ERROR(" ELR_EL1 = 0x%x\n", (uint32_t) read_elr_el1()); ERROR(" ELR_EL3 = 0x%x\n", (uint32_t) read_elr_el3());
ERROR(" IAR_EL1 = 0x%x\n", gicv2_acknowledge_interrupt()); ERROR(" IAR_EL3 = 0x%x\n", gicv2_acknowledge_interrupt());
break; break;
case FIQ_SP_ELX: case FIQ_SP_EL0:
ERROR(" SPSR_EL1 = 0x%x\n", (uint32_t) read_spsr_el1()); ERROR(" SPSR_EL3 = 0x%x\n", (uint32_t) read_spsr_el3());
ERROR(" ELR_EL1 = 0x%x\n", (uint32_t) read_elr_el1()); ERROR(" ELR_EL3 = 0x%x\n", (uint32_t) read_elr_el3());
ERROR(" IAR_EL1 = 0x%x\n", gicv2_acknowledge_interrupt()); ERROR(" IAR_EL3 = 0x%x\n", gicv2_acknowledge_interrupt());
break; break;
case SERROR_SP_ELX: case SERROR_SP_EL0:
ERROR(" SPSR_EL1 = 0x%x\n", (uint32_t) read_spsr_el1()); ERROR(" SPSR_EL3 = 0x%x\n", (uint32_t) read_spsr_el3());
ERROR(" ELR_EL1 = 0x%x\n", (uint32_t) read_elr_el1()); ERROR(" ELR_EL3 = 0x%x\n", (uint32_t) read_elr_el3());
ERROR(" ESR_EL1 = 0x%x\n", (uint32_t) read_esr_el1()); ERROR(" ESR_EL3 = 0x%x\n", (uint32_t) read_esr_el3());
ERROR(" FAR_EL1 = 0x%x\n", (uint32_t) read_far_el1()); ERROR(" FAR_EL3 = 0x%x\n", (uint32_t) read_far_el3());
break; break;
default: default:
break; break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment