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>
This commit is contained in:
Ovidiu Panait
2020-11-28 10:43:18 +02:00
committed by Tom Rini
parent c65abc70fb
commit 130845bac1
6 changed files with 47 additions and 17 deletions

View File

@@ -182,20 +182,10 @@ static int initr_reloc_global_data(void)
return 0;
}
#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_MIPS)
static int initr_trap(void)
__weak int arch_initr_trap(void)
{
/*
* Setup trap handlers
*/
#if defined(CONFIG_PPC)
trap_init(gd->relocaddr);
#else
trap_init(CONFIG_SYS_SDRAM_BASE);
#endif
return 0;
}
#endif
#ifdef CONFIG_ADDR_MAP
static int initr_addr_map(void)
@@ -669,9 +659,7 @@ static init_fnc_t init_sequence_r[] = {
#ifdef CONFIG_NEEDS_MANUAL_RELOC
initr_manual_reloc_cmdtable,
#endif
#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_MIPS)
initr_trap,
#endif
arch_initr_trap,
#ifdef CONFIG_ADDR_MAP
initr_addr_map,
#endif