bl2_el3_entrypoint.S 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Copyright (c) 2017-2021, Arm Limited and Contributors. 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. #if BL2_IN_XIP_MEM
  13. #define FIXUP_SIZE 0
  14. #else
  15. #define FIXUP_SIZE ((BL2_LIMIT) - (BL2_BASE))
  16. #endif
  17. func bl2_entrypoint
  18. /* Save arguments x0-x3 from previous Boot loader */
  19. mov x20, x0
  20. mov x21, x1
  21. mov x22, x2
  22. mov x23, x3
  23. el3_entrypoint_common \
  24. _init_sctlr=1 \
  25. _warm_boot_mailbox=!PROGRAMMABLE_RESET_ADDRESS \
  26. _secondary_cold_boot=!COLD_BOOT_SINGLE_CPU \
  27. _init_memory=1 \
  28. _init_c_runtime=1 \
  29. _exception_vectors=bl2_el3_exceptions \
  30. _pie_fixup_size=FIXUP_SIZE
  31. /* ---------------------------------------------
  32. * Restore parameters of boot rom
  33. * ---------------------------------------------
  34. */
  35. mov x0, x20
  36. mov x1, x21
  37. mov x2, x22
  38. mov x3, x23
  39. /* ---------------------------------------------
  40. * Perform BL2 setup
  41. * ---------------------------------------------
  42. */
  43. bl bl2_el3_setup
  44. #if ENABLE_PAUTH
  45. /* ---------------------------------------------
  46. * Program APIAKey_EL1 and enable pointer authentication.
  47. * ---------------------------------------------
  48. */
  49. bl pauth_init_enable_el3
  50. #endif /* ENABLE_PAUTH */
  51. /* ---------------------------------------------
  52. * Jump to main function.
  53. * ---------------------------------------------
  54. */
  55. bl bl2_main
  56. /* ---------------------------------------------
  57. * Should never reach this point.
  58. * ---------------------------------------------
  59. */
  60. no_ret plat_panic_handler
  61. endfunc bl2_entrypoint