summaryrefslogtreecommitdiff
path: root/drivers/clk/thead
AgeCommit message (Collapse)Author
2025-09-19clk: thead: th1520-ap: Mark drivers as DM_FLAG_PRE_RELOCYao Zi
It's common that UARTs are bound and probed before U-Boot relocation, in which case the clocks of UART and UART's pincontroller must be registered first. Let's apply DM_FLAG_PRE_RELOC to the driver, allowing it to bind before relocation. Signed-off-by: Yao Zi <[email protected]> Reviewed-by: Leo Yu-Chi Liang <[email protected]>
2025-07-17clk: thead: th1520-ap: Correctly handle flags for dividersYao Zi
Unlike the gate clocks which make no use of flags, most dividers in TH1520 SoC are one-based, thus are applied with CLK_DIVIDER_ONE_BASED flag. We couldn't simply ignore the flag, which causes wrong results when calculating the clock rates. Add a member to ccu_div_internal for defining the flags, and pass it to divider_recalc_rate(). With this fix, frequency of all the clocks match the Linux kernel's calculation. Fixes: e6bfa6fc94f ("clk: thead: Port clock controller driver of TH1520 SoC") Signed-off-by: Yao Zi <[email protected]> Acked-by: Leo Yu-Chi Liang <[email protected]>
2025-05-21clk: thead: Port clock controller driver of TH1520 SoCYao Zi
The driver is adapted from Linux kernel's version of clk-th1520-ap.c, with only output clocks for external sensors, which are barely useful in bootloaders, removed. Same as the mainline driver, it currently lacks of ability to enable and reconfigure PLLs, which could be implemented later. Signed-off-by: Yao Zi <[email protected]> Reviewed-by: Leo Yu-Chi Liang <[email protected]>