lowlevel_spl.S 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * SPDX-License-Identifier: GPL-2.0+
  3. */
  4. #include <config.h>
  5. #include <linux/linkage.h>
  6. ENTRY(save_boot_params)
  7. stmfd sp!, {r0 - r12, lr} /* @ save registers on stack */
  8. ldr r12, =CONFIG_SPL_BOOTROM_SAVE
  9. str sp, [r12]
  10. b save_boot_params_ret
  11. ENDPROC(save_boot_params)
  12. ENTRY(return_to_bootrom)
  13. ldr r12, =CONFIG_SPL_BOOTROM_SAVE
  14. ldr sp, [r12]
  15. mov r0, #0x0 /* @ return value: 0x0 NO_ERR */
  16. ldmfd sp!, {r0 - r12, pc} /* @ restore regs and return */
  17. ENDPROC(return_to_bootrom)
  18. /*
  19. * cache_inv - invalidate Cache line
  20. * r0 - dest
  21. */
  22. .global cache_inv
  23. .type cache_inv, %function
  24. cache_inv:
  25. stmfd sp!, {r1-r12}
  26. mcr p15, 0, r0, c7, c6, 1
  27. ldmfd sp!, {r1-r12}
  28. bx lr
  29. /*
  30. * flush_l1_v6 - l1 cache clean invalidate
  31. * r0 - dest
  32. */
  33. .global flush_l1_v6
  34. .type flush_l1_v6, %function
  35. flush_l1_v6:
  36. stmfd sp!, {r1-r12}
  37. mcr p15, 0, r0, c7, c10, 5 /* @ data memory barrier */
  38. mcr p15, 0, r0, c7, c14, 1 /* @ clean & invalidate D line */
  39. mcr p15, 0, r0, c7, c10, 4 /* @ data sync barrier */
  40. ldmfd sp!, {r1-r12}
  41. bx lr
  42. /*
  43. * flush_l1_v7 - l1 cache clean invalidate
  44. * r0 - dest
  45. */
  46. .global flush_l1_v7
  47. .type flush_l1_v7, %function
  48. flush_l1_v7:
  49. stmfd sp!, {r1-r12}
  50. dmb /* @data memory barrier */
  51. mcr p15, 0, r0, c7, c14, 1 /* @ clean & invalidate D line */
  52. dsb /* @data sync barrier */
  53. ldmfd sp!, {r1-r12}
  54. bx lr