start.S 1.6 KB

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