pmsu_ll.S 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright (C) 2014 Marvell
  3. *
  4. * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  5. * Gregory Clement <gregory.clement@free-electrons.com>
  6. *
  7. * This file is licensed under the terms of the GNU General Public
  8. * License version 2. This program is licensed "as is" without any
  9. * warranty of any kind, whether express or implied.
  10. */
  11. #include <linux/linkage.h>
  12. #include <asm/assembler.h>
  13. ENTRY(armada_38x_scu_power_up)
  14. mrc p15, 4, r1, c15, c0 @ get SCU base address
  15. orr r1, r1, #0x8 @ SCU CPU Power Status Register
  16. mrc 15, 0, r0, cr0, cr0, 5 @ get the CPU ID
  17. and r0, r0, #15
  18. add r1, r1, r0
  19. mov r0, #0x0
  20. strb r0, [r1] @ switch SCU power state to Normal mode
  21. ret lr
  22. ENDPROC(armada_38x_scu_power_up)
  23. /*
  24. * This is the entry point through which CPUs exiting cpuidle deep
  25. * idle state are going.
  26. */
  27. ENTRY(armada_370_xp_cpu_resume)
  28. ARM_BE8(setend be ) @ go BE8 if entered LE
  29. /*
  30. * Disable the MMU that might have been enabled in BootROM if
  31. * this code is used in the resume path of a suspend/resume
  32. * cycle.
  33. */
  34. mrc p15, 0, r1, c1, c0, 0
  35. bic r1, #1
  36. mcr p15, 0, r1, c1, c0, 0
  37. bl ll_add_cpu_to_smp_group
  38. bl ll_enable_coherency
  39. b cpu_resume
  40. ENDPROC(armada_370_xp_cpu_resume)
  41. ENTRY(armada_38x_cpu_resume)
  42. /* do we need it for Armada 38x*/
  43. ARM_BE8(setend be ) @ go BE8 if entered LE
  44. bl v7_invalidate_l1
  45. bl armada_38x_scu_power_up
  46. b cpu_resume
  47. ENDPROC(armada_38x_cpu_resume)
  48. .global mvebu_boot_wa_start
  49. .global mvebu_boot_wa_end
  50. /* The following code will be executed from SRAM */
  51. ENTRY(mvebu_boot_wa_start)
  52. mvebu_boot_wa_start:
  53. ARM_BE8(setend be)
  54. adr r0, 1f
  55. ldr r0, [r0] @ load the address of the
  56. @ resume register
  57. ldr r0, [r0] @ load the value in the
  58. @ resume register
  59. ARM_BE8(rev r0, r0) @ the value is stored LE
  60. mov pc, r0 @ jump to this value
  61. /*
  62. * the last word of this piece of code will be filled by the physical
  63. * address of the boot address register just after being copied in SRAM
  64. */
  65. 1:
  66. .long .
  67. mvebu_boot_wa_end:
  68. ENDPROC(mvebu_boot_wa_end)