diff mbox

[U-Boot] ARM: mxs: allow boards to select DC-DC switching clock source

Message ID 1449696646-13930-1-git-send-email-mhei@heimpold.de
State Changes Requested
Delegated to: Stefano Babic
Headers show

Commit Message

Michael Heimpold Dec. 9, 2015, 9:30 p.m. UTC
For some board designs, it might be useful to switch the DC-DC
clock source to something else rather the default 24 MHz, e.g.
for EMI reasons.

For this, use something like this in your board configuration:

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
Cc: Marek Vasut <marex@denx.de>
Cc: Otavio Salvador <otavio@ossystems.com.br>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
---

I'm not sure whether the position to set these bits is the best one.

Regards,
Michael

 arch/arm/cpu/arm926ejs/mxs/spl_power_init.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Fabio Estevam Dec. 9, 2015, 9:33 p.m. UTC | #1
Hi Michael,

On Wed, Dec 9, 2015 at 7:30 PM, Michael Heimpold <mhei@heimpold.de> wrote:
> For some board designs, it might be useful to switch the DC-DC
> clock source to something else rather the default 24 MHz, e.g.
> for EMI reasons.
>
> For this, use something like this in your board configuration:

It seems you missed to complete the text here.
Marek Vasut Dec. 9, 2015, 9:35 p.m. UTC | #2
On Wednesday, December 09, 2015 at 10:30:46 PM, Michael Heimpold wrote:
> For some board designs, it might be useful to switch the DC-DC
> clock source to something else rather the default 24 MHz, e.g.
> for EMI reasons.
> 
> For this, use something like this in your board configuration:
> 
> Signed-off-by: Michael Heimpold <mhei@heimpold.de>
> Cc: Marek Vasut <marex@denx.de>
> Cc: Otavio Salvador <otavio@ossystems.com.br>
> Cc: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> 
> I'm not sure whether the position to set these bits is the best one.

Can we do it without the ifdef ? I don't like that at all. You can
probably use a weak function instead.

Best regards,
Marek Vasut
diff mbox

Patch

diff --git a/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c b/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c
index 1972de8..410cf0b 100644
--- a/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c
+++ b/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c
@@ -260,6 +260,15 @@  static void mxs_src_power_init(void)
 
 	debug("SPL: Pre-Configuring power block\n");
 
+#ifdef CONFIG_SYS_MXS_DCDC_FREQSEL
+	/* Select clocksource for DC-DC converter */
+	clrsetbits_le32(&power_regs->hw_power_misc,
+			POWER_MISC_FREQSEL_MASK,
+			CONFIG_SYS_MXS_DCDC_FREQSEL);
+	setbits_le32(&power_regs->hw_power_misc,
+			POWER_MISC_SEL_PLLCLK);
+#endif
+
 	/* Improve efficieny and reduce transient ripple */
 	writel(POWER_LOOPCTRL_TOGGLE_DIF | POWER_LOOPCTRL_EN_CM_HYST |
 		POWER_LOOPCTRL_EN_DF_HYST, &power_regs->hw_power_loopctrl_set);