]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
common: board_r: Drop initr_secondary_cpu wrapper
authorOvidiu Panait <ovidiu.panait@windriver.com>
Sat, 28 Nov 2020 08:43:09 +0000 (10:43 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 15 Jan 2021 19:36:11 +0000 (14:36 -0500)
Add a return value to cpu_secondary_init_r and use it directly in the
post-relocation init sequence, rather than using a wrapper stub.

Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
arch/powerpc/cpu/mpc85xx/cpu_init.c
common/board_r.c
include/init.h

index e0f0f7ecda60f2e301a6ecd40590a805513b6c60..e920e01b254f7afdf3cfe76fa39cb0309d830135 100644 (file)
@@ -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
index 07c0ad363e926992d2b335e3bdbedbd06f04bb98..a291543d74d78a6c0ec2348846d6cda31dfaad7c 100644 (file)
@@ -91,21 +91,8 @@ __weak int board_flash_wp_on(void)
        return 0;
 }
 
-__weak void cpu_secondary_init_r(void)
+__weak int cpu_secondary_init_r(void)
 {
-}
-
-static int initr_secondary_cpu(void)
-{
-       /*
-        * after non-volatile devices & environment is setup and cpu code have
-        * another round to deal with any initialization that might require
-        * full access to the environment or loading of some image (firmware)
-        * from a non-volatile device
-        */
-       /* TODO: maybe define this for all archs? */
-       cpu_secondary_init_r();
-
        return 0;
 }
 
@@ -801,7 +788,7 @@ static init_fnc_t init_sequence_r[] = {
        initr_malloc_bootparams,
 #endif
        INIT_FUNC_WATCHDOG_RESET
-       initr_secondary_cpu,
+       cpu_secondary_init_r,
 #if defined(CONFIG_ID_EEPROM) || defined(CONFIG_SYS_I2C_MAC_OFFSET)
        mac_read_from_eeprom,
 #endif
index 0f48ccb57ad274417fbffca66ce20392d23de531..7cdc47cff1b3d0dd5424bcd1b8bc4900f3b1e060 100644 (file)
@@ -163,6 +163,20 @@ int arch_setup_bdinfo(void);
  */
 int setup_bdinfo(void);
 
+/**
+ * cpu_secondary_init_r() - CPU-specific secondary initialization
+ *
+ * After non-volatile devices, environment and cpu code are setup, have
+ * another round to deal with any initialization that might require
+ * full access to the environment or loading of some image (firmware)
+ * from a non-volatile device.
+ *
+ * It is called during the generic post-relocation init sequence.
+ *
+ * Return: 0 if OK
+ */
+int cpu_secondary_init_r(void);
+
 /**
  * init_cache_f_r() - Turn on the cache in preparation for relocation
  *