pmsu_ll.S 1.8 KB

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