start.S 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. /*
  12. *************************************************************************
  13. *
  14. * Startup Code (reset vector)
  15. *
  16. * do important init only if we don't start from RAM!
  17. * relocate armboot to ram
  18. * setup stack
  19. * jump to second stage
  20. *
  21. *************************************************************************
  22. */
  23. .globl reset
  24. reset:
  25. /*
  26. * set the cpu to SVC32 mode
  27. */
  28. mrs r0,cpsr
  29. bic r0,r0,#0x1f
  30. orr r0,r0,#0xd3
  31. msr cpsr,r0
  32. /*
  33. * we do sys-critical inits only at reboot,
  34. * not when booting from ram!
  35. */
  36. #ifndef CONFIG_SKIP_LOWLEVEL_INIT
  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. #ifndef CONFIG_SKIP_LOWLEVEL_INIT
  55. cpu_init_crit:
  56. mov ip, lr
  57. /*
  58. * before relocating, we have to setup RAM timing
  59. * because memory timing is board-dependent, you will
  60. * find a lowlevel_init.S in your board directory.
  61. */
  62. bl lowlevel_init
  63. mov lr, ip
  64. mov pc, lr
  65. #endif /* CONFIG_SKIP_LOWLEVEL_INIT */