Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
fork

Configure Feed

Select the types of activity you want to include in your feed.

clk: sunxi-ng: h6: Fix default PLL GPU rate

In commit 4167ac8a657e ("clk: sunxi-ng: sun50i: h6: Modify GPU clock
configuration to support DFS") divider M0 was forced to be 1 in order to
support DFS. However, that left N as it is, at high value of 36. On
boards without devfreq enabled (all of them in kernel 6.0), this
effectively sets GPU frequency to 864 MHz. This is about 100 MHz above
maximum supported frequency.

In order to fix this, let's set N to 18 (register value 17). That way
default frequency of 432 MHz is preserved.

Fixes: 4167ac8a657e ("clk: sunxi-ng: sun50i: h6: Modify GPU clock configuration to support DFS")
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://lore.kernel.org/r/20220928200122.3963509-1-jernej.skrabec@gmail.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

Jernej Skrabec and committed by
Stephen Boyd
4014e916 b1ff1bfe

+6 -2
+6 -2
drivers/clk/sunxi-ng/ccu-sun50i-h6.c
··· 1191 1191 if (IS_ERR(reg)) 1192 1192 return PTR_ERR(reg); 1193 1193 1194 - /* Force PLL_GPU output divider bits to 0 */ 1194 + /* 1195 + * Force PLL_GPU output divider bits to 0 and adjust 1196 + * multiplier to sensible default value of 432 MHz. 1197 + */ 1195 1198 val = readl(reg + SUN50I_H6_PLL_GPU_REG); 1196 - val &= ~BIT(0); 1199 + val &= ~(GENMASK(15, 8) | BIT(0)); 1200 + val |= 17 << 8; 1197 1201 writel(val, reg + SUN50I_H6_PLL_GPU_REG); 1198 1202 1199 1203 /* Force GPU_CLK divider bits to 0 */