[U-Boot] [PATCH 2/2] mx6: Rework s_init to be spl_board_init() and gate_ungate_all_mx6_pfds()

Tom Rini trini at ti.com
Wed Feb 11 01:07:23 CET 2015


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.

Cc: Marek Vasut <marex at denx.de>
Cc: Stefano Babic <sbabic at denx.de>
Cc: Igor Grinberg <grinberg at compulab.co.il>
Cc: Nikita Kiryanov <nikita at compulab.co.il>
Signed-off-by: Tom Rini <trini at ti.com>
---
 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(-)

diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c
index 5f5f497..ecc4272 100644
--- a/arch/arm/cpu/armv7/mx6/soc.c
+++ b/arch/arm/cpu/armv7/mx6/soc.c
@@ -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)
 {
diff --git a/arch/arm/include/asm/arch-mx6/crm_regs.h b/arch/arm/include/asm/arch-mx6/crm_regs.h
index 39f3c07..700175e 100644
--- a/arch/arm/include/asm/arch-mx6/crm_regs.h
+++ b/arch/arm/include/asm/arch-mx6/crm_regs.h
@@ -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 */
diff --git a/board/compulab/cm_fx6/spl.c b/board/compulab/cm_fx6/spl.c
index 5b4b76f..83be867 100644
--- a/board/compulab/cm_fx6/spl.c
+++ b/board/compulab/cm_fx6/spl.c
@@ -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)
diff --git a/include/configs/imx6_spl.h b/include/configs/imx6_spl.h
index 1b9c277..d49370d 100644
--- a/include/configs/imx6_spl.h
+++ b/include/configs/imx6_spl.h
@@ -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
-- 
1.7.9.5



More information about the U-Boot mailing list