From 412a6f39737c01f2320e3ff8bc7aad7a8e2139ab Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Tue, 27 Aug 2024 22:04:27 +0200 Subject: [PATCH] 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; } ``` Signed-off-by: Marek Vasut --- arch/arm/mach-imx/imx8m/clock_imx8mm.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/imx8m/clock_imx8mm.c b/arch/arm/mach-imx/imx8m/clock_imx8mm.c index de630e940c..d7fd102c95 100644 --- a/arch/arm/mach-imx/imx8m/clock_imx8mm.c +++ b/arch/arm/mach-imx/imx8m/clock_imx8mm.c @@ -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: -- 2.39.5