headsmp.S 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * arch/arm/mach-spear13XX/headsmp.S
  3. *
  4. * Picked from realview
  5. * Copyright (c) 2012 ST Microelectronics Limited
  6. * Shiraz Hashim <shiraz.linux.kernel@gmail.com>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #include <linux/linkage.h>
  13. #include <linux/init.h>
  14. __INIT
  15. /*
  16. * spear13xx specific entry point for secondary CPUs. This provides
  17. * a "holding pen" into which all secondary cores are held until we're
  18. * ready for them to initialise.
  19. */
  20. ENTRY(spear13xx_secondary_startup)
  21. mrc p15, 0, r0, c0, c0, 5
  22. and r0, r0, #15
  23. adr r4, 1f
  24. ldmia r4, {r5, r6}
  25. sub r4, r4, r5
  26. add r6, r6, r4
  27. pen: ldr r7, [r6]
  28. cmp r7, r0
  29. bne pen
  30. /* re-enable coherency */
  31. mrc p15, 0, r0, c1, c0, 1
  32. orr r0, r0, #(1 << 6) | (1 << 0)
  33. mcr p15, 0, r0, c1, c0, 1
  34. /*
  35. * we've been released from the holding pen: secondary_stack
  36. * should now contain the SVC stack for this core
  37. */
  38. b secondary_startup
  39. .align
  40. 1: .long .
  41. .long pen_release
  42. ENDPROC(spear13xx_secondary_startup)