rockchip: rk3288: use ARM arch timer instead of rk_timer
[oweals/u-boot.git] / arch / arm / lib / vectors.S
index 101909103e4a5d4ae69f41ff4c8e623779b13e91..56f36815582b9e3492828e511e41fb951f33af72 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  *  vectors - Generic ARM exception table code
  *
  *  Copyright (c) 2002 Alex Züpke <azu@sysgo.de>
  *  Copyright (c) 2002 Gary Jennejohn <garyj@denx.de>
  *  Copyright (c) 2002 Kyle Harris <kharris@nexus-tech.net>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <config.h>
 
+/*
+ * A macro to allow insertion of an ARM exception vector either
+ * for the non-boot0 case or by a boot0-header.
+ */
+        .macro ARM_VECTORS
+#ifdef CONFIG_ARCH_K3
+       ldr     pc, _reset
+#else
+       b       reset
+#endif
+       ldr     pc, _undefined_instruction
+       ldr     pc, _software_interrupt
+       ldr     pc, _prefetch_abort
+       ldr     pc, _data_abort
+       ldr     pc, _not_used
+       ldr     pc, _irq
+       ldr     pc, _fiq
+       .endm
+
+
 /*
  *************************************************************************
  *
 
        .section ".vectors", "ax"
 
+#if defined(CONFIG_ENABLE_ARM_SOC_BOOT0_HOOK)
+/*
+ * Various SoCs need something special and SoC-specific up front in
+ * order to boot, allow them to set that in their boot0.h file and then
+ * use it here.
+ *
+ * To allow a boot0 hook to insert a 'special' sequence after the vector
+ * table (e.g. for the socfpga), the presence of a boot0 hook supresses
+ * the below vector table and assumes that the vector table is filled in
+ * by the boot0 hook.  The requirements for a boot0 hook thus are:
+ *   (1) defines '_start:' as appropriate
+ *   (2) inserts the vector table using ARM_VECTORS as appropriate
+ */
+#include <asm/arch/boot0.h>
+#else
+
 /*
  *************************************************************************
  *
  */
 
 _start:
-
 #ifdef CONFIG_SYS_DV_NOR_BOOT_CFG
        .word   CONFIG_SYS_DV_NOR_BOOT_CFG
 #endif
-
-       b       reset
-       ldr     pc, _undefined_instruction
-       ldr     pc, _software_interrupt
-       ldr     pc, _prefetch_abort
-       ldr     pc, _data_abort
-       ldr     pc, _not_used
-       ldr     pc, _irq
-       ldr     pc, _fiq
-
-#ifdef CONFIG_ENABLE_ARM_SOC_BOOT0_HOOK
-/*
- * Various SoCs need something special and SoC-specific up front in
- * order to boot, allow them to set that in their boot0.h file and then
- * use it here.
- */
-#include <asm/arch/boot0.h>
-#endif
+       ARM_VECTORS
+#endif /* !defined(CONFIG_ENABLE_ARM_SOC_BOOT0_HOOK) */
 
 /*
  *************************************************************************
@@ -79,6 +97,7 @@ _start:
  *************************************************************************
  */
 
+       .globl  _reset
        .globl  _undefined_instruction
        .globl  _software_interrupt
        .globl  _prefetch_abort
@@ -87,6 +106,9 @@ _start:
        .globl  _irq
        .globl  _fiq
 
+#ifdef CONFIG_ARCH_K3
+_reset:                        .word reset
+#endif
 _undefined_instruction:        .word undefined_instruction
 _software_interrupt:   .word software_interrupt
 _prefetch_abort:       .word prefetch_abort
@@ -118,7 +140,7 @@ not_used:
 irq:
 fiq:
 1:
-       bl      1b                      /* hang and never return */
+       b       1b                      /* hang and never return */
 
 #else  /* !CONFIG_SPL_BUILD */