headsmp.S 1.4 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 is located into the .data section. This is to
  26. * allow phys_l2x0_saved_regs to be accessed with a relative load
  27. * as we are running on physical address here.
  28. */
  29. .data
  30. .align
  31. #ifdef CONFIG_CACHE_L2X0
  32. .macro pl310_resume
  33. ldr r2, phys_l2x0_saved_regs
  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. .globl phys_l2x0_saved_regs
  41. phys_l2x0_saved_regs:
  42. .long 0
  43. #else
  44. .macro pl310_resume
  45. .endm
  46. #endif
  47. ENTRY(v7_cpu_resume)
  48. bl v7_invalidate_l1
  49. pl310_resume
  50. b cpu_resume
  51. ENDPROC(v7_cpu_resume)
  52. #endif