[PATCH 4/4] cpufreq: add an Amlogic speed-bin driver

Chuan Liu chuan.liu at amlogic.com
Thu Nov 26 01:49:26 PST 2026


Hi Viresh,

Thanks for your reply.

On 11/26/2026 1:10 PM, Viresh Kumar wrote:
> [ EXTERNAL EMAIL ]
> 
> On 23-11-26, 20:23, Chuan Liu wrote:
>> I have already completed the support on A9, but cpufreq-dt currently only
>> supports the single-clock case, for example:
>> dt_cpufreq_early_init()
>>    ->dev_pm_opp_init_cpufreq_table()
>>      ->dev_pm_opp_find_freq_ceil()
>>        ->_find_key_ceil()
>>          ->assert_single_clk()
>>
>> set_target()
>>    ->dev_pm_opp_set_rate()
>>      ->_find_freq_ceil()
>>        ->assert_single_clk()
>>
>> Both of the interfaces above are limited to "single_clk", so SoCs that need
>> to adjust the DSU clock in coordination with the CPU clock (such as SM1, S7,
>> A9, etc. mentioned above) cannot directly work on top of cpufreq-dt.
> 
> Have you tried something like this ?

Yes, as shown in this patch [1], I forced the above two 
"assert_single_clk()" to "assert_clk_index()" and it worked.

> 
> drivers/ufs/core/ufshcd.c:int ufshcd_opp_config_clks(struct device *dev, struct opp_table *opp_table,
> 
> Finding the right OPP should be done based on the primary clock only (right ?),

Yes, I took a look at the ufshcd.c:int ufshcd_opp_config_clks(), which 
is similar to ours, where the Amlogic A9 cpufreq needs to manage 2 clocks:
   - CPU clock
   - DSU clock

The Amlogic A9 need to match and set the frequency of DSU clock based on 
the frequency of CPU clock (primary clock). The opp-table is defined 
like this [2].

> but configuring multiple clocks is possible via the OPP core.

Yes, currently OPP core supports managing multiple clocks, but it seems 
that cpufreq-dt does not support.

For your opinion on this situation, you would prefer cpufreq-dt to add 
support for multiple clocks, or add a new Amlogic cpufreq_driver 
(directly base on OPP core) independent of cpufreq-dt?


[1] 
https://github.com/chuan-aml/linux/commit/aab760f8f2de732aa997aa0d1d752b6b5f284880#diff-61bacca23d8a12c4b91049198f76c77a145795446fb9c18d0c64cf18491f5d35
[2] 
https://github.com/chuan-aml/linux/commit/aab760f8f2de732aa997aa0d1d752b6b5f284880#diff-333a52bc56bdbaa937ff052164a781fdb456178ad6f313c5bee322e790b6baea

> 
> --
> viresh

-- 
Best regards,
Chuan




More information about the linux-arm-kernel mailing list