lowlevel_init.S 813 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
  2. /*
  3. * Copyright (c) 2018 Microsemi Corporation
  4. */
  5. #include <asm/asm.h>
  6. #include <asm/regdef.h>
  7. .set noreorder
  8. .extern vcoreiii_tlb_init
  9. .extern vcoreiii_ddr_init
  10. #ifdef CONFIG_SOC_LUTON
  11. .extern pll_init
  12. #endif
  13. LEAF(lowlevel_init)
  14. /*
  15. * As we have no stack yet, we can assume the restricted
  16. * luxury of the sX-registers without saving them
  17. */
  18. /* Modify ra/s0 such we return to physical NOR location */
  19. li t0, 0x0fffffff
  20. li t1, CONFIG_TEXT_BASE
  21. and s0, ra, t0
  22. add s0, s0, t1
  23. jal vcoreiii_tlb_init
  24. nop
  25. #ifdef CONFIG_SOC_LUTON
  26. jal pll_init
  27. nop
  28. #endif
  29. /* Initialize DDR controller to enable stack/gd/heap */
  30. 0:
  31. jal vcoreiii_ddr_init
  32. nop
  33. bnez v0, 0b /* Retry on error */
  34. nop
  35. jr s0
  36. nop
  37. END(lowlevel_init)