]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
board_f: Add a mach_cpu_init callback
authorPaul Burton <paul.burton@imgtec.com>
Wed, 21 Sep 2016 10:18:46 +0000 (11:18 +0100)
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
Wed, 21 Sep 2016 13:04:04 +0000 (15:04 +0200)
Currently we have a mismash of architectures which use arch_cpu_init
from architecture-wide code (arc, avr32, blackfin, mips, nios2, xtensa)
and architectures which use arch_cpu_init from machine/SoC level code
(arm, x86).

In order to clean this mess up & allow for both use cases, introduce a
new mach_cpu_init callback which is run immediately after arch_cpu_init.
This will allow for architectures to have arch-wide code without needing
individual machines to all implement their own arch_cpu_init with a call
to some common function.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
common/board_f.c

index da381dbd93b4d7de42a547874c8e652decfe5a7d..9ef998f9ed239337f542f9f875e826e4050a270e 100644 (file)
@@ -290,6 +290,11 @@ __weak int arch_cpu_init(void)
        return 0;
 }
 
+__weak int mach_cpu_init(void)
+{
+       return 0;
+}
+
 #ifdef CONFIG_SANDBOX
 static int setup_ram_buf(void)
 {
@@ -860,6 +865,7 @@ static init_fnc_t init_sequence_f[] = {
        x86_fsp_init,
 #endif
        arch_cpu_init,          /* basic arch cpu dependent setup */
+       mach_cpu_init,          /* SoC/machine dependent CPU setup */
        initf_dm,
        arch_cpu_init_dm,
        mark_bootstage,         /* need timer, go after init dm */