]> git.ipfire.org Git - thirdparty/linux.git/commit
clk: thead: th1520-ap: Support CPU frequency scaling
authorYao Zi <ziyao@disroot.org>
Thu, 20 Nov 2025 13:14:15 +0000 (13:14 +0000)
committerDrew Fustini <fustini@kernel.org>
Thu, 15 Jan 2026 01:26:47 +0000 (17:26 -0800)
commitbaf4fc7c03bd0f68c768cfe27829674bd060c6b4
tree0841e1dbacb4499e9eabe91cecca8010bd1dde95
parent5dbee3503771a36464e0b39a420475a727911c83
clk: thead: th1520-ap: Support CPU frequency scaling

On TH1520 SoC, c910_clk feeds the CPU cluster. It could be glitchlessly
reparented to one of the two PLLs: either to cpu_pll0 indirectly through
c910_i0_clk, or to cpu_pll1 directly.

To achieve glitchless rate change, customized clock operations are
implemented for c910_clk: on rate change, the PLL not currently in use
is configured to the requested rate first, then c910_clk reparents to
it.

Additionally, c910_bus_clk, which in turn takes c910_clk as parent,
has a frequency limit of 750MHz. A clock notifier is registered on
c910_clk to adjust c910_bus_clk on c910_clk rate change.

Reviewed-by: Drew Fustini <fustini@kernel.org>
Signed-off-by: Yao Zi <ziyao@disroot.org>
Signed-off-by: Drew Fustini <fustini@kernel.org>
drivers/clk/thead/clk-th1520-ap.c