fvp_r_debug.S 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright (c) 2021, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <arch.h>
  7. #include <asm_macros.S>
  8. #include <common/debug.h>
  9. .globl el2_panic
  10. /***********************************************************
  11. * The common implementation of el3_panic for all BL stages
  12. ***********************************************************/
  13. .section .rodata.panic_str, "aS"
  14. panic_msg: .asciz "PANIC at PC : 0x"
  15. /*
  16. * el2_panic will be redefined by the
  17. * crash reporting mechanism (if enabled)
  18. */
  19. el2_panic:
  20. mov x6, x30
  21. bl plat_crash_console_init
  22. /* Check if the console is initialized */
  23. cbz x0, _panic_handler
  24. /* The console is initialized */
  25. adr x4, panic_msg
  26. bl asm_print_str
  27. mov x4, x6
  28. /* The panic location is lr -4 */
  29. sub x4, x4, #4
  30. bl asm_print_hex
  31. bl plat_crash_console_flush
  32. _panic_handler:
  33. /* Pass to plat_panic_handler the address from where el2_panic was
  34. * called, not the address of the call from el2_panic.
  35. */
  36. mov x30, x6
  37. b plat_panic_handler