psci_smp.S 923 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2016 Socionext Inc.
  4. * Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  5. */
  6. #include <linux/linkage.h>
  7. #include <asm/system.h>
  8. .section ._secure.text, "ax"
  9. ENTRY(uniphier_smp_trampoline)
  10. ldr r0, 0f
  11. mrc p15, 0, r1, c1, c0, 0 @ SCTLR (System Control Register)
  12. orr r1, r1, #CR_I @ Enable ICache
  13. bic r1, r1, #(CR_C | CR_M) @ Disable MMU and Dcache
  14. mcr p15, 0, r1, c1, c0, 0
  15. bx r0
  16. 0: .word uniphier_secondary_startup
  17. .globl uniphier_smp_trampoline_end
  18. uniphier_smp_trampoline_end:
  19. ENDPROC(uniphier_smp_trampoline)
  20. LENTRY(uniphier_secondary_startup)
  21. mrc p15, 0, r1, c0, c0, 5 @ MPIDR (Multiprocessor Affinity Reg)
  22. and r1, r1, #0xff
  23. ldr r2, =uniphier_smp_booted
  24. mov r0, #1
  25. str r0, [r2, r1, lsl #2]
  26. ldr r2, =uniphier_psci_holding_pen_release
  27. pen: ldr r0, [r2]
  28. cmp r0, r1
  29. beq psci_cpu_entry
  30. wfe
  31. b pen
  32. ENDPROC(uniphier_secondary_startup)