Minor board_f/board_r cleanups
Subsystems (9)
v4 cover Minor board_f/board_r cleanups
v4:
* Drop trap_init declaration from init.h and make arch-specific implementations static for mips and m68k (on powerpc trap_init is an asm routine)
v3:
* Use only "default y" for CONFIG_CONSOLE_RECORD_INIT_F Kconfig option
* Add reviewed-by tags
v2:
* Introduce CONFIG_CONSOLE_RECORD_INIT_F Kconfig to eliminate complex ifdef around console_record_init in board_f.c
* Add function comments to all routines that get their signatures changed
* Add reviewed-by tags
v1:
* 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: Kconfig: Introduce CONFIG_CONSOLE_RECORD_INIT_F
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_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/system.h | 13 ++- arch/arm/lib/cache.c | 4 +- arch/m68k/lib/traps.c | 7 ++ arch/mips/lib/traps.c | 7 ++ arch/powerpc/cpu/mpc85xx/cpu_init.c | 4 +- arch/powerpc/lib/Makefile | 1 + arch/powerpc/lib/traps.c | 17 ++++ common/Kconfig | 8 ++ common/board_f.c | 78 +++++++--------- common/board_r.c | 134 ++++----------------------- 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 | 10 +- include/asm-generic/global_data.h | 4 +- include/exports.h | 10 +- include/init.h | 46 ++++++++- include/miiphy.h | 10 +- include/post.h | 11 ++- include/xen.h | 2 +- post/post.c | 4 +- 27 files changed, 221 insertions(+), 185 deletions(-) create mode 100644 arch/powerpc/lib/traps.c
Signature · 1 line
2.17.1
PATCH v4 1/18 common: Kconfig: Introduce CONFIG_CONSOLE_RECORD_INIT_F
Currently, the following #ifdef construct is used to check whether to run console_record_init() during pre-relocation init:
defined(CONFIG_CONSOLE_RECORD) && CONFIG_VAL(SYS_MALLOC_F_LEN)
Introduce CONFIG_CONSOLE_RECORD_INIT_F Kconfig option to get rid of the complex ifdef check. Also, use IS_ENABLED() instead of #ifdef.
---
v4 updates:
- add reviewed-by tag
v3 updates:
- use only "default y" for CONSOLE_RECORD_INIT_F
v2 updates:
- new patch
common/Kconfig | 8 ++++++++ common/board_f.c | 7 +++---- 2 files changed, 11 insertions(+), 4 deletions(-)
common/Kconfig +8 -0
@@ -17,6 +17,14 @@ config CONSOLE_RECORD To enable console recording, call console_record_reset_enable() from your code. +config CONSOLE_RECORD_INIT_F + bool "Enable console recording during pre-relocation init" + depends on CONSOLE_RECORD && SYS_MALLOC_F + default y + help + This option enables console recording during pre-relocation init. + CONFIG_SYS_MALLOC_F must be enabled to use this feature. + config CONSOLE_RECORD_OUT_SIZE hex "Output buffer size" depends on CONSOLE_RECORD
common/board_f.c +3 -4
@@ -767,11 +767,10 @@ static int initf_bootstage(void)static int initf_console_record (void ) { -#if defined(CONFIG_CONSOLE_RECORD ) &&CONFIG_VAL (SYS_MALLOC_F_LEN ) -return console_record_init (); -#else +if (IS_ENABLED (CONFIG_CONSOLE_RECORD_INIT_F )) +return console_record_init (); +return 0 ; -#endif }static int initf_dm (void )
Signature · 1 line
2.17.1
PATCH v4 1/18 common: Kconfig: Introduce CONFIG_CONSOLE_RECORD_INIT_F
Quoted 9 lines · Ovidiu Panait
Currently, the following #ifdef construct is used to check whether to run
console_record_init()during pre-relocation init:
defined(CONFIG_CONSOLE_RECORD)&&CONFIG_VAL(SYS_MALLOC_F_LEN)Introduce
CONFIG_CONSOLE_RECORD_INIT_FKconfigoption to get rid of the complex ifdef check. Also, useIS_ENABLED()instead of #ifdef.Signed-off-by Ovidiu Panait <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210116/a1c11c6e/attachment.sig>
PATCH v4 2/18 common: board_f: Drop initf_console_record wrapper
In reply to Ovidiu PanaitDrop initf_console_record wrapper and call console_record_init directly.
---
v4 updates:
- add reviewed-by tag
v3 updates:
- none
v2 updates:
- check defined(CONFIG_CONSOLE_RECORD_INIT_F) in ifdef condition
common/board_f.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
common/board_f.c +3 -9
@@ -765,14 +765,6 @@ static int initf_bootstage(void)return 0 ; } -static int initf_console_record (void ) -{ -if (IS_ENABLED (CONFIG_CONSOLE_RECORD_INIT_F )) -return console_record_init (); - -return 0 ; -} -static int initf_dm (void ) {#if defined(CONFIG_DM ) &&CONFIG_VAL (SYS_MALLOC_F_LEN )
@@ -829,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_INIT_F ) + console_record_init, +#endif #if defined(CONFIG_HAVE_FSP ) arch_fsp_init,#endif
Signature · 1 line
2.17.1
PATCH v4 2/18 common: board_f: Drop initf_console_record wrapper
Quoted 4 lines · Ovidiu Panait
Drop
initf_console_recordwrapper and callconsole_record_initdirectly.Signed-off-by Ovidiu Panait <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210116/09027b4e/attachment.sig>
PATCH v4 3/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.
---
v4 updates:
- none
v3 updates:
- none
v2 updates:
- add reviewed-by tag
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 v4 3/18 common: board_f: Use IS_ENABLED(CONFIG_TIMER_EARLY) in initf_dm
Quoted 5 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]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210116/092c5128/attachment.sig>
PATCH v4 3/18 common: board_f: Use IS_ENABLED(CONFIG_TIMER_EARLY) in initf_dm
In reply to Ovidiu PanaitQuoted 5 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]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210116/f963ac74/attachment.sig>
PATCH v4 4/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.
---
v4 updates:
- none
v3 updates:
- none
v2 updates:
- add reviewed-by tag
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 v4 4/18 common: board_f: Move setup_machine code to setup_bdinfo
Quoted 6 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.Signed-off-by Ovidiu Panait <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210116/a38de952/attachment.sig>
PATCH v4 5/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.
---
v4 updates:
- none
v3 updates:
- none
v2 updates:
- add reviewed-by tag
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 v4 5/18 common: board_f: Use IS_ENABLED(CONFIG_OF_EMBED) in reserve_fdt, reloc_fdt
Quoted 5 lines · Ovidiu Panait
Use
IS_ENABLED(CONFIG_OF_EMBED)in instead of #ifdefs inreserve_fdt,reloc_fdtfunctions.Signed-off-by Ovidiu Panait <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210116/7fc7d637/attachment.sig>
PATCH v4 6/18 common: board_r: Drop initr_console_record wrapper
In reply to Ovidiu PanaitDrop initr_console_record wrapper and call console_record_init directly.
---
v4 updates:
- none
v3 updates:
- none
v2 updates:
- add reviewed-by tag
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 v4 6/18 common: board_r: Drop initr_console_record wrapper
Quoted 4 lines · Ovidiu Panait
Drop
initr_console_recordwrapper and callconsole_record_initdirectly.Signed-off-by Ovidiu Panait <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210116/76570752/attachment.sig>
PATCH v4 7/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.
---
v4 updates:
- add reviewed-by tag
v3 updates:
-none
v2 updates:
- add function comment
arch/powerpc/cpu/mpc85xx/cpu_init.c | 4 +++- common/board_r.c | 17 ++--------------- include/init.h | 14 ++++++++++++++ 3 files changed, 19 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
include/init.h +14 -0
@@ -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 *
Signature · 1 line
2.17.1
PATCH v4 7/18 common: board_r: Drop initr_secondary_cpu wrapper
Quoted 12 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]>---
v4 updates:
- add reviewed-by tagv3 updates:
-none
Quoted 7 lines
v2 updates:
- add function commentarch/powerpc/cpu/mpc85xx/cpu_init.c | 4 +++- common/board_r.c | 17 ++--------------- include/init.h | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 16 deletions(-)
PATCH v4 7/18 common: board_r: Drop initr_secondary_cpu wrapper
In reply to Ovidiu PanaitQuoted 5 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]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210116/c32bb624/attachment.sig>
PATCH v4 8/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.
---
v4 updates:
- none
v3 updates:
- add reviewed-by tag
v2 updates:
- add function comment
common/board_r.c | 10 +--------- include/post.h | 11 ++++++++++- post/post.c | 4 +++- 3 files changed, 14 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 +10 -1
@@ -107,7 +107,6 @@ 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_run (char *name,int flags);int post_info (char *name);int post_log (char *format, ...);
@@ -116,6 +115,16 @@ void post_reloc (void);#endif unsigned long post_time_ms (unsigned long base); +/** +* post_output_backlog() - Print POST results +* +* Print POST results during the generic board init sequence, after +* relocation. +* +* Return: 0 if OK +*/ +int post_output_backlog (void ); +extern struct post_test post_list[];extern unsigned int post_list_size;extern int post_hotkeys_pressed (void );
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 v4 8/18 common: board_r: Drop initr_post_backlog wrapper
Quoted 5 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]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210116/4a82ae05/attachment.sig>
PATCH v4 9/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.
---
v4 updates:
- none
v3 updates:
- add reviewed-by tag
v2 updates:
- add function comment
common/board_r.c | 11 +---------- drivers/pci_endpoint/pci_ep-uclass.c | 4 +++- include/init.h | 10 +++++++++- 3 files changed, 13 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 +9 -1
@@ -177,6 +177,15 @@ int setup_bdinfo(void);*/ int cpu_secondary_init_r (void ); +/** +* pci_ep_init() - Initialize pci endpoint devices +* +* It is called during the generic post-relocation init sequence. +* +* Return: 0 if OK +*/ +int pci_ep_init (void ); +/** * init_cache_f_r() - Turn on the cache in preparation for relocation *
@@ -249,7 +258,6 @@ 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 misc_init_r (void );#if defined(CONFIG_VID )int init_func_vid (void );
Signature · 1 line
2.17.1
PATCH v4 9/18 common: board_r: Drop initr_pci_ep wrapper
Quoted 5 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]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210116/e91fbf40/attachment.sig>
PATCH v4 10/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.
---
v4 updates:
- none
v3 updates:
- add reviewed-by tag
v2 updates:
- add function comment
common/board_r.c | 18 ++++-------------- drivers/pci/pci-uclass.c | 4 +++- drivers/pci/pci.c | 6 ++++-- include/init.h | 13 ++++++++++++- 4 files changed, 23 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 +12 -1
@@ -186,6 +186,18 @@ int cpu_secondary_init_r(void);*/ int pci_ep_init (void ); +/** +* pci_init() - Enumerate pci devices +* +* It is called during the generic post-relocation init sequence to enumerate +* pci buses. This is needed, for instance, in the case of DM PCI-based +* Ethernet devices, which will not be detected without having the enumeration +* performed earlier. +* +* Return: 0 if OK +*/ +int pci_init (void ); +/** * init_cache_f_r() - Turn on the cache in preparation for relocation *
@@ -257,7 +269,6 @@ 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 misc_init_r (void );#if defined(CONFIG_VID )int init_func_vid (void );
Signature · 1 line
2.17.1
PATCH v4 10/18 common: board_r: Drop initr_pci wrapper
Quoted 5 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]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210116/1e32e9bf/attachment.sig>
PATCH v4 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.
---
v4 updates:
- none
v3 updates:
- add reviewed-by tag
v2 updates:
- add function comment
arch/arm/include/asm/system.h | 13 ++++++++++++- arch/arm/lib/cache.c | 4 +++- common/board_r.c | 10 +--------- 3 files changed, 16 insertions(+), 11 deletions(-)
arch/arm/include/asm/system.h +12 -1
@@ -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 */
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
@@ -242,14 +242,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 )) {
@@ -668,7 +660,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 v4 11/18 common: board_r: Drop initr_noncached wrapper
Quoted 5 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]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210116/07fb989e/attachment.sig>
PATCH v4 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.
---
v4 updates:
- none
v3 updates:
- none
v2 updates:
- add reviewed-by tag
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
@@ -428,14 +428,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 ) {
@@ -743,7 +735,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 v4 12/18 common: board_r: Drop initr_xen wrapper
Quoted 5 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]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210116/12496ef5/attachment.sig>
PATCH v4 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.
---
v4 updates:
- none
v3 updates:
- add reviewed-by tag
v2 updates:
- add function comment
common/board_r.c | 8 +------- common/exports.c | 4 +++- include/exports.h | 10 ++++++++-- 3 files changed, 12 insertions(+), 10 deletions(-)
common/board_r.c +1 -7
@@ -490,12 +490,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 ) {
@@ -757,7 +751,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 +8 -2
@@ -15,8 +15,14 @@struct cmd_tbl ;struct spi_slave ; -/* Set up the jump table for use by the API */ -void jumptable_init (void ); +/** +* jumptable_init() - Set up the jump table for use by the API +* +* It is called during the generic post-relocation init sequence. +* +* Return: 0 if OK +*/ +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 v4 13/18 common: board_r: Drop initr_jumptable wrapper
Quoted 5 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]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210116/289770df/attachment.sig>
PATCH v4 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.
---
v4 updates:
- none
v3 updates:
- add reviewed-by tag
v2 updates:
- add function comment
api/api.c | 6 ++++-- api/api_private.h | 2 +- common/board_r.c | 11 +---------- include/api.h | 10 +++++++++- 4 files changed, 15 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
@@ -490,15 +490,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 ) {
@@ -753,7 +744,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 +9 -1
@@ -7,6 +7,14 @@#ifndef __API_H#define __API_H -void api_init (void ); +/** +* api_init() - Initialize API for external applications +* +* Initialize API for external (standalone) applications running on top of +* U-Boot. It is called during the generic post-relocation init sequence. +* +* Return: 0 if OK +*/ +int api_init (void );#endif
Signature · 1 line
2.17.1
PATCH v4 14/18 common: board_r: Drop initr_api wrapper
Quoted 5 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]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210116/b1ab2f06/attachment.sig>
PATCH v4 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.
---
v4 updates:
- none
v3 updates:
- add reviewed-by tag
v2 updates:
- add function comment
common/board_r.c | 10 +--------- drivers/net/phy/miiphybb.c | 4 +++- include/miiphy.h | 10 +++++++++- 3 files changed, 13 insertions(+), 11 deletions(-)
common/board_r.c +1 -9
@@ -534,14 +534,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 ) {
@@ -783,7 +775,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 +9 -1
@@ -81,7 +81,15 @@ struct bb_miiphy_bus {extern struct bb_miiphy_bus bb_miiphy_buses[];extern int bb_miiphy_buses_num; -void bb_miiphy_init (void ); +/** +* bb_miiphy_init() - Initialize bit-banged MII bus driver +* +* It is called during the generic post-relocation init sequence. +* +* Return: 0 if OK +*/ +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 v4 15/18 common: board_r: Drop initr_bbmii wrapper
Quoted 5 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]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210116/7a8257e8/attachment.sig>
PATCH v4 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.
---
v4 updates:
- Drop trap_init declaration from init.h and make arch-specific implementations static for mips and m68k (on powerpc trap_init is an asm routine)
v3 updates:
- none
v2 updates:
- add reviewed-by tag
arch/m68k/lib/traps.c | 9 ++++++++- arch/mips/lib/traps.c | 9 ++++++++- arch/powerpc/lib/Makefile | 1 + arch/powerpc/lib/traps.c | 19 +++++++++++++++++++ common/board_r.c | 16 ++-------------- include/init.h | 10 +++++++++- 6 files changed, 47 insertions(+), 17 deletions(-) create mode 100644 arch/powerpc/lib/traps.c
arch/m68k/lib/traps.c +8 -1
@@ -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 ; +}
arch/mips/lib/traps.c +8 -1
@@ -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 ; +}
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 +19 -0
@@ -0,0 +1,19 @@ +// 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 ; + +void trap_init (unsigned long reloc_addr); + +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 #ifdef CONFIG_ADDR_MAP static int initr_addr_map (void )
@@ -669,9 +659,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 initr_addr_map,#endif
include/init.h +9 -1
@@ -300,7 +300,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 ); -void trap_init (unsigned long reloc_addr); +/** +* 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 );/** * main_loop() - Enter the main loop of U-Boot
Signature · 1 line
2.17.1
PATCH v4 16/18 common: board_r: Drop arch-specific ifdefs around initr_trap
Am Samstag, den 28.11.2020, 10:43 +0200 schrieb Ovidiu Panait:
Quoted 20 lines
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]>Reviewed-by Simon Glass <[email protected]>---
v4 updates:
- Droptrap_initdeclaration frominit.hand make arch-specific implementations static for mips and m68k (on powerpctrap_initis an asm routine)v3 updates:
- nonev2 updates:
- add reviewed-by tag
Quoted 10 lines
arch/m68k/lib/traps.c | 9 ++++++++- arch/mips/lib/traps.c | 9 ++++++++- arch/powerpc/lib/Makefile | 1 + arch/powerpc/lib/traps.c | 19 +++++++++++++++++++ common/board_r.c | 16 ++-------------- include/init.h | 10 +++++++++- 6 files changed, 47 insertions(+), 17 deletions(-) create mode 100644 arch/powerpc/lib/traps.c
Signature · 1 line
- Daniel
PATCH v4 16/18 common: board_r: Drop arch-specific ifdefs around initr_trap
In reply to Ovidiu PanaitQuoted 9 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]>Reviewed-by Simon Glass <[email protected]>Reviewed-by Daniel Schwierzeck <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210116/ba6d5056/attachment.sig>
PATCH v4 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,
^~
---
v4 updates:
- none
v3 updates:
- none
v2 updates:
- add reviewed-by tag
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 v4 17/18 spl: Kconfig: Add SPL dependency to CONFIG_HANDOFF
Quoted 5 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:
Quoted 8 lines
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,^~Signed-off-by Ovidiu Panait <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210116/b28271b9/attachment.sig>
PATCH v4 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.
---
v4 updates:
- none
v3 updates:
- none
v2 updates:
- add reviewed-by tag
include/asm-generic/global_data.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/asm-generic/global_data.h +2 -2
@@ -400,12 +400,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 v4 18/18 global_data: Enable spl_handoff only if CONFIG_HANDOFF is set
Quoted 5 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]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210116/0ca4b05c/attachment.sig>