lowlevel_init.S 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright (C) 2012 Altera Corporation <www.altera.com>
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #include <config.h>
  7. #include <version.h>
  8. /* Save the parameter pass in by previous boot loader */
  9. .global save_boot_params
  10. save_boot_params:
  11. /* no parameter to save */
  12. bx lr
  13. /* Set up the platform, once the cpu has been initialized */
  14. .globl lowlevel_init
  15. lowlevel_init:
  16. /* Remap */
  17. #ifdef CONFIG_SPL_BUILD
  18. /*
  19. * SPL : configure the remap (L3 NIC-301 GPV)
  20. * so the on-chip RAM at lower memory instead ROM.
  21. */
  22. ldr r0, =SOCFPGA_L3REGS_ADDRESS
  23. mov r1, #0x19
  24. str r1, [r0]
  25. #else
  26. /*
  27. * U-Boot : configure the remap (L3 NIC-301 GPV)
  28. * so the SDRAM at lower memory instead on-chip RAM.
  29. */
  30. ldr r0, =SOCFPGA_L3REGS_ADDRESS
  31. mov r1, #0x2
  32. str r1, [r0]
  33. /* Private components security */
  34. /*
  35. * U-Boot : configure private timer, global timer and cpu
  36. * component access as non secure for kernel stage (as required
  37. * by kernel)
  38. */
  39. mrc p15,4,r0,c15,c0,0
  40. add r1, r0, #0x54
  41. ldr r2, [r1]
  42. orr r2, r2, #0xff
  43. orr r2, r2, #0xf00
  44. str r2, [r1]
  45. #endif /* #ifdef CONFIG_SPL_BUILD */
  46. mov pc, lr