diff options
author | Yann Gautier <yann.gautier@st.com> | 2019-08-29 19:04:29 +0200 |
---|---|---|
committer | Yann Gautier <yann.gautier@st.com> | 2022-10-03 14:44:05 +0200 |
commit | 0423868373026a667f0c004e4d365fa12fd734ef (patch) | |
tree | 60699886899df2e686fe0687ba22c27cdb010792 /plat/st | |
parent | 6dc5979a6cb2121e4c16e7bd62e24030e0f42755 (diff) | |
download | arm-trusted-firmware-0423868373026a667f0c004e4d365fa12fd734ef.tar.gz |
feat(stm32mp1): add plat_report_*_abort functions
The new helpers are created in STM32MP1 platform for prefetch and data
aborts.
While at it, put plat_report_exception() under DEBUG flag. If DEBUG is
not set, the weak function which does the same will be used.
This plat_report_exception() function can also be simplified, as it will
no more be used to report aborts.
Change-Id: Ibe989b28e236693f317cffb0545ea0611b7bdde4
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Diffstat (limited to 'plat/st')
-rw-r--r-- | plat/st/stm32mp1/stm32mp1_helper.S | 97 |
1 files changed, 82 insertions, 15 deletions
diff --git a/plat/st/stm32mp1/stm32mp1_helper.S b/plat/st/stm32mp1/stm32mp1_helper.S index cac9752e2..eb8823b02 100644 --- a/plat/st/stm32mp1/stm32mp1_helper.S +++ b/plat/st/stm32mp1/stm32mp1_helper.S @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2021, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2015-2022, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -15,6 +15,8 @@ .globl platform_mem_init .globl plat_report_exception + .globl plat_report_prefetch_abort + .globl plat_report_data_abort .globl plat_get_my_entrypoint .globl plat_secondary_cold_boot_setup .globl plat_reset_handler @@ -30,20 +32,18 @@ func platform_mem_init bx lr endfunc platform_mem_init -func plat_report_exception #if DEBUG +func plat_report_exception mov r8, lr - /* Test if an abort occurred */ + /* + * Test if an abort occurred + * In this case the error message has already been displayed + * by dedicated functions + */ cmp r0, #MODE32_abt - bne undef_inst_lbl - ldr r4, =abort_str - bl asm_print_str - mrs r4, lr_abt - sub r4, r4, #4 - b print_exception_info + beq 1f -undef_inst_lbl: /* Test for an undefined instruction */ cmp r0, #MODE32_und bne other_exception_lbl @@ -69,12 +69,69 @@ print_exception_info: ldr r4, =end_error_str bl asm_print_str +1: bx r8 -#else - bx lr -#endif endfunc plat_report_exception +func plat_report_prefetch_abort + mov r8, lr + mov r9, r0 + + ldr r4, =prefetch_abort_str + bl asm_print_str + + mov r4, r9 + sub r4, r4, #4 + bl asm_print_hex + + ldr r4, =ifsr_str + bl asm_print_str + + ldcopr r4, IFSR + bl asm_print_hex + + ldr r4, =ifar_str + bl asm_print_str + + ldcopr r4, IFAR + bl asm_print_hex + + ldr r4, =end_error_str + bl asm_print_str + + bx r8 +endfunc plat_report_prefetch_abort + +func plat_report_data_abort + mov r8, lr + mov r9, r0 + + ldr r4, =data_abort_str + bl asm_print_str + + mov r4, r9 + sub r4, r4, #8 + bl asm_print_hex + + ldr r4, =dfsr_str + bl asm_print_str + + ldcopr r4, DFSR + bl asm_print_hex + + ldr r4, =dfar_str + bl asm_print_str + + ldcopr r4, DFAR + bl asm_print_hex + + ldr r4, =end_error_str + bl asm_print_str + + bx r8 +endfunc plat_report_data_abort +#endif /* DEBUG */ + func plat_reset_handler bx lr endfunc plat_reset_handler @@ -256,14 +313,24 @@ endfunc plat_panic_handler #if DEBUG .section .rodata.rev_err_str, "aS" -abort_str: - .asciz "\nAbort at: 0x" +prefetch_abort_str: + .asciz "\nPrefetch Abort at: 0x" +data_abort_str: + .asciz "\nData Abort at: 0x" undefined_str: .asciz "\nUndefined instruction at: 0x" exception_start_str: .asciz "\nException mode=0x" exception_end_str: .asciz " at: 0x" +dfsr_str: + .asciz " DFSR = 0x" +dfar_str: + .asciz " DFAR = 0x" +ifsr_str: + .asciz " IFSR = 0x" +ifar_str: + .asciz " IFAR = 0x" end_error_str: .asciz "\n\r" #endif |