Skip to contentSkip to conversation

ARM: imx: Make PLL settings configurable at board level

PATCH Applied Marek Vasut 2 participants 2 messages Aug 27, 2024 – Sep 2, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: imx: Make PLL settings configurable at board level

Staticize intpll_configure(). Add weak board_imx_intpll_override() function which can be defined at board level to override specific PLL frequency settings early during boot. This can be used to for example force faster CPU core clock frequency if the hardware can handle it.

Example of increasing CPU core clock to 1600 MHz on i.MX8M Plus:

```
int board_imx_intpll_override(enum pll_clocks pll, ulong *freq)
{
       if (pll == ANATOP_ARM_PLL)
               *freq = MHZ(1600);
       return 0;
}
```

---
Cc: "NXP i.MX U-Boot Team" <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Peng Fan <[email protected]>
Cc: Stefano Babic <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: [email protected]

---
 arch/arm/mach-imx/imx8m/clock_imx8mm.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
arch/arm/mach-imx/imx8m/clock_imx8mm.c +10 -1
index de630e940c9..d7fd102c955 100644
@@ -181,10 +181,19 @@ void dram_disable_bypass(void)
 }
 #endif
 
-int intpll_configure(enum pll_clocks pll, ulong freq)
+__weak int board_imx_intpll_override(enum pll_clocks pll, ulong *freq)
+{
+	return 0;
+}
+
+static int intpll_configure(enum pll_clocks pll, ulong freq)
 {
 	void __iomem *pll_gnrl_ctl, __iomem *pll_div_ctl;
 	u32 pll_div_ctl_val, pll_clke_masks;
+	int ret = board_imx_intpll_override(pll, &freq);
+
+	if (ret)
+		return ret;
 
 	switch (pll) {
 	case ANATOP_SYSTEM_PLL1:
Signature · 1 line
2.45.2
reviewer Applied
#1 lore raw
Quoted 17 lines · Marek Vasut

Staticize intpll_configure(). Add weak board_imx_intpll_override() function which can be defined at board level to override specific PLL frequency settings early during boot. This can be used to for example force faster CPU core clock frequency if the hardware can handle it.

Example of increasing CPU core clock to 1600 MHz on i.MX8M Plus:

```
int board_imx_intpll_override(enum pll_clocks pll, ulong *freq)
{
       if (pll == ANATOP_ARM_PLL)
               *freq = MHZ(1600);
       return 0;
}
```
Quoted 1 line

Applied, thanks.