start.S 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #include <asm-offsets.h>
  7. #include <config.h>
  8. #include <linux/linkage.h>
  9. #include <asm/arcregs.h>
  10. ENTRY(_start)
  11. /* Setup interrupt vector base that matches "__text_start" */
  12. sr __ivt_start, [ARC_AUX_INTR_VEC_BASE]
  13. /* Setup stack- and frame-pointers */
  14. mov %sp, CONFIG_SYS_INIT_SP_ADDR
  15. mov %fp, %sp
  16. /* Unconditionally disable caches */
  17. #ifdef CONFIG_ISA_ARCV2
  18. bl slc_flush
  19. bl slc_disable
  20. #endif
  21. bl flush_dcache_all
  22. bl dcache_disable
  23. bl icache_disable
  24. /* Allocate and zero GD, update SP */
  25. mov %r0, %sp
  26. bl board_init_f_mem
  27. /* Update stack- and frame-pointers */
  28. mov %sp, %r0
  29. mov %fp, %sp
  30. /* Zero the one and only argument of "board_init_f" */
  31. mov_s %r0, 0
  32. j board_init_f
  33. ENDPROC(_start)
  34. /*
  35. * void board_init_f_r_trampoline(stack-pointer address)
  36. *
  37. * This "function" does not return, instead it continues in RAM
  38. * after relocating the monitor code.
  39. *
  40. * r0 = new stack-pointer
  41. */
  42. ENTRY(board_init_f_r_trampoline)
  43. /* Set up the stack- and frame-pointers */
  44. mov %sp, %r0
  45. mov %fp, %sp
  46. /* Update position of intterupt vector table */
  47. lr %r0, [ARC_AUX_INTR_VEC_BASE]
  48. ld %r1, [%r25, GD_RELOC_OFF]
  49. add %r0, %r0, %r1
  50. sr %r0, [ARC_AUX_INTR_VEC_BASE]
  51. /* Re-enter U-Boot by calling board_init_f_r */
  52. j board_init_f_r
  53. ENDPROC(board_init_f_r_trampoline)