cpus_on_fixed_addr.S 945 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (c) 2019, 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 <platform_def.h>
  9. #include <cpus_on_fixed_addr.h>
  10. .globl sys_sleep_flag_sram
  11. .globl pmu_cpuson_entrypoint
  12. .macro pmusram_entry_func _name
  13. .section .pmusram.entry, "ax"
  14. .type \_name, %function
  15. .cfi_startproc
  16. \_name:
  17. .endm
  18. pmusram_entry_func pmu_cpuson_entrypoint
  19. adr x5, sys_sleep_flag_sram
  20. ldr w2, [x5, #PSRAM_DT_PM_FLAG]
  21. tbz w2, #PM_WARM_BOOT_SHT, sys_resume_sp
  22. ldr x1, =platform_cpu_warmboot
  23. br x1
  24. sys_resume_sp:
  25. adr x5, sys_sleep_flag_sram
  26. ldr x1, [x5, #PSRAM_DT_SP]
  27. mov sp, x1
  28. ddr_resume:
  29. ldr x1, [x5, #PSRAM_DT_DDR_FUNC]
  30. cmp x1, #0
  31. b.eq sys_resume
  32. blr x1
  33. sys_resume:
  34. ldr x1, =bl31_warm_entrypoint
  35. br x1
  36. endfunc pmu_cpuson_entrypoint
  37. .section .pmusram.data, "a"
  38. .align 3
  39. sys_sleep_flag_sram:
  40. .rept PSRAM_DT_SIZE_WORDS
  41. .word 0
  42. .endr