ARM: mxs: allow boards to select DC-DC switching clock source
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, override the mxs_power_setup_dcdc_clocksource function in your board support files. Example: void mxs_power_setup_dcdc_clocksource(void) { mxs_power_switch_dcdc_clocksource(POWER_MISC_FREQSEL_20MHZ); } 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> Acked-by: Marek Vasut <marex@denx.de>
This commit is contained in:
parent
a1ed155298
commit
fe21eaf92d
@ -247,6 +247,39 @@ static void mxs_power_setup_5v_detect(void)
|
|||||||
POWER_5VCTRL_PWRUP_VBUS_CMPS);
|
POWER_5VCTRL_PWRUP_VBUS_CMPS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mxs_power_switch_dcdc_clocksource() - Switch PLL clock for DC-DC converters
|
||||||
|
* @freqsel: One of the POWER_MISC_FREQSEL_xxx defines to select the clock
|
||||||
|
*
|
||||||
|
* This function configures and then enables an alternative PLL clock source
|
||||||
|
* for the DC-DC converters.
|
||||||
|
*/
|
||||||
|
void mxs_power_switch_dcdc_clocksource(uint32_t freqsel)
|
||||||
|
{
|
||||||
|
struct mxs_power_regs *power_regs =
|
||||||
|
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||||
|
|
||||||
|
/* Select clocksource for DC-DC converters */
|
||||||
|
clrsetbits_le32(&power_regs->hw_power_misc,
|
||||||
|
POWER_MISC_FREQSEL_MASK,
|
||||||
|
freqsel);
|
||||||
|
setbits_le32(&power_regs->hw_power_misc,
|
||||||
|
POWER_MISC_SEL_PLLCLK);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mxs_power_setup_dcdc_clocksource() - Setup PLL clock source for DC-DC converters
|
||||||
|
*
|
||||||
|
* Normally, there is no need to switch DC-DC clocksource. This is the reason,
|
||||||
|
* why this function is a stub and does nothing. However, boards can implement
|
||||||
|
* this function when required and call mxs_power_switch_dcdc_clocksource() to
|
||||||
|
* switch to an alternative clock source.
|
||||||
|
*/
|
||||||
|
__weak void mxs_power_setup_dcdc_clocksource(void)
|
||||||
|
{
|
||||||
|
debug("SPL: Using default DC-DC clocksource\n");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* mxs_src_power_init() - Preconfigure the power block
|
* mxs_src_power_init() - Preconfigure the power block
|
||||||
*
|
*
|
||||||
@ -872,6 +905,7 @@ static void mxs_power_configure_power_source(void)
|
|||||||
|
|
||||||
debug("SPL: Configuring power source\n");
|
debug("SPL: Configuring power source\n");
|
||||||
|
|
||||||
|
mxs_power_setup_dcdc_clocksource();
|
||||||
mxs_src_power_init();
|
mxs_src_power_init();
|
||||||
|
|
||||||
if (readl(&power_regs->hw_power_sts) & POWER_STS_VDD5V_GT_VDDIO) {
|
if (readl(&power_regs->hw_power_sts) & POWER_STS_VDD5V_GT_VDDIO) {
|
||||||
|
@ -25,6 +25,8 @@ int mxsmmc_initialize(bd_t *bis, int id, int (*wp)(int), int (*cd)(int));
|
|||||||
void mxs_common_spl_init(const uint32_t arg, const uint32_t *resptr,
|
void mxs_common_spl_init(const uint32_t arg, const uint32_t *resptr,
|
||||||
const iomux_cfg_t *iomux_setup,
|
const iomux_cfg_t *iomux_setup,
|
||||||
const unsigned int iomux_size);
|
const unsigned int iomux_size);
|
||||||
|
|
||||||
|
void mxs_power_switch_dcdc_clocksource(uint32_t freqsel);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct mxs_pair {
|
struct mxs_pair {
|
||||||
|
Loading…
Reference in New Issue
Block a user