bl2_run_next_image.S 986 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (c) 2021, Arm Limited. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <arch.h>
  7. #include <asm_macros.S>
  8. #include <common/bl_common.h>
  9. .globl bl2_run_next_image
  10. func bl2_run_next_image
  11. mov x20,x0
  12. /* ---------------------------------------------
  13. * MMU needs to be disabled because both BL2 and BL31 execute
  14. * in EL3, and therefore share the same address space.
  15. * BL31 will initialize the address space according to its
  16. * own requirement.
  17. * ---------------------------------------------
  18. */
  19. bl disable_mmu_icache_el3
  20. tlbi alle3
  21. bl bl2_el3_plat_prepare_exit
  22. ldp x0, x1, [x20, #ENTRY_POINT_INFO_PC_OFFSET]
  23. msr elr_el3, x0
  24. msr spsr_el3, x1
  25. ldp x6, x7, [x20, #(ENTRY_POINT_INFO_ARGS_OFFSET + 0x30)]
  26. ldp x4, x5, [x20, #(ENTRY_POINT_INFO_ARGS_OFFSET + 0x20)]
  27. ldp x2, x3, [x20, #(ENTRY_POINT_INFO_ARGS_OFFSET + 0x10)]
  28. ldp x0, x1, [x20, #(ENTRY_POINT_INFO_ARGS_OFFSET + 0x0)]
  29. exception_return
  30. endfunc bl2_run_next_image