From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ovidiu Panait Date: Thu, 5 Nov 2020 11:09:43 +0200 Subject: [PATCH 06/18] common: board_r: Drop initr_secondary_cpu wrapper In-Reply-To: <20201105090955.29641-1-ovidiu.panait@windriver.com> References: <20201105090955.29641-1-ovidiu.panait@windriver.com> Message-ID: <20201105090955.29641-7-ovidiu.panait@windriver.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- arch/powerpc/cpu/mpc85xx/cpu_init.c | 4 +++- common/board_r.c | 17 ++--------------- 2 files changed, 5 insertions(+), 16 deletions(-) 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/common/board_r.c b/common/board_r.c index 07c0ad363e..a291543d74 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -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 -- 2.17.1