diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/cpu/armv8/Makefile | 4 | ||||
-rw-r--r-- | arch/arm/include/asm/system.h | 13 | ||||
-rw-r--r-- | arch/arm/lib/cache.c | 4 | ||||
-rw-r--r-- | arch/m68k/lib/traps.c | 9 | ||||
-rw-r--r-- | arch/mips/lib/traps.c | 9 | ||||
-rw-r--r-- | arch/powerpc/cpu/mpc85xx/cpu_init.c | 4 | ||||
-rw-r--r-- | arch/powerpc/lib/Makefile | 1 | ||||
-rw-r--r-- | arch/powerpc/lib/traps.c | 19 | ||||
-rw-r--r-- | arch/sandbox/cpu/start.c | 5 |
9 files changed, 62 insertions, 6 deletions
diff --git a/arch/arm/cpu/armv8/Makefile b/arch/arm/cpu/armv8/Makefile index f7b4a5ee46..d85ddde430 100644 --- a/arch/arm/cpu/armv8/Makefile +++ b/arch/arm/cpu/armv8/Makefile @@ -9,14 +9,16 @@ obj-y += cpu.o ifndef CONFIG_$(SPL_TPL_)TIMER obj-$(CONFIG_SYS_ARCH_TIMER) += generic_timer.o endif +ifndef CONFIG_$(SPL_)SYS_DCACHE_OFF obj-y += cache_v8.o +obj-y += cache.o +endif ifdef CONFIG_SPL_BUILD obj-$(CONFIG_ARMV8_SPL_EXCEPTION_VECTORS) += exceptions.o else obj-y += exceptions.o obj-y += exception_level.o endif -obj-y += cache.o obj-y += tlb.o obj-y += transition.o ifndef CONFIG_ARMV8_PSCI diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h index ce552944b7..5fe83699f4 100644 --- a/arch/arm/include/asm/system.h +++ b/arch/arm/include/asm/system.h @@ -628,7 +628,18 @@ void mmu_set_region_dcache_behaviour(phys_addr_t start, size_t size, enum dcache_option option); #ifdef CONFIG_SYS_NONCACHED_MEMORY -void noncached_init(void); +/** + * noncached_init() - Initialize non-cached memory region + * + * Initialize non-cached memory area. This memory region will be typically + * located right below the malloc() area and mapped uncached in the MMU. + * + * It is called during the generic post-relocation init sequence. + * + * Return: 0 if OK + */ +int noncached_init(void); + phys_addr_t noncached_alloc(size_t size, size_t align); #endif /* CONFIG_SYS_NONCACHED_MEMORY */ diff --git a/arch/arm/lib/cache.c b/arch/arm/lib/cache.c index ee7d14b2d3..bdde9cdad5 100644 --- a/arch/arm/lib/cache.c +++ b/arch/arm/lib/cache.c @@ -86,7 +86,7 @@ void noncached_set_region(void) #endif } -void noncached_init(void) +int noncached_init(void) { phys_addr_t start, end; size_t size; @@ -103,6 +103,8 @@ void noncached_init(void) noncached_next = start; noncached_set_region(); + + return 0; } phys_addr_t noncached_alloc(size_t size, size_t align) diff --git a/arch/m68k/lib/traps.c b/arch/m68k/lib/traps.c index c49141f376..0c2c1a9965 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 df8b63f383..540ea48e32 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/cpu/mpc85xx/cpu_init.c b/arch/powerpc/cpu/mpc85xx/cpu_init.c index e0f0f7ecda..e920e01b25 100644 --- a/arch/powerpc/cpu/mpc85xx/cpu_init.c +++ b/arch/powerpc/cpu/mpc85xx/cpu_init.c @@ -1028,7 +1028,7 @@ void arch_preboot_os(void) mtmsr(msr); } -void cpu_secondary_init_r(void) +int cpu_secondary_init_r(void) { #ifdef CONFIG_QE #ifdef CONFIG_U_QE @@ -1040,6 +1040,8 @@ void cpu_secondary_init_r(void) qe_init(qe_base); qe_reset(); #endif + + return 0; } #ifdef CONFIG_BOARD_LATE_INIT diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile index f61809ab05..2782740bf5 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 0000000000..288e377632 --- /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; +} diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c index 8322ed7a1f..2d18d9debc 100644 --- a/arch/sandbox/cpu/start.c +++ b/arch/sandbox/cpu/start.c @@ -9,6 +9,7 @@ #include <efi_loader.h> #include <errno.h> #include <init.h> +#include <log.h> #include <os.h> #include <cli.h> #include <sort.h> @@ -486,6 +487,10 @@ int main(int argc, char *argv[]) */ gd->reloc_off = (ulong)gd->arch.text_base; + /* sandbox test: log functions called before log_init in board_init_f */ + log_info("sandbox: starting...\n"); + log_debug("debug: %s\n", __func__); + /* Do pre- and post-relocation init */ board_init_f(0); |