From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Babic Date: Wed, 11 Feb 2015 12:15:15 +0100 Subject: [U-Boot] [PATCH 2/2] mx6: Rework s_init to be spl_board_init() and gate_ungate_all_mx6_pfds() In-Reply-To: <1423613243-21114-2-git-send-email-trini@ti.com> References: <1423613243-21114-1-git-send-email-trini@ti.com> <1423613243-21114-2-git-send-email-trini@ti.com> Message-ID: <54DB39C3.5050101@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 11/02/2015 01:07, Tom Rini wrote: > 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 > Cc: Stefano Babic > Cc: Igor Grinberg > Cc: Nikita Kiryanov > Signed-off-by: Tom Rini > --- > 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 > Acked-by: Stefano Babic Best regards, Stefano Babic -- ===================================================================== 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 =====================================================================