headsmp.S 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright 2011 Freescale Semiconductor, Inc.
  3. * Copyright 2011 Linaro Ltd.
  4. *
  5. * The code contained herein is licensed under the GNU General Public
  6. * License. You may obtain a copy of the GNU General Public License
  7. * Version 2 or later at the following locations:
  8. *
  9. * http://www.opensource.org/licenses/gpl-license.html
  10. * http://www.gnu.org/copyleft/gpl.html
  11. */
  12. #include <linux/linkage.h>
  13. #include <linux/init.h>
  14. #include <asm/asm-offsets.h>
  15. #include <asm/hardware/cache-l2x0.h>
  16. .section ".text.head", "ax"
  17. #ifdef CONFIG_SMP
  18. ENTRY(v7_secondary_startup)
  19. bl v7_invalidate_l1
  20. b secondary_startup
  21. ENDPROC(v7_secondary_startup)
  22. #endif
  23. #ifdef CONFIG_PM
  24. /*
  25. * The following code must assume it is running from physical address
  26. * where absolute virtual addresses to the data section have to be
  27. * turned into relative ones.
  28. */
  29. #ifdef CONFIG_CACHE_L2X0
  30. .macro pl310_resume
  31. adr r0, l2x0_saved_regs_offset
  32. ldr r2, [r0]
  33. add r2, r2, r0
  34. ldr r0, [r2, #L2X0_R_PHY_BASE] @ get physical base of l2x0
  35. ldr r1, [r2, #L2X0_R_AUX_CTRL] @ get aux_ctrl value
  36. str r1, [r0, #L2X0_AUX_CTRL] @ restore aux_ctrl
  37. mov r1, #0x1
  38. str r1, [r0, #L2X0_CTRL] @ re-enable L2
  39. .endm
  40. l2x0_saved_regs_offset:
  41. .word l2x0_saved_regs - .
  42. #else
  43. .macro pl310_resume
  44. .endm
  45. #endif
  46. ENTRY(v7_cpu_resume)
  47. bl v7_invalidate_l1
  48. pl310_resume
  49. b cpu_resume
  50. ENDPROC(v7_cpu_resume)
  51. #endif