pmu_sram_cpus_on.S 915 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (c) 2016, 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. .globl pmu_cpuson_entrypoint
  10. .macro pmusram_entry_func _name
  11. .section .pmusram.entry, "ax"
  12. .type \_name, %function
  13. .cfi_startproc
  14. \_name:
  15. .endm
  16. pmusram_entry_func pmu_cpuson_entrypoint
  17. #if PSRAM_CHECK_WAKEUP_CPU
  18. check_wake_cpus:
  19. mrs x0, MPIDR_EL1
  20. and x1, x0, #MPIDR_CPU_MASK
  21. and x0, x0, #MPIDR_CLUSTER_MASK
  22. orr x0, x0, x1
  23. /* primary_cpu */
  24. ldr w1, boot_mpidr
  25. cmp w0, w1
  26. b.eq sys_wakeup
  27. /*
  28. * If the core is not the primary cpu,
  29. * force the core into wfe.
  30. */
  31. wfe_loop:
  32. wfe
  33. b wfe_loop
  34. sys_wakeup:
  35. #endif
  36. #if PSRAM_DO_DDR_RESUME
  37. ddr_resume:
  38. ldr x2, =__bl31_sram_stack_end
  39. mov sp, x2
  40. bl dmc_resume
  41. #endif
  42. bl sram_restore
  43. sys_resume:
  44. bl bl31_warm_entrypoint
  45. endfunc pmu_cpuson_entrypoint