spl_atmel.c: Switch s_init to board_init_f
PATCH 1/2 spl_atmel.c: Switch s_init to board_init_f
To facilitate changing lowlevel_init to become s_init, move the current contents of s_init into board_init_f and add the rest of what board_init_f does here.
--- arch/arm/cpu/at91-common/spl_atmel.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
arch/arm/cpu/at91-common/spl_atmel.c +6 -1
@@ -58,7 +58,7 @@ static void switch_to_main_crystal_osc(void)writel (tmp, &pmc->mor); } -void s_init (void ) +void board_init_f (ulong dummy) {switch_to_main_crystal_osc ();
@@ -77,4 +77,9 @@ void s_init(void)preloader_console_init ();mem_init (); + +/* Clear the BSS. */ +memset (__bss_start,0 , __bss_end - __bss_start); + +board_init_r (NULL ,0 ); }
Signature · 1 line
1.7.9.5
PATCH 2/2 mx6: Rework s_init to be spl_board_init() and gate_ungate_all_mx6_pfds()
To facilitate changing lowlevel_init to become s_init, move the current contents of s_int() to gate_ungate_all_mx6_pfds() (and add extern to arch/arm/include/asm/arch-mx6/crm_regs.h) and add a default weak spl_board_init() that calls this function. The cm_fx6 platform already has a spl_board_init() so make that call the new function as well.
--- arch/arm/cpu/armv7/mx6/soc.c | 7 ++++++- arch/arm/include/asm/arch-mx6/crm_regs.h | 2 ++ board/compulab/cm_fx6/spl.c | 2 ++ include/configs/imx6_spl.h | 1 + 4 files changed, 11 insertions(+), 1 deletion(-)
arch/arm/cpu/armv7/mx6/soc.c +6 -1
@@ -385,7 +385,7 @@ const struct boot_mode soc_boot_modes[] = { {NULL, 0}, }; -void s_init (void ) +void gate_ungate_all_mx6_pfds (void ) {struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR ;struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR ;
@@ -429,6 +429,11 @@ void s_init(void)writel (mask528, &anatop->pfd_528_clr); } +void __weak spl_board_init (void ) +{ +gate_ungate_all_mx6_pfds (); +} +#ifdef CONFIG_IMX_HDMI void imx_enable_hdmi_phy (void ) {
arch/arm/include/asm/arch-mx6/crm_regs.h +2 -0
@@ -104,6 +104,8 @@ struct mxc_ccm_reg {u32 analog_pfd_528_clr; u32 analog_pfd_528_tog; }; + +void gate_ungate_all_mx6_pfds (void );#endif /* Define the bits in register CCR */
board/compulab/cm_fx6/spl.c +2 -0
@@ -341,6 +341,8 @@ void spl_board_init(void) {u32 boot_device =spl_boot_device (); +gate_ungate_all_mx6_pfds (); +if (boot_device ==BOOT_DEVICE_SPI )puts ("Booting from SPI flash\n" );else if (boot_device ==BOOT_DEVICE_MMC1 )
include/configs/imx6_spl.h +1 -0
@@ -29,6 +29,7 @@#define CONFIG_SPL_TEXT_BASE 0x00908000#define CONFIG_SPL_MAX_SIZE 0x10000#define CONFIG_SPL_STACK 0x0091FFB8 +#define CONFIG_SPL_BOARD_INIT #define CONFIG_SPL_LIBCOMMON_SUPPORT #define CONFIG_SPL_LIBGENERIC_SUPPORT #define CONFIG_SPL_SERIAL_SUPPORT
Signature · 1 line
1.7.9.5
PATCH 2/2 mx6: Rework s_init to be spl_board_init() and gate_ungate_all_mx6_pfds()
Quoted 11 lines · Tom Rini
To facilitate changing
lowlevel_initto becomes_init, move the current contents ofs_int()togate_ungate_all_mx6_pfds()(and add extern toarch/arm/include/asm/arch-mx6/crm_regs.h) and add a default weakspl_board_init()that calls this function. Thecm_fx6platform already has aspl_board_init()so make that call the new function as well.Cc Marek Vasut <[email protected]>Cc Stefano Babic <[email protected]>Cc Igor Grinberg <[email protected]>Cc Nikita Kiryanov <[email protected]>Signed-off-by Tom Rini <[email protected]>
Best regards,
Marek Vasut
PATCH 2/2 mx6: Rework s_init to be spl_board_init() and gate_ungate_all_mx6_pfds()
In reply to Tom RiniQuoted 11 lines · Tom Rini
To facilitate changing
lowlevel_initto becomes_init, move the current contents ofs_int()togate_ungate_all_mx6_pfds()(and add extern toarch/arm/include/asm/arch-mx6/crm_regs.h) and add a default weakspl_board_init()that calls this function. Thecm_fx6platform already has aspl_board_init()so make that call the new function as well.Cc Marek Vasut <[email protected]>Cc Stefano Babic <[email protected]>Cc Igor Grinberg <[email protected]>Cc Nikita Kiryanov <[email protected]>Signed-off-by Tom Rini <[email protected]>
Signature · 2 lines
Regards, Igor.
PATCH 2/2 mx6: Rework s_init to be spl_board_init() and gate_ungate_all_mx6_pfds()
In reply to Tom RiniQuoted 75 lines · Tom Rini
To facilitate changing
lowlevel_initto becomes_init, move the current contents ofs_int()togate_ungate_all_mx6_pfds()(and add extern toarch/arm/include/asm/arch-mx6/crm_regs.h) and add a default weakspl_board_init()that calls this function. Thecm_fx6platform already has aspl_board_init()so make that call the new function as well.Cc Marek Vasut <[email protected]>Cc Stefano Babic <[email protected]>Cc Igor Grinberg <[email protected]>Cc Nikita Kiryanov <[email protected]>Signed-off-by Tom Rini <[email protected]>--- arch/arm/cpu/armv7/mx6/soc.c | 7 ++++++- arch/arm/include/asm/arch-mx6/crm_regs.h | 2 ++ board/compulab/cm_fx6/spl.c | 2 ++ include/configs/imx6_spl.h | 1 + 4 files changed, 11 insertions(+), 1 deletion(-)arch/arm/cpu/armv7/mx6/soc.c +6
-1@@ -385,7 +385,7 @@ const struct boot_mode soc_boot_modes[] = { {NULL, 0}, }; -void s_init (void ) +void gate_ungate_all_mx6_pfds (void ) {struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR ;struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR ;@@ -429,6 +429,11 @@ void s_init(void)writel (mask528, &anatop->pfd_528_clr); } +void __weak spl_board_init (void ) +{ +gate_ungate_all_mx6_pfds (); +} +#ifdef CONFIG_IMX_HDMI void imx_enable_hdmi_phy (void ) {arch/arm/include/asm/arch-mx6/crm_regs.h +2
-0@@ -104,6 +104,8 @@ struct mxc_ccm_reg {u32 analog_pfd_528_clr; u32 analog_pfd_528_tog; }; + +void gate_ungate_all_mx6_pfds (void );#endif /* Define the bits in register CCR */ board/compulab/cm_fx6/spl.c +2
-0@@ -341,6 +341,8 @@ void spl_board_init(void) {u32 boot_device =spl_boot_device (); +gate_ungate_all_mx6_pfds (); +if (boot_device ==BOOT_DEVICE_SPI )puts ("Booting from SPI flash\n" );else if (boot_device ==BOOT_DEVICE_MMC1 )include/configs/imx6_spl.h +0
-0
include/configs/imx6_spl.h line 35
Quoted 7 lines
include/configs/imx6_spl.h +1
-0@@ -29,6 +29,7 @@#define CONFIG_SPL_TEXT_BASE 0x00908000#define CONFIG_SPL_MAX_SIZE 0x10000#define CONFIG_SPL_STACK 0x0091FFB8 +#define CONFIG_SPL_BOARD_INIT #define CONFIG_SPL_LIBCOMMON_SUPPORT #define CONFIG_SPL_LIBGENERIC_SUPPORT #define CONFIG_SPL_SERIAL_SUPPORT
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH 1/2 spl_atmel.c: Switch s_init to board_init_f
In reply to Tom RiniHi Tom,
rebased and tried to apply, but unfortuantely this breaks SPL for at91 armv7 boards:
05: spl_atmel.c: Switch s_init to board_init_f
arm: + sama5d3xek_mmc sama5d3xek_nandflash sama5d3xek_spiflashsama5d4_xplained_mmc sama5d4ek_nandflash +arch/arm/cpu/armv7/built-in.o: In function `lowlevel_init':+build/../arch/arm/cpu/armv7/lowlevel_init.S:57: undefined reference to `s_init'
+make[2]: *** [spl/u-boot-spl] Error 1
+make[1]: *** [spl/u-boot-spl] Error 2
+make: *** [sub-make] Error 2
I have to provide an empty s_init() to compile cleanly. Are you fine with just adopting your patch or would you like to repost?
Andreas
Quoted 36 lines · Tom Rini
To facilitate changing
lowlevel_initto becomes_init, move the current contents ofs_initintoboard_init_fand add the rest of whatboard_init_fdoes here.Cc Bo Shen <[email protected]>Cc Andreas Bie?mann <[email protected]>Signed-off-by Tom Rini <[email protected]>--- arch/arm/cpu/at91-common/spl_atmel.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)arch/arm/cpu/at91-common/spl_atmel.c +6
-1@@ -58,7 +58,7 @@ static void switch_to_main_crystal_osc(void)writel (tmp, &pmc->mor); } -void s_init (void ) +void board_init_f (ulong dummy) {switch_to_main_crystal_osc ();@@ -77,4 +77,9 @@ void s_init(void)preloader_console_init ();mem_init (); + +/* Clear the BSS. */ +memset (__bss_start,0 , __bss_end - __bss_start); + +board_init_r (NULL ,0 ); }
PATCH 1/1 spl_atmel.c: Switch s_init to board_init_f
In reply to Tom RiniDear Tom Rini,
Quoted 12 lines · Tom Rini
To facilitate changing
lowlevel_initto becomes_init, move the current contents ofs_initintoboard_init_fand add the rest of whatboard_init_fdoes here.
In order to compile clean withoutCONFIG_SKIP_LOWLEVEL_INITset, leave an empty stub ofs_init(). It can be removed whenlowlevel_initbecomess_init.Cc Bo Shen <[email protected]>Cc Andreas Bie?mann <[email protected]>Signed-off-by Tom Rini <[email protected]>[rebased on current master, leave s_init() as empty stub]Signed-off-by Andreas Bie?mann <[email protected]>
Quoted 3 lines
---
arch/arm/mach-at91/spl_atmel.c| 7 ++++++-1 file changed, 6 insertions(+), 1 deletion(-)
applied a rebased and slightly modified version to u-boot-atmel/master, thanks!
Best regards,
Andreas Bie?mann
PATCH 1/1 spl_atmel.c: Switch s_init to board_init_f
In reply to Tom RiniDear Tom Rini,
Quoted 12 lines · Tom Rini
To facilitate changing
lowlevel_initto becomes_init, move the current contents ofs_initintoboard_init_fand add the rest of whatboard_init_fdoes here.
In order to compile clean withoutCONFIG_SKIP_LOWLEVEL_INITset, leave an empty stub ofs_init(). It can be removed whenlowlevel_initbecomess_init.Cc Bo Shen <[email protected]>Cc Andreas Bie?mann <[email protected]>Signed-off-by Tom Rini <[email protected]>[rebased on current master, leave s_init() as empty stub]Signed-off-by Andreas Bie?mann <[email protected]>
Quoted 3 lines
---
arch/arm/mach-at91/spl_atmel.c| 7 ++++++-1 file changed, 6 insertions(+), 1 deletion(-)
applied a rebased and slightly modified version to u-boot-atmel/master, thanks!
Best regards,
Andreas Bie?mann