start.S 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * armboot - Startup Code for ARM720 CPU-core
  4. *
  5. * Copyright (c) 2001 Marius Gröger <mag@sysgo.de>
  6. * Copyright (c) 2002 Alex Züpke <azu@sysgo.de>
  7. */
  8. #include <asm-offsets.h>
  9. #include <config.h>
  10. /*
  11. *************************************************************************
  12. *
  13. * Startup Code (reset vector)
  14. *
  15. * do important init only if we don't start from RAM!
  16. * relocate armboot to ram
  17. * setup stack
  18. * jump to second stage
  19. *
  20. *************************************************************************
  21. */
  22. .globl reset
  23. reset:
  24. /*
  25. * set the cpu to SVC32 mode
  26. */
  27. mrs r0,cpsr
  28. bic r0,r0,#0x1f
  29. orr r0,r0,#0xd3
  30. msr cpsr,r0
  31. /*
  32. * we do sys-critical inits only at reboot,
  33. * not when booting from ram!
  34. */
  35. #if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && \
  36. !defined(CONFIG_SKIP_LOWLEVEL_INIT_ONLY)
  37. bl cpu_init_crit
  38. #endif
  39. bl _main
  40. /*------------------------------------------------------------------------------*/
  41. .globl c_runtime_cpu_setup
  42. c_runtime_cpu_setup:
  43. mov pc, lr
  44. /*
  45. *************************************************************************
  46. *
  47. * CPU_init_critical registers
  48. *
  49. * setup important registers
  50. * setup memory timing
  51. *
  52. *************************************************************************
  53. */
  54. #if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && \
  55. !defined(CONFIG_SKIP_LOWLEVEL_INIT_ONLY)
  56. cpu_init_crit:
  57. mov ip, lr
  58. /*
  59. * before relocating, we have to setup RAM timing
  60. * because memory timing is board-dependent, you will
  61. * find a lowlevel_init.S in your board directory.
  62. */
  63. bl lowlevel_init
  64. mov lr, ip
  65. mov pc, lr
  66. #endif /* CONFIG_SKIP_LOWLEVEL_INIT */