lowlevel_init.S 751 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * A lowlevel_init function that sets up the stack to call a C function to
  3. * perform further init.
  4. *
  5. * (C) Copyright 2010
  6. * Texas Instruments, <www.ti.com>
  7. *
  8. * Author :
  9. * Aneesh V <aneesh@ti.com>
  10. *
  11. * SPDX-License-Identifier: GPL-2.0+
  12. */
  13. #include <asm-offsets.h>
  14. #include <config.h>
  15. #include <linux/linkage.h>
  16. ENTRY(lowlevel_init)
  17. /*
  18. * Setup a temporary stack
  19. */
  20. ldr sp, =CONFIG_SYS_INIT_SP_ADDR
  21. bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
  22. #ifdef CONFIG_SPL_BUILD
  23. ldr r9, =gdata
  24. #else
  25. sub sp, sp, #GD_SIZE
  26. bic sp, sp, #7
  27. mov r9, sp
  28. #endif
  29. /*
  30. * Save the old lr(passed in ip) and the current lr to stack
  31. */
  32. push {ip, lr}
  33. /*
  34. * go setup pll, mux, memory
  35. */
  36. bl s_init
  37. pop {ip, pc}
  38. ENDPROC(lowlevel_init)