aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorOvidiu Panait2020-11-28 10:43:18 +0200
committerTom Rini2021-01-15 14:36:12 -0500
commit130845bac11ecd542587b2d2ce2b2fe87f112f1d (patch)
treeb8b58b35b13065cd391428b5608316b03d05b303 /arch
parentc65abc70fb7212301b70c6ab05ba2aa22c31c69e (diff)
common: board_r: Drop arch-specific ifdefs around initr_trap
In order to remove the arch-specific ifdefs around initr_trap, introduce arch_initr_trap weak initcall. Implementations for ppc/m68k/mips have been moved to arch/<arch>/lib/traps.c Default implementation is a nop stub. Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/m68k/lib/traps.c9
-rw-r--r--arch/mips/lib/traps.c9
-rw-r--r--arch/powerpc/lib/Makefile1
-rw-r--r--arch/powerpc/lib/traps.c19
4 files changed, 36 insertions, 2 deletions
diff --git a/arch/m68k/lib/traps.c b/arch/m68k/lib/traps.c
index c49141f376d..0c2c1a99655 100644
--- a/arch/m68k/lib/traps.c
+++ b/arch/m68k/lib/traps.c
@@ -40,7 +40,7 @@ void exc_handler(struct pt_regs *fp) {
for(;;);
}
-void trap_init(ulong value) {
+static void trap_init(ulong value) {
unsigned long *vec = (ulong *)value;
int i;
@@ -59,3 +59,10 @@ void trap_init(ulong value) {
setvbr(value); /* set vector base register to new table */
}
+
+int arch_initr_trap(void)
+{
+ trap_init(CONFIG_SYS_SDRAM_BASE);
+
+ return 0;
+}
diff --git a/arch/mips/lib/traps.c b/arch/mips/lib/traps.c
index df8b63f383b..540ea48e32f 100644
--- a/arch/mips/lib/traps.c
+++ b/arch/mips/lib/traps.c
@@ -99,7 +99,7 @@ static void set_handler(unsigned long offset, void *addr, unsigned long size)
flush_cache(ebase + offset, size);
}
-void trap_init(ulong reloc_addr)
+static void trap_init(ulong reloc_addr)
{
unsigned long ebase = gd->irq_sp;
@@ -131,3 +131,10 @@ void trap_restore(void)
clear_c0_status(ST0_BEV);
execution_hazard_barrier();
}
+
+int arch_initr_trap(void)
+{
+ trap_init(CONFIG_SYS_SDRAM_BASE);
+
+ return 0;
+}
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index f61809ab057..2782740bf5b 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -40,6 +40,7 @@ obj-y += interrupts.o
obj-$(CONFIG_CMD_KGDB) += kgdb.o
obj-y += stack.o
obj-y += time.o
+obj-y += traps.o
endif # not minimal
ifdef CONFIG_SPL_BUILD
diff --git a/arch/powerpc/lib/traps.c b/arch/powerpc/lib/traps.c
new file mode 100644
index 00000000000..288e3776328
--- /dev/null
+++ b/arch/powerpc/lib/traps.c
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2003
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ */
+
+#include <common.h>
+#include <init.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+void trap_init(unsigned long reloc_addr);
+
+int arch_initr_trap(void)
+{
+ trap_init(gd->relocaddr);
+
+ return 0;
+}