Minor board_f/board_r cleanups
Subsystems (12)
cover Minor board_f/board_r cleanups
* Use IS_ENABLED() instead of #ifdef where possible
* Add int return values to various functions so we can drop multiple initr_* stub wrappers
* Clean some arch-specific ifdefs
* Minor CONFIG_HANDOFF patches
Ovidiu Panait (18):
common: board_f: Drop initf_console_record wrapper
common: board_f: Use IS_ENABLED(CONFIG_TIMER_EARLY) in initf_dm
common: board_f: Move setup_machine code to setup_bdinfo
common: board_f: Use IS_ENABLED(CONFIG_OF_EMBED) in
reserve_fdt,reloc_fdt
common: board_r: Drop initr_console_record wrapper
common: board_r: Drop initr_secondary_cpu wrapper
common: board_r: Drop initr_post_backlog wrapper
common: board_r: Drop initr_pci_ep wrapper
common: board_r: Drop initr_pci wrapper
common: board_r: Drop initr_addr_map wrapper
common: board_r: Drop initr_noncached wrapper
common: board_r: Drop initr_xen wrapper
common: board_r: Drop initr_jumptable wrapper
common: board_r: Drop initr_api wrapper
common: board_r: Drop initr_bbmii wrapper
common: board_r: Drop arch-specific ifdefs around initr_trap
spl: Kconfig: Add SPL dependency to CONFIG_HANDOFF
global_data: Enable spl_handoff only if CONFIG_HANDOFF is set
api/api.c | 6 +- api/api_private.h | 2 +- arch/arm/include/asm/mmu.h | 2 +- arch/arm/include/asm/system.h | 2 +- arch/arm/lib/cache.c | 4 +- arch/arm/mach-bcm283x/init.c | 4 +- arch/m68k/lib/traps.c | 7 ++ arch/mips/lib/traps.c | 7 ++ arch/powerpc/cpu/mpc85xx/cpu_init.c | 4 +- arch/powerpc/cpu/mpc85xx/tlb.c | 4 +- arch/powerpc/cpu/mpc86xx/cpu_init.c | 4 +- arch/powerpc/include/asm/mmu.h | 2 +- arch/powerpc/lib/Makefile | 1 + arch/powerpc/lib/traps.c | 17 ++++ common/board_f.c | 78 +++++++------- common/board_r.c | 145 ++++----------------------- common/exports.c | 4 +- common/spl/Kconfig | 2 +- drivers/net/phy/miiphybb.c | 4 +- drivers/pci/pci-uclass.c | 4 +- drivers/pci/pci.c | 6 +- drivers/pci_endpoint/pci_ep-uclass.c | 4 +- drivers/xen/hypervisor.c | 4 +- include/api.h | 2 +- include/asm-generic/global_data.h | 4 +- include/exports.h | 2 +- include/init.h | 13 ++- include/miiphy.h | 2 +- include/post.h | 2 +- include/xen.h | 2 +- post/post.c | 4 +- 31 files changed, 148 insertions(+), 200 deletions(-) create mode 100644 arch/powerpc/lib/traps.c
Signature · 1 line
2.17.1
PATCH 1/18 common: board_f: Drop initf_console_record wrapper
Drop initf_console_record wrapper and call console_record_init directly.
--- common/board_f.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)
common/board_f.c +3 -10
@@ -765,15 +765,6 @@ static int initf_bootstage(void)return 0 ; } -static int initf_console_record (void ) -{ -#if defined(CONFIG_CONSOLE_RECORD ) &&CONFIG_VAL (SYS_MALLOC_F_LEN ) -return console_record_init (); -#else -return 0 ; -#endif -} -static int initf_dm (void ) {#if defined(CONFIG_DM ) &&CONFIG_VAL (SYS_MALLOC_F_LEN )
@@ -830,7 +821,9 @@ static const init_fnc_t init_sequence_f[] = { bloblist_init, #endif setup_spl_handoff, - initf_console_record, +#if defined(CONFIG_CONSOLE_RECORD ) &&CONFIG_VAL (SYS_MALLOC_F_LEN ) + console_record_init, +#endif #if defined(CONFIG_HAVE_FSP ) arch_fsp_init,#endif
Signature · 1 line
2.17.1
PATCH 1/18 common: board_f: Drop initf_console_record wrapper
Quoted 8 lines · Ovidiu Panait
Drop
initf_console_recordwrapper and callconsole_record_initdirectly.Signed-off-by Ovidiu Panait <[email protected]>--- common/board_f.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)
See below
common/board_f.c static int initf_bootstage(void) · line 770
Quoted 11 lines
common/board_f.c +0
-3@@ -765,15 +765,6 @@ static int initf_bootstage(void)return 0 ; } -static int initf_console_record (void ) -{ -#if defined(CONFIG_CONSOLE_RECORD ) &&CONFIG_VAL (SYS_MALLOC_F_LEN )
I wonder if we need the second term? We could make a SPL_CONSOLE_RECORD which depends on SYS_MALLOC_F perhaps?
Regards,
Simon
Quoted 23 lines
common/board_f.c +3
-8-return console_record_init (); -#else -return 0 ; -#endif -} -static int initf_dm (void ) {#if defined(CONFIG_DM ) &&CONFIG_VAL (SYS_MALLOC_F_LEN )@@ -830,7 +821,9 @@ static const init_fnc_t init_sequence_f[] = { bloblist_init, #endif setup_spl_handoff, - initf_console_record, +#if defined(CONFIG_CONSOLE_RECORD ) &&CONFIG_VAL (SYS_MALLOC_F_LEN ) + console_record_init, +#endif #if defined(CONFIG_HAVE_FSP ) arch_fsp_init,#endif --2.17.1
PATCH 2/18 common: board_f: Use IS_ENABLED(CONFIG_TIMER_EARLY) in initf_dm
In reply to Ovidiu PanaitUse IS_ENABLED(CONFIG_TIMER_EARLY) instead of #ifdef in initf_dm. Also, move timer code to the main ifdef, so that ret is defined.
--- common/board_f.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
common/board_f.c +6 -5
@@ -775,11 +775,12 @@ static int initf_dm(void)bootstage_accum (BOOTSTAGE_ID_ACCUM_DM_F );if (ret)return ret; -#endif -#ifdef CONFIG_TIMER_EARLY - ret =dm_timer_init (); -if (ret) -return ret; + +if (IS_ENABLED (CONFIG_TIMER_EARLY )) { + ret =dm_timer_init (); +if (ret) +return ret; + }#endif return 0 ;
Signature · 1 line
2.17.1
PATCH 2/18 common: board_f: Use IS_ENABLED(CONFIG_TIMER_EARLY) in initf_dm
Quoted 9 lines · Ovidiu Panait
Use
IS_ENABLED(CONFIG_TIMER_EARLY)instead of #ifdef ininitf_dm. Also, move timer code to the main ifdef, so that ret is defined.Signed-off-by Ovidiu Panait <[email protected]>--- common/board_f.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
PATCH 3/18 common: board_f: Move setup_machine code to setup_bdinfo
In reply to Ovidiu Panaitsetup_bdinfo is used to populate various bdinfo fields, so move setup_machine code there, as all it does is setting gd->bd->bi_arch_number.
--- common/board_f.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)
common/board_f.c +4 -9
@@ -503,14 +503,6 @@ static int reserve_board(void)return 0 ; } -static int setup_machine (void ) -{ -#ifdef CONFIG_MACH_TYPE - gd->bd->bi_arch_number =CONFIG_MACH_TYPE ;/* board id for Linux */ -#endif -return 0 ; -} -static int reserve_global_data (void ) { gd->start_addr_sp =reserve_stack_aligned (sizeof (gd_t));
@@ -605,6 +597,10 @@ int setup_bdinfo(void) bd->bi_sramsize =CONFIG_SYS_SRAM_SIZE ;/* size of SRAM */ } +#ifdef CONFIG_MACH_TYPE + bd->bi_arch_number =CONFIG_MACH_TYPE ;/* board id for Linux */ +#endif +return arch_setup_bdinfo (); }
@@ -916,7 +912,6 @@ static const init_fnc_t init_sequence_f[] = { reserve_uboot, reserve_malloc, reserve_board, - setup_machine, reserve_global_data, reserve_fdt, reserve_bootstage,
Signature · 1 line
2.17.1
PATCH 3/18 common: board_f: Move setup_machine code to setup_bdinfo
Hi Ovidiu
Quoted 4 lines · Ovidiu Panait
setup_bdinfois used to populate various bdinfo fields, so movesetup_machinecode there, as all it does is settinggd->bd->bi_arch_number.
But you are moving it to reserve_global_data() aren't you? I don't like the sound of that.
Quoted 45 lines
Signed-off-by Ovidiu Panait <[email protected]>--- common/board_f.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)common/board_f.c +4
-10@@ -503,14 +503,6 @@ static int reserve_board(void)return 0 ; } -static int setup_machine (void ) -{ -#ifdef CONFIG_MACH_TYPE - gd->bd->bi_arch_number =CONFIG_MACH_TYPE ;/* board id for Linux */ -#endif -return 0 ; -} -static int reserve_global_data (void ) { gd->start_addr_sp =reserve_stack_aligned (sizeof (gd_t));@@ -605,6 +597,10 @@ int setup_bdinfo(void) bd->bi_sramsize =CONFIG_SYS_SRAM_SIZE ;/* size of SRAM */ } +#ifdef CONFIG_MACH_TYPE + bd->bi_arch_number =CONFIG_MACH_TYPE ;/* board id for Linux */ +#endif +return arch_setup_bdinfo (); }@@ -916,7 +912,6 @@ static const init_fnc_t init_sequence_f[] = { reserve_uboot, reserve_malloc, reserve_board, - setup_machine, reserve_global_data, reserve_fdt, reserve_bootstage, --
Quoted 2 lines
2.17.1
Regards,
SImon
PATCH 3/18 common: board_f: Move setup_machine code to setup_bdinfo
Hi Simon,
Quoted 10 lines · Simon Glass
[Please note this e-mail is from an EXTERNAL e-mail address]
Hi Ovidiu
Quoted 3 lines · Ovidiu Panait
setup_bdinfois used to populate various bdinfo fields, so movesetup_machinecode there, as all it does is settinggd->bd->bi_arch_number.But you are moving it to
reserve_global_data()aren't you? I don't like the sound of that.
reserve_global_data() is part of context of the previous diff:
@@ -503,14 +503,6 @@ static int reserve_board(void)
return 0;
}
-static int setup_machine(void)
-{
-#ifdef CONFIG_MACH_TYPE
- gd->bd->bi_arch_number = CONFIG_MACH_TYPE; /* board id for Linux */
-#endif
- return 0;
-}
-
static int reserve_global_data(void)
{
gd->start_addr_sp = reserve_stack_aligned(sizeof(gd_t));setup_machine() contents get moved to setup_bdinfo() in the next diff:
@@ -605,6 +597,10 @@ int setup_bdinfo(void)
bd->bi_sramsize = CONFIG_SYS_SRAM_SIZE; /* size of SRAM */
}+#ifdef CONFIG_MACH_TYPE
+ bd->bi_arch_number = CONFIG_MACH_TYPE; /* board id for Linux */
+#endif
+
return arch_setup_bdinfo();
}
Ovidiu
Quoted 48 lines
Quoted 44 lines
Signed-off-by Ovidiu Panait <[email protected]>--- common/board_f.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)common/board_f.c +4
-10@@ -503,14 +503,6 @@ static int reserve_board(void)return 0 ; } -static int setup_machine (void ) -{ -#ifdef CONFIG_MACH_TYPE - gd->bd->bi_arch_number =CONFIG_MACH_TYPE ;/* board id for Linux */ -#endif -return 0 ; -} -static int reserve_global_data (void ) { gd->start_addr_sp =reserve_stack_aligned (sizeof (gd_t));@@ -605,6 +597,10 @@ int setup_bdinfo(void) bd->bi_sramsize =CONFIG_SYS_SRAM_SIZE ;/* size of SRAM */ } +#ifdef CONFIG_MACH_TYPE + bd->bi_arch_number =CONFIG_MACH_TYPE ;/* board id for Linux */ +#endif +return arch_setup_bdinfo (); }@@ -916,7 +912,6 @@ static const init_fnc_t init_sequence_f[] = { reserve_uboot, reserve_malloc, reserve_board, - setup_machine, reserve_global_data, reserve_fdt, reserve_bootstage, --Quoted 2 lines
2.17.1
Regards,
SImon
PATCH 3/18 common: board_f: Move setup_machine code to setup_bdinfo
Hi Ovidiu,
Quoted 37 lines · Ovidiu Panait
Hi Simon,
Quoted 10 lines · Simon Glass
[Please note this e-mail is from an EXTERNAL e-mail address]
Hi Ovidiu
Quoted 3 lines · Ovidiu Panait
setup_bdinfois used to populate various bdinfo fields, so movesetup_machinecode there, as all it does is settinggd->bd->bi_arch_number.But you are moving it to
reserve_global_data()aren't you? I don't like the sound of that.
reserve_global_data()is part of context of the previous diff:common/board_f.c +0
-8@@ -503,14 +503,6 @@ static int reserve_board(void)return 0 ; } -static int setup_machine (void ) -{ -#ifdef CONFIG_MACH_TYPE - gd->bd->bi_arch_number =CONFIG_MACH_TYPE ;/* board id for Linux */ -#endif -return 0 ; -} -static int reserve_global_data (void ) { gd->start_addr_sp =reserve_stack_aligned (sizeof (gd_t));
setup_machine()contents get moved tosetup_bdinfo()in the next diff:
common/board_f.c int setup_bdinfo(void) · line 605
Quoted 9 lines
common/board_f.c +4
-0@@ -605,6 +597,10 @@ int setup_bdinfo(void) bd->bi_sramsize =CONFIG_SYS_SRAM_SIZE ;/* size of SRAM */ } +#ifdef CONFIG_MACH_TYPE + bd->bi_arch_number =CONFIG_MACH_TYPE ;/* board id for Linux */ +#endif +return arch_setup_bdinfo (); }
OK thanks. I misread the diff.
Regards,
Simon
PATCH 4/18 common: board_f: Use IS_ENABLED(CONFIG_OF_EMBED) in reserve_fdt, reloc_fdt
In reply to Ovidiu PanaitUse IS_ENABLED(CONFIG_OF_EMBED) in instead of #ifdefs in reserve_fdt, reloc_fdt functions.
--- common/board_f.c | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-)
common/board_f.c +21 -20
@@ -514,21 +514,21 @@ static int reserve_global_data(void)static int reserve_fdt (void ) { -#ifndef CONFIG_OF_EMBED -/* -* If the device tree is sitting immediately above our image then we -* must relocate it. If it is embedded in the data section, then it -* will be relocated with other data. -*/ -if (gd->fdt_blob) { - gd->fdt_size =ALIGN (fdt_totalsize (gd->fdt_blob),32 ); +if (!IS_ENABLED (CONFIG_OF_EMBED )) { +/* +* If the device tree is sitting immediately above our image +* then we must relocate it. If it is embedded in the data +* section, then it will be relocated with other data. +*/ +if (gd->fdt_blob) { + gd->fdt_size =ALIGN (fdt_totalsize (gd->fdt_blob),32 ); - gd->start_addr_sp =reserve_stack_aligned (gd->fdt_size); - gd->new_fdt =map_sysmem (gd->start_addr_sp, gd->fdt_size); -debug ("Reserving %lu Bytes for FDT at: %08lx\n" , - gd->fdt_size, gd->start_addr_sp); + gd->start_addr_sp =reserve_stack_aligned (gd->fdt_size); + gd->new_fdt =map_sysmem (gd->start_addr_sp, gd->fdt_size); +debug ("Reserving %lu Bytes for FDT at: %08lx\n" , + gd->fdt_size, gd->start_addr_sp); + } } -#endif return 0 ; }
@@ -616,14 +616,15 @@ static int init_post(void)static int reloc_fdt (void ) { -#ifndef CONFIG_OF_EMBED -if (gd->flags &GD_FLG_SKIP_RELOC ) -return 0 ; -if (gd->new_fdt) { -memcpy (gd->new_fdt, gd->fdt_blob,fdt_totalsize (gd->fdt_blob)); - gd->fdt_blob = gd->new_fdt; +if (!IS_ENABLED (CONFIG_OF_EMBED )) { +if (gd->flags &GD_FLG_SKIP_RELOC ) +return 0 ; +if (gd->new_fdt) { +memcpy (gd->new_fdt, gd->fdt_blob, +fdt_totalsize (gd->fdt_blob)); + gd->fdt_blob = gd->new_fdt; + } } -#endif return 0 ; }
Signature · 1 line
2.17.1
PATCH 4/18 common: board_f: Use IS_ENABLED(CONFIG_OF_EMBED) in reserve_fdt, reloc_fdt
Quoted 9 lines · Ovidiu Panait
Use
IS_ENABLED(CONFIG_OF_EMBED)in instead of #ifdefs inreserve_fdt,reloc_fdtfunctions.Signed-off-by Ovidiu Panait <[email protected]>--- common/board_f.c | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-)
PATCH 5/18 common: board_r: Drop initr_console_record wrapper
In reply to Ovidiu PanaitDrop initr_console_record wrapper and call console_record_init directly.
--- common/board_r.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)
common/board_r.c +3 -10
@@ -282,15 +282,6 @@ static int initr_malloc(void)return 0 ; } -static int initr_console_record (void ) -{ -#if defined(CONFIG_CONSOLE_RECORD ) -return console_record_init (); -#else -return 0 ; -#endif -} -#ifdef CONFIG_SYS_NONCACHED_MEMORY static int initr_noncached (void ) {
@@ -713,7 +704,9 @@ static init_fnc_t init_sequence_r[] = { initr_malloc, log_init, initr_bootstage, /* Needs malloc() but has its own timer */ - initr_console_record, +#if defined(CONFIG_CONSOLE_RECORD ) + console_record_init, +#endif #ifdef CONFIG_SYS_NONCACHED_MEMORY initr_noncached,#endif
Signature · 1 line
2.17.1
PATCH 5/18 common: board_r: Drop initr_console_record wrapper
Quoted 7 lines · Ovidiu Panait
Drop
initr_console_recordwrapper and callconsole_record_initdirectly.Signed-off-by Ovidiu Panait <[email protected]>--- common/board_r.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)
PATCH 6/18 common: board_r: Drop initr_secondary_cpu wrapper
In reply to Ovidiu PanaitAdd a return value to cpu_secondary_init_r and use it directly in the post-relocation init sequence, rather than using a wrapper stub.
--- arch/powerpc/cpu/mpc85xx/cpu_init.c | 4 +++- common/board_r.c | 17 ++--------------- 2 files changed, 5 insertions(+), 16 deletions(-)
arch/powerpc/cpu/mpc85xx/cpu_init.c +3 -1
@@ -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
common/board_r.c +2 -15
@@ -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
Signature · 1 line
2.17.1
PATCH 6/18 common: board_r: Drop initr_secondary_cpu wrapper
Hi Ovidiu
Quoted 9 lines · Ovidiu Panait
Add a return value to
cpu_secondary_init_rand use it directly in the post-relocation init sequence, rather than using a wrapper stub.Signed-off-by Ovidiu Panait <[email protected]>--- arch/powerpc/cpu/mpc85xx/cpu_init.c | 4 +++- common/board_r.c | 17 ++--------------- 2 files changed, 5 insertions(+), 16 deletions(-)
nit below
Quoted 33 lines
arch/powerpc/cpu/mpc85xx/cpu_init.c +3
-1@@ -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 common/board_r.c +1
-1@@ -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 )
common/board_r.c __weak int board_flash_wp_on(void) · line 104
Quoted 10 lines
common/board_r.c +0
-9{ -} - -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
Can you add this comment to the header file that declares cpu_secondary_init_r()?
Quoted 17 lines
common/board_r.c +1
-6-*/ -/* 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 --
Quoted 2 lines
2.17.1
Regards,
Simon
PATCH 7/18 common: board_r: Drop initr_post_backlog wrapper
In reply to Ovidiu PanaitAdd a return value to post_output_backlog and use it directly in the post-relocation init sequence, rather than using a wrapper stub.
--- common/board_r.c | 10 +--------- include/post.h | 2 +- post/post.c | 4 +++- 3 files changed, 5 insertions(+), 11 deletions(-)
common/board_r.c +1 -9
@@ -206,14 +206,6 @@ static int initr_addr_map(void) }#endif -#ifdef CONFIG_POST -static int initr_post_backlog (void ) -{ -post_output_backlog (); -return 0 ; -} -#endif -#if defined(CONFIG_SYS_INIT_RAM_LOCK ) && defined(CONFIG_E500 )static int initr_unlock_ram_in_cache (void ) {
@@ -746,7 +738,7 @@ static init_fnc_t init_sequence_r[] = {#endif INIT_FUNC_WATCHDOG_RESET#ifdef CONFIG_POST - initr_post_backlog, + post_output_backlog, #endif INIT_FUNC_WATCHDOG_RESET#if defined(CONFIG_PCI ) && defined(CONFIG_SYS_EARLY_PCI_INIT )
include/post.h +1 -1
@@ -107,7 +107,7 @@ int post_init_f (void);void post_bootmode_init (void );int post_bootmode_get (unsigned int * last_test);void post_bootmode_clear (void ); -void post_output_backlog (void ); +int post_output_backlog (void );int post_run (char *name,int flags);int post_info (char *name);int post_log (char *format, ...);
post/post.c +3 -1
@@ -128,7 +128,7 @@ static void post_log_mark_succ(unsigned long testid) }/* ... and the messages are output once we are relocated */ -void post_output_backlog (void ) +int post_output_backlog (void ) {int j;
@@ -143,6 +143,8 @@ void post_output_backlog(void) } } } + +return 0 ; }static void post_bootmode_test_on (unsigned int last_test)
Signature · 1 line
2.17.1
PATCH 7/18 common: board_r: Drop initr_post_backlog wrapper
Quoted 11 lines · Ovidiu Panait
Add a return value to
post_output_backlogand use it directly in the post-relocation init sequence, rather than using a wrapper stub.Signed-off-by Ovidiu Panait <[email protected]>--- common/board_r.c | 10 +--------- include/post.h | 2 +- post/post.c | 4 +++- 3 files changed, 5 insertions(+), 11 deletions(-)
PATCH 8/18 common: board_r: Drop initr_pci_ep wrapper
In reply to Ovidiu PanaitAdd a return value to pci_ep_init and use it directly in the post-relocation init sequence, rather than using a wrapper stub.
--- common/board_r.c | 11 +---------- drivers/pci_endpoint/pci_ep-uclass.c | 4 +++- include/init.h | 2 +- 3 files changed, 5 insertions(+), 12 deletions(-)
common/board_r.c +1 -10
@@ -214,15 +214,6 @@ static int initr_unlock_ram_in_cache(void) }#endif -#ifdef CONFIG_PCI_ENDPOINT -static int initr_pci_ep (void ) -{ -pci_ep_init (); - -return 0 ; -} -#endif -#ifdef CONFIG_PCI static int initr_pci (void ) {
@@ -836,7 +827,7 @@ static init_fnc_t init_sequence_r[] = { initr_bbmii,#endif #ifdef CONFIG_PCI_ENDPOINT - initr_pci_ep, + pci_ep_init,#endif #ifdef CONFIG_CMD_NET INIT_FUNC_WATCHDOG_RESET
drivers/pci_endpoint/pci_ep-uclass.c +3 -1
@@ -210,7 +210,7 @@ UCLASS_DRIVER(pci_ep) = { .flags = DM_UC_FLAG_SEQ_ALIAS, }; -void pci_ep_init (void ) +int pci_ep_init (void ) {struct udevice *dev;
@@ -219,4 +219,6 @@ void pci_ep_init(void) uclass_next_device_check(&dev)) { ; } + +return 0 ; }
include/init.h +1 -1
@@ -235,7 +235,7 @@ int set_cpu_clk_info(void);int update_flash_size (int flash_size);int arch_early_init_r (void );void pci_init (void ); -void pci_ep_init (void ); +int pci_ep_init (void );int misc_init_r (void );#if defined(CONFIG_VID )int init_func_vid (void );
Signature · 1 line
2.17.1
PATCH 8/18 common: board_r: Drop initr_pci_ep wrapper
Quoted 11 lines · Ovidiu Panait
Add a return value to
pci_ep_initand use it directly in the post-relocation init sequence, rather than using a wrapper stub.Signed-off-by Ovidiu Panait <[email protected]>--- common/board_r.c | 11 +---------- drivers/pci_endpoint/pci_ep-uclass.c | 4 +++- include/init.h | 2 +- 3 files changed, 5 insertions(+), 12 deletions(-)
PATCH 9/18 common: board_r: Drop initr_pci wrapper
In reply to Ovidiu PanaitAdd a return value to pci_init and use it directly in the post-relocation init sequence, rather than using a wrapper stub.
--- common/board_r.c | 18 ++++-------------- drivers/pci/pci-uclass.c | 4 +++- drivers/pci/pci.c | 6 ++++-- include/init.h | 2 +- 4 files changed, 12 insertions(+), 18 deletions(-)
common/board_r.c +4 -14
@@ -214,16 +214,6 @@ static int initr_unlock_ram_in_cache(void) }#endif -#ifdef CONFIG_PCI -static int initr_pci (void ) -{ -if (IS_ENABLED (CONFIG_PCI_INIT_R )) -pci_init (); - -return 0 ; -} -#endif -static int initr_barrier (void ) {#ifdef CONFIG_PPC
@@ -732,12 +722,12 @@ static init_fnc_t init_sequence_r[] = { post_output_backlog, #endif INIT_FUNC_WATCHDOG_RESET -#if defined(CONFIG_PCI ) && defined(CONFIG_SYS_EARLY_PCI_INIT ) +#if defined(CONFIG_PCI_INIT_R ) && defined(CONFIG_SYS_EARLY_PCI_INIT )/* * Do early PCI configuration _before_ the flash gets initialised, * because PCU resources are crucial for flash access on some boards. */ - initr_pci, + pci_init,#endif #ifdef CONFIG_ARCH_EARLY_INIT_R arch_early_init_r,
@@ -776,11 +766,11 @@ static init_fnc_t init_sequence_r[] = { mac_read_from_eeprom, #endif INIT_FUNC_WATCHDOG_RESET -#if defined(CONFIG_PCI) && !defined(CONFIG_SYS_EARLY_PCI_INIT) +#if defined(CONFIG_PCI_INIT_R) && !defined(CONFIG_SYS_EARLY_PCI_INIT) /* * Do pci configuration */ - initr_pci, + pci_init, #endif stdio_add_devices, initr_jumptable,
drivers/pci/pci-uclass.c +3 -1
@@ -1834,7 +1834,7 @@ U_BOOT_DRIVER(pci_generic_drv) = { .of_match = pci_generic_ids, }; -void pci_init (void ) +int pci_init (void ) {struct udevice *bus;
@@ -1847,4 +1847,6 @@ void pci_init(void) uclass_next_device_check(&bus)) { ; } + +return 0 ; }
drivers/pci/pci.c +4 -2
@@ -454,16 +454,18 @@ int pci_hose_scan(struct pci_controller *hose)return pci_hose_scan_bus (hose, hose->current_busno); } -void pci_init (void ) +int pci_init (void ) { hose_head =NULL ;/* allow env to disable pci init/enum */ if (env_get ("pcidisable" ) !=NULL ) -return ; +return 0 ;/* now call board specific pci_init()... */ pci_init_board (); + +return 0 ; }/* Returns the address of the requested capability structure within the
include/init.h +1 -1
@@ -234,7 +234,7 @@ int mac_read_from_eeprom(void);int set_cpu_clk_info (void );int update_flash_size (int flash_size);int arch_early_init_r (void ); -void pci_init (void ); +int pci_init (void );int pci_ep_init (void );int misc_init_r (void );#if defined(CONFIG_VID )
Signature · 1 line
2.17.1
PATCH 9/18 common: board_r: Drop initr_pci wrapper
Quoted 11 lines · Ovidiu Panait
Add a return value to
pci_initand use it directly in the post-relocation init sequence, rather than using a wrapper stub.Signed-off-by Ovidiu Panait <[email protected]>--- common/board_r.c | 18 ++++-------------- drivers/pci/pci-uclass.c | 4 +++- drivers/pci/pci.c | 6 ++++-- include/init.h | 2 +- 4 files changed, 12 insertions(+), 18 deletions(-)
nit below
Quoted 101 lines
common/board_r.c +4
-14@@ -214,16 +214,6 @@ static int initr_unlock_ram_in_cache(void) }#endif -#ifdef CONFIG_PCI -static int initr_pci (void ) -{ -if (IS_ENABLED (CONFIG_PCI_INIT_R )) -pci_init (); - -return 0 ; -} -#endif -static int initr_barrier (void ) {#ifdef CONFIG_PPC @@ -732,12 +722,12 @@ static init_fnc_t init_sequence_r[] = { post_output_backlog, #endif INIT_FUNC_WATCHDOG_RESET -#if defined(CONFIG_PCI ) && defined(CONFIG_SYS_EARLY_PCI_INIT ) +#if defined(CONFIG_PCI_INIT_R ) && defined(CONFIG_SYS_EARLY_PCI_INIT )/* * Do early PCI configuration _before_ the flash gets initialised, * because PCU resources are crucial for flash access on some boards. */ - initr_pci, + pci_init,#endif #ifdef CONFIG_ARCH_EARLY_INIT_R arch_early_init_r,@@ -776,11 +766,11 @@ static init_fnc_t init_sequence_r[] = { mac_read_from_eeprom, #endif INIT_FUNC_WATCHDOG_RESET -#if defined(CONFIG_PCI) && !defined(CONFIG_SYS_EARLY_PCI_INIT) +#if defined(CONFIG_PCI_INIT_R) && !defined(CONFIG_SYS_EARLY_PCI_INIT) /* * Do pci configuration */ - initr_pci, + pci_init, #endif stdio_add_devices, initr_jumptable,drivers/pci/pci-uclass.c +3
-1@@ -1834,7 +1834,7 @@ U_BOOT_DRIVER(pci_generic_drv) = { .of_match = pci_generic_ids, }; -void pci_init (void ) +int pci_init (void ) {struct udevice *bus;@@ -1847,4 +1847,6 @@ void pci_init(void) uclass_next_device_check(&bus)) { ; } + +return 0 ; }drivers/pci/pci.c +4
-2@@ -454,16 +454,18 @@ int pci_hose_scan(struct pci_controller *hose)return pci_hose_scan_bus (hose, hose->current_busno); } -void pci_init (void ) +int pci_init (void ) { hose_head =NULL ;/* allow env to disable pci init/enum */ if (env_get ("pcidisable" ) !=NULL ) -return ; +return 0 ;/* now call board specific pci_init()... */ pci_init_board (); + +return 0 ; }/* Returns the address of the requested capability structure within the include/init.h +0
-0
include/init.h int mac_read_from_eeprom(void); · line 237
Quoted 5 lines
include/init.h +1
-1@@ -234,7 +234,7 @@ int mac_read_from_eeprom(void);int set_cpu_clk_info (void );int update_flash_size (int flash_size);int arch_early_init_r (void ); -void pci_init (void ); +int pci_init (void );
Please add a comment about what it does and the return value
Quoted 6 lines
include/init.h +0
-1int pci_ep_init (void );int misc_init_r (void );#if defined(CONFIG_VID ) --2.17.1
PATCH 10/18 common: board_r: Drop initr_addr_map wrapper
In reply to Ovidiu PanaitAdd a return value to init_addr_map and use it directly in the post-relocation init sequence, rather than using a wrapper stub.
--- arch/arm/include/asm/mmu.h | 2 +- arch/arm/mach-bcm283x/init.c | 4 +++- arch/powerpc/cpu/mpc85xx/tlb.c | 4 ++-- arch/powerpc/cpu/mpc86xx/cpu_init.c | 4 +++- arch/powerpc/include/asm/mmu.h | 2 +- common/board_r.c | 11 +---------- 6 files changed, 11 insertions(+), 16 deletions(-)
arch/arm/include/asm/mmu.h +1 -1
@@ -3,6 +3,6 @@#ifndef __ASM_ARM_MMU_H#define __ASM_ARM_MMU_H -void init_addr_map (void ); +int init_addr_map (void );#endif
arch/arm/mach-bcm283x/init.c +3 -1
@@ -151,7 +151,7 @@ int mach_cpu_init(void)#include <addr_map.h> #include <asm/system.h> -void init_addr_map (void ) +int init_addr_map (void ) { mmu_set_region_dcache_behaviour_phys(BCM2711_RPI4_PCIE_XHCI_MMIO_VIRT, BCM2711_RPI4_PCIE_XHCI_MMIO_PHYS,
@@ -164,6 +164,8 @@ void init_addr_map(void)addrmap_set_entry (BCM2711_RPI4_PCIE_XHCI_MMIO_VIRT ,BCM2711_RPI4_PCIE_XHCI_MMIO_PHYS ,BCM2711_RPI4_PCIE_XHCI_MMIO_SIZE ,1 ); + + return 0; }#endif
arch/powerpc/cpu/mpc85xx/tlb.c +2 -2
@@ -218,7 +218,7 @@ int find_tlb_idx(void *addr, u8 tlbsel) }#ifdef CONFIG_ADDR_MAP -void init_addr_map (void ) +int init_addr_map (void ) {int i;unsigned int num_cam =mfspr (SPRN_TLB1CFG ) &0xfff ;
@@ -234,7 +234,7 @@ void init_addr_map(void) addrmap_set_entry(epn, rpn, TSIZE_TO_BYTES(tsize), i); } -return ; +return 0 ; }#endif
arch/powerpc/cpu/mpc86xx/cpu_init.c +3 -1
@@ -77,7 +77,7 @@ int cpu_init_r(void)#ifdef CONFIG_ADDR_MAP /* Initialize address mapping array */ -void init_addr_map (void ) +int init_addr_map (void ) {int i;ppc_bat_t bat =DBAT0 ;
@@ -99,5 +99,7 @@ void init_addr_map(void) bat =DBAT4 -1 ; #endif } + +return 0 ; }#endif
arch/powerpc/include/asm/mmu.h +1 -1
@@ -138,7 +138,7 @@ extern void _tlbie(unsigned long va); /* invalidate a TLB entry */extern void _tlbia (void );/* invalidate all TLB entries */ #ifdef CONFIG_ADDR_MAP -extern void init_addr_map (void ); +int init_addr_map (void );#endif typedef enum {
common/board_r.c +1 -10
@@ -197,15 +197,6 @@ static int initr_trap(void) }#endif -#ifdef CONFIG_ADDR_MAP -static int initr_addr_map (void ) -{ -init_addr_map (); - -return 0 ; -} -#endif -#if defined(CONFIG_SYS_INIT_RAM_LOCK ) && defined(CONFIG_E500 )static int initr_unlock_ram_in_cache (void ) {
@@ -712,7 +703,7 @@ static init_fnc_t init_sequence_r[] = { initr_trap,#endif #ifdef CONFIG_ADDR_MAP - initr_addr_map, + init_addr_map,#endif #if defined(CONFIG_BOARD_EARLY_INIT_R ) board_early_init_r,
Signature · 1 line
2.17.1
PATCH 10/18 common: board_r: Drop initr_addr_map wrapper
Quoted 5 lines · Ovidiu Panait
Add a return value to
init_addr_mapand use it directly in the post-relocation init sequence, rather than using a wrapper stub.Signed-off-by Ovidiu Panait <[email protected]>
Quoted 9 lines
--- arch/arm/include/asm/mmu.h | 2 +- arch/arm/mach-bcm283x/init.c | 4 +++- arch/powerpc/cpu/mpc85xx/tlb.c | 4 ++-- arch/powerpc/cpu/mpc86xx/cpu_init.c | 4 +++- arch/powerpc/include/asm/mmu.h | 2 +- common/board_r.c | 11 +---------- 6 files changed, 11 insertions(+), 16 deletions(-)
PATCH 11/18 common: board_r: Drop initr_noncached wrapper
In reply to Ovidiu PanaitAdd a return value to noncached_init and use it directly in the post-relocation init sequence, rather than using a wrapper stub.
--- arch/arm/include/asm/system.h | 2 +- arch/arm/lib/cache.c | 4 +++- common/board_r.c | 10 +--------- 3 files changed, 5 insertions(+), 11 deletions(-)
arch/arm/include/asm/system.h +1 -1
@@ -628,7 +628,7 @@ 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 ); +int noncached_init (void );phys_addr_t noncached_alloc (size_t size,size_t align);#endif /* CONFIG_SYS_NONCACHED_MEMORY */
arch/arm/lib/cache.c +3 -1
@@ -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)
common/board_r.c +1 -9
@@ -233,14 +233,6 @@ static int initr_malloc(void)return 0 ; } -#ifdef CONFIG_SYS_NONCACHED_MEMORY -static int initr_noncached (void ) -{ -noncached_init (); -return 0 ; -} -#endif -static int initr_of_live (void ) {if (CONFIG_IS_ENABLED (OF_LIVE )) {
@@ -659,7 +651,7 @@ static init_fnc_t init_sequence_r[] = { console_record_init,#endif #ifdef CONFIG_SYS_NONCACHED_MEMORY - initr_noncached, + noncached_init, #endif initr_of_live, #ifdef CONFIG_DM
Signature · 1 line
2.17.1
PATCH 11/18 common: board_r: Drop initr_noncached wrapper
Quoted 10 lines · Ovidiu Panait
Add a return value to
noncached_initand use it directly in the post-relocation init sequence, rather than using a wrapper stub.Signed-off-by Ovidiu Panait <[email protected]>--- arch/arm/include/asm/system.h | 2 +- arch/arm/lib/cache.c | 4 +++- common/board_r.c | 10 +--------- 3 files changed, 5 insertions(+), 11 deletions(-)
Again when you change a function signature, it's a good oppty to add a comment if one is missing
PATCH 12/18 common: board_r: Drop initr_xen wrapper
In reply to Ovidiu PanaitAdd a return value to xen_init and use it directly in the post-relocation init sequence, rather than using a wrapper stub.
--- common/board_r.c | 10 +--------- drivers/xen/hypervisor.c | 4 +++- include/xen.h | 2 +- 3 files changed, 5 insertions(+), 11 deletions(-)
common/board_r.c +1 -9
@@ -419,14 +419,6 @@ static int initr_mmc(void) }#endif -#ifdef CONFIG_XEN -static int initr_xen (void ) -{ -xen_init (); -return 0 ; -} -#endif -#ifdef CONFIG_PVBLOCK static int initr_pvblock (void ) {
@@ -734,7 +726,7 @@ static init_fnc_t init_sequence_r[] = { initr_mmc,#endif #ifdef CONFIG_XEN - initr_xen, + xen_init,#endif #ifdef CONFIG_PVBLOCK initr_pvblock,
drivers/xen/hypervisor.c +3 -1
@@ -232,7 +232,7 @@ void clear_evtchn(uint32_t port)synch_clear_bit (port, &s->evtchn_pending[0 ]); } -void xen_init (void ) +int xen_init (void ) {debug ("%s\n" , __func__);
@@ -240,6 +240,8 @@ void xen_init(void)init_events ();init_xenbus ();init_gnttab (); + +return 0 ; }void xen_fini (void )
include/xen.h +1 -1
@@ -11,7 +11,7 @@* Map Xen memory pages, initialize event handler and xenbus, * setup the grant table. */ -void xen_init (void ); +int xen_init (void );/** * xen_fini() - Board cleanup before Linux kernel start
Signature · 1 line
2.17.1
PATCH 12/18 common: board_r: Drop initr_xen wrapper
Quoted 11 lines · Ovidiu Panait
Add a return value to
xen_initand use it directly in the post-relocation init sequence, rather than using a wrapper stub.Signed-off-by Ovidiu Panait <[email protected]>--- common/board_r.c | 10 +--------- drivers/xen/hypervisor.c | 4 +++- include/xen.h | 2 +- 3 files changed, 5 insertions(+), 11 deletions(-)
PATCH 13/18 common: board_r: Drop initr_jumptable wrapper
In reply to Ovidiu PanaitAdd a return value to jumptable_init and use it directly in the post-relocation init sequence, rather than using a wrapper stub.
--- common/board_r.c | 8 +------- common/exports.c | 4 +++- include/exports.h | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-)
common/board_r.c +1 -7
@@ -481,12 +481,6 @@ static int initr_malloc_bootparams(void) }#endif -static int initr_jumptable (void ) -{ -jumptable_init (); -return 0 ; -} -#if defined(CONFIG_API )static int initr_api (void ) {
@@ -748,7 +742,7 @@ static init_fnc_t init_sequence_r[] = { pci_init, #endif stdio_add_devices, - initr_jumptable, + jumptable_init, #ifdef CONFIG_API initr_api, #endif
common/exports.c +3 -1
@@ -25,8 +25,10 @@ unsigned long get_version(void)# define miiphy_set_current_dev dummy#endif -void jumptable_init (void ) +int jumptable_init (void ) { gd->jt =malloc (sizeof (struct jt_funcs ));#include <_exports.h> + +return 0 ; }
include/exports.h +1 -1
@@ -16,7 +16,7 @@ struct cmd_tbl;struct spi_slave ;/* Set up the jump table for use by the API */ -void jumptable_init (void ); +int jumptable_init (void );/* These are declarations of exported functions available in C code */ unsigned long get_version (void );
Signature · 1 line
2.17.1
PATCH 13/18 common: board_r: Drop initr_jumptable wrapper
Quoted 10 lines · Ovidiu Panait
Add a return value to
jumptable_initand use it directly in the post-relocation init sequence, rather than using a wrapper stub.Signed-off-by Ovidiu Panait <[email protected]>--- common/board_r.c | 8 +------- common/exports.c | 4 +++- include/exports.h | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-)
PATCH 14/18 common: board_r: Drop initr_api wrapper
In reply to Ovidiu PanaitAdd a return value to api_init and use it directly in the post-relocation init sequence, rather than using a wrapper stub.
--- api/api.c | 6 ++++-- api/api_private.h | 2 +- common/board_r.c | 11 +---------- include/api.h | 2 +- 4 files changed, 7 insertions(+), 14 deletions(-)
api/api.c +4 -2
@@ -642,7 +642,7 @@ int syscall(int call, int *retval, ...)return 1 ; } -void api_init (void ) +int api_init (void ) {struct api_signature *sig;
@@ -679,7 +679,7 @@ void api_init(void) sig =malloc (sizeof (struct api_signature ));if (sig ==NULL ) {printf ("API: could not allocate memory for the signature!\n" ); -return ; +return -ENOMEM ; }env_set_hex ("api_address" , (unsigned long )sig);
@@ -691,6 +691,8 @@ void api_init(void) sig->checksum =crc32 (0 , (unsigned char *)sig,sizeof (struct api_signature ));debugf ("syscall entry: 0x%lX\n" , (unsigned long )sig->syscall); + +return 0 ; } void platform_set_mr(struct sys_info *si, unsigned long start, unsigned long size,
api/api_private.h +1 -1
@@ -8,7 +8,7 @@#ifndef _API_PRIVATE_H_#define _API_PRIVATE_H_ -void api_init (void ); +int api_init (void );void platform_set_mr (struct sys_info *,unsigned long ,unsigned long ,int );int platform_sys_info (struct sys_info *);
common/board_r.c +1 -10
@@ -481,15 +481,6 @@ static int initr_malloc_bootparams(void) }#endif -#if defined(CONFIG_API ) -static int initr_api (void ) -{ -/* Initialize API */ -api_init (); -return 0 ; -} -#endif -#ifdef CONFIG_CMD_NET static int initr_ethaddr (void ) {
@@ -744,7 +735,7 @@ static init_fnc_t init_sequence_r[] = { stdio_add_devices, jumptable_init,#ifdef CONFIG_API - initr_api, + api_init, #endif console_init_r,/* fully init console as a device */ #ifdef CONFIG_DISPLAY_BOARDINFO_LATE
include/api.h +1 -1
@@ -7,6 +7,6 @@#ifndef __API_H#define __API_H -void api_init (void ); +int api_init (void );#endif
Signature · 1 line
2.17.1
PATCH 14/18 common: board_r: Drop initr_api wrapper
Quoted 11 lines · Ovidiu Panait
Add a return value to
api_initand use it directly in the post-relocation init sequence, rather than using a wrapper stub.Signed-off-by Ovidiu Panait <[email protected]>--- api/api.c | 6 ++++-- api/api_private.h | 2 +- common/board_r.c | 11 +---------- include/api.h | 2 +- 4 files changed, 7 insertions(+), 14 deletions(-)
PATCH 15/18 common: board_r: Drop initr_bbmii wrapper
In reply to Ovidiu PanaitAdd a return value to bb_miiphy_init and use it directly in the post-relocation init sequence, rather than using a wrapper stub.
--- common/board_r.c | 10 +--------- drivers/net/phy/miiphybb.c | 4 +++- include/miiphy.h | 2 +- 3 files changed, 5 insertions(+), 11 deletions(-)
common/board_r.c +1 -9
@@ -525,14 +525,6 @@ static int initr_scsi(void) }#endif -#ifdef CONFIG_BITBANGMII -static int initr_bbmii (void ) -{ -bb_miiphy_init (); -return 0 ; -} -#endif -#ifdef CONFIG_CMD_NET static int initr_net (void ) {
@@ -774,7 +766,7 @@ static init_fnc_t init_sequence_r[] = { initr_scsi,#endif #ifdef CONFIG_BITBANGMII - initr_bbmii, + bb_miiphy_init,#endif #ifdef CONFIG_PCI_ENDPOINT pci_ep_init,
drivers/net/phy/miiphybb.c +3 -1
@@ -105,7 +105,7 @@ int bb_miiphy_buses_num = sizeof(bb_miiphy_buses) /sizeof (bb_miiphy_buses[0 ]);#endif -void bb_miiphy_init (void ) +int bb_miiphy_init (void ) {int i;
@@ -124,6 +124,8 @@ void bb_miiphy_init(void) bb_miiphy_buses[i].init (&bb_miiphy_buses[i]); } } + +return 0 ; }static inline struct bb_miiphy_bus *bb_miiphy_getbus (const char *devname)
include/miiphy.h +1 -1
@@ -81,7 +81,7 @@ struct bb_miiphy_bus {extern struct bb_miiphy_bus bb_miiphy_buses[];extern int bb_miiphy_buses_num; -void bb_miiphy_init (void ); +int bb_miiphy_init (void );int bb_miiphy_read (struct mii_dev *miidev,int addr,int devad,int reg);int bb_miiphy_write (struct mii_dev *miidev,int addr,int devad,int reg,u16 value);
Signature · 1 line
2.17.1
PATCH 15/18 common: board_r: Drop initr_bbmii wrapper
Quoted 11 lines · Ovidiu Panait
Add a return value to
bb_miiphy_initand use it directly in the post-relocation init sequence, rather than using a wrapper stub.Signed-off-by Ovidiu Panait <[email protected]>--- common/board_r.c | 10 +--------- drivers/net/phy/miiphybb.c | 4 +++- include/miiphy.h | 2 +- 3 files changed, 5 insertions(+), 11 deletions(-)
PATCH 16/18 common: board_r: Drop arch-specific ifdefs around initr_trap
In reply to Ovidiu PanaitIn 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.
--- arch/m68k/lib/traps.c | 7 +++++++ arch/mips/lib/traps.c | 7 +++++++ arch/powerpc/lib/Makefile | 1 + arch/powerpc/lib/traps.c | 17 +++++++++++++++++ common/board_r.c | 16 ++-------------- include/init.h | 9 +++++++++ 6 files changed, 43 insertions(+), 14 deletions(-) create mode 100644 arch/powerpc/lib/traps.c
arch/m68k/lib/traps.c +7 -0
@@ -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 ; +}
arch/mips/lib/traps.c +7 -0
@@ -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 ; +}
arch/powerpc/lib/Makefile +1 -0
@@ -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
arch/powerpc/lib/traps.c new file +17 -0
@@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* (C) Copyright 2003 +* Wolfgang Denk, DENX Software Engineering, wd at denx.de. +*/ + +#include <common.h> +#include <init.h> + +DECLARE_GLOBAL_DATA_PTR ; + +int arch_initr_trap (void ) +{ +trap_init (gd->relocaddr); + +return 0 ; +}
common/board_r.c +2 -14
@@ -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 #if defined(CONFIG_SYS_INIT_RAM_LOCK ) && defined(CONFIG_E500 )static int initr_unlock_ram_in_cache (void )
@@ -660,9 +650,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 init_addr_map,#endif
include/init.h +9 -0
@@ -267,6 +267,15 @@ int board_early_init_r(void);/* TODO(sjg at chromium.org): Drop this when DM_PCI migration is completed */ void pci_init_board (void ); +/** +* arch_initr_trap() - Init traps +* +* Arch specific routine for initializing traps. It is called during the +* generic board init sequence, after relocation. +* +* Return: 0 if OK +*/ +int arch_initr_trap (void );void trap_init (unsigned long reloc_addr);/**
Signature · 1 line
2.17.1
PATCH 16/18 common: board_r: Drop arch-specific ifdefs around initr_trap
Quoted 8 lines · Ovidiu Panait
In order to remove the arch-specific ifdefs around
initr_trap, introducearch_initr_trapweak initcall. Implementations for ppc/m68k/mips have been moved to arch/<arch>/lib/traps.cDefault implementation is a nop stub.
Signed-off-by Ovidiu Panait <[email protected]>
Quoted 9 lines
--- arch/m68k/lib/traps.c | 7 +++++++ arch/mips/lib/traps.c | 7 +++++++ arch/powerpc/lib/Makefile | 1 + arch/powerpc/lib/traps.c | 17 +++++++++++++++++ common/board_r.c | 16 ++-------------- include/init.h | 9 +++++++++ 6 files changed, 43 insertions(+), 14 deletions(-) create mode 100644 arch/powerpc/lib/traps.c
PATCH 17/18 spl: Kconfig: Add SPL dependency to CONFIG_HANDOFF
In reply to Ovidiu PanaitCONFIG_HANDOFF is used in u-boot proper to locate handoff info from SPL during pre-relocation init (in setup_spl_handoff). Add explicit dependency on CONFIG_SPL, to fix the following build error when CONFIG_HANDOFF && !CONFIG_SPL:
common/board_f.c: In function ?setup_spl_handoff?:common/board_f.c:283:4: error: ?gd_t {aka struct global_data}? has no member named ?spl_handoff?
gd->spl_handoff = bloblist_find(BLOBLISTT_SPL_HANDOFF,
^~
--- common/spl/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/spl/Kconfig +1 -1
@@ -117,7 +117,7 @@ endmenu config HANDOFF bool "Pass hand-off information from SPL to U-Boot proper" - depends on BLOBLIST + depends on SPL && BLOBLIST help It is useful to be able to pass information from SPL to U-Boot proper to preserve state that is known in SPL and is needed in U-Boot.
Signature · 1 line
2.17.1
PATCH 17/18 spl: Kconfig: Add SPL dependency to CONFIG_HANDOFF
Quoted 10 lines · Ovidiu Panait
CONFIG_HANDOFFis used in u-boot proper to locate handoff info from SPL during pre-relocation init (insetup_spl_handoff). Add explicit dependency onCONFIG_SPL, to fix the following build error whenCONFIG_HANDOFF&& !CONFIG_SPL:
common/board_f.c: In function ?setup_spl_handoff?:common/board_f.c:283:4: error: ?gd_t {aka structglobal_data}? has no member named ?spl_handoff?
gd->spl_handoff= bloblist_find(BLOBLISTT_SPL_HANDOFF,
Quoted 6 lines
^~Signed-off-by Ovidiu Panait <[email protected]>--- common/spl/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH 18/18 global_data: Enable spl_handoff only if CONFIG_HANDOFF is set
In reply to Ovidiu Panaitspl_handoff should only be enabled when CONFIG_HANDOFF is set. Drop the nested ifdefs and check for CONFIG_HANDOFF instead.
--- include/asm-generic/global_data.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/asm-generic/global_data.h +2 -2
@@ -399,12 +399,12 @@ struct global_data {* @new_bloblist: relocated blob list information */ struct bloblist_hdr *new_bloblist; -# ifdef CONFIG_SPL +#endif +#if CONFIG_IS_ENABLED (HANDOFF )/** * @spl_handoff: SPL hand-off information */ struct spl_handoff *spl_handoff; -# endif #endif #if defined(CONFIG_TRANSLATION_OFFSET )/**
Signature · 1 line
2.17.1
PATCH 18/18 global_data: Enable spl_handoff only if CONFIG_HANDOFF is set
Quoted 8 lines · Ovidiu Panait
spl_handoffshould only be enabled whenCONFIG_HANDOFFis set. Drop the nested ifdefs and check forCONFIG_HANDOFFinstead.Signed-off-by Ovidiu Panait <[email protected]>--- include/asm-generic/global_data.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)