[PATCH v3 1/2] cpufreq: spacemit: Add K1 cpufreq driver
Shuwei Wu
shuwei.wu at mailbox.org
Sun Jun 14 23:12:06 PDT 2026
Hi Viresh,
Thanks for your reply.
On Mon Jun 15, 2026 at 1:24 PM CST, Viresh Kumar wrote:
> On 12-06-26, 17:51, Shuwei Wu wrote:
>> K1 has two CPU cluster clocks but one shared CPU voltage rail. Use one
>> cpufreq policy for all CPUs, let the OPP core handle the shared regulator
>> and the cluster0 clock, and update the cluster1 clock explicitly.
>
> If the clusters can do DVFS individually (as they have separate clocks), this
> should be represented as two separate policies. Isn't it ?
The clusters have separate clocks, but they share the same voltage supply.[1]
So two independent policies would be unsafe: one policy could lower the shared
voltage while the other cluster is still running at a higher frequency.
This means they can't use different policies.
>From a hardware perspective, the eight cores of the K1 are homogeneous,
so using the same policy for them is relatively reasonable.
I used a K1-specific driver because cpufreq-dt only manages one CPU clock
through the CPU device used for the OPP transition.
On K1, the policy needs to control two independent cluster clocks and one shared
regulator, so the driver has to update the second cluster clock explicitly and
keep the ordering safe: raise voltage before raising either cluster, and lower
both cluster clocks before lowering the shared voltage.
[1] https://lore.kernel.org/spacemit/aeaXszeaE62rM6BJ@aurel32.net/
--
Best regards,
Shuwei Wu
More information about the linux-riscv
mailing list