bl2_rme_entrypoint.S 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Copyright (c) 2021, Arm Limited. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <platform_def.h>
  7. #include <arch.h>
  8. #include <asm_macros.S>
  9. #include <common/bl_common.h>
  10. #include <el3_common_macros.S>
  11. .globl bl2_entrypoint
  12. func bl2_entrypoint
  13. /* Save arguments x0-x3 from previous Boot loader */
  14. mov x20, x0
  15. mov x21, x1
  16. mov x22, x2
  17. mov x23, x3
  18. el3_entrypoint_common \
  19. _init_sctlr=0 \
  20. _warm_boot_mailbox=0 \
  21. _secondary_cold_boot=0 \
  22. _init_memory=0 \
  23. _init_c_runtime=1 \
  24. _exception_vectors=bl2_el3_exceptions \
  25. _pie_fixup_size=0
  26. /* ---------------------------------------------
  27. * Restore parameters of boot rom
  28. * ---------------------------------------------
  29. */
  30. mov x0, x20
  31. mov x1, x21
  32. mov x2, x22
  33. mov x3, x23
  34. /* ---------------------------------------------
  35. * Perform BL2 setup
  36. * ---------------------------------------------
  37. */
  38. bl bl2_setup
  39. #if ENABLE_PAUTH
  40. /* ---------------------------------------------
  41. * Program APIAKey_EL1 and enable pointer authentication.
  42. * ---------------------------------------------
  43. */
  44. bl pauth_init_enable_el3
  45. #endif /* ENABLE_PAUTH */
  46. /* ---------------------------------------------
  47. * Jump to main function.
  48. * ---------------------------------------------
  49. */
  50. bl bl2_main
  51. /* ---------------------------------------------
  52. * Should never reach this point.
  53. * ---------------------------------------------
  54. */
  55. no_ret plat_panic_handler
  56. endfunc bl2_entrypoint