CPU frequency regulation for Colibri T30 with Mainline Kernel

Dear Toradex,

We have a Colibri T30 for which we have successfully compiled Mainline Kernel 4.16.6
As soon as we execute our applications, we have temperatures around 93°C (cpu).
I suppose the most efficient way to reduce this would be to reduce CPU frequency. But in our systems the CPU Governor and Frequency commands mentioned here CPU Frequency and DVFS (Linux) do not work. Actually the folder /sys/devices/system/cpu/cpufreq is empty and

here also the output of cpufreq-info:

# cpufreq-info
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  no or unknown cpufreq driver is active on this CPU
analyzing CPU 1:
  no or unknown cpufreq driver is active on this CPU
analyzing CPU 2:
  no or unknown cpufreq driver is active on this CPU
analyzing CPU 3:
  no or unknown cpufreq driver is active on this CPU

I have the following kernel options set to Y but I don’t know if they work for T30:

CPU_FREQ 
CPU_FREQ_GOV_PERFORMANCE 
CPU_FREQ_GOV_POWERSAVE 
CPUFREQ_DT 
ARM_TEGRA20_CPUFREQ 
ARM_TEGRA124_CPUFREQ  
CPU_IDLE

I also have the DVFS support enabled, there is even a Tegra DEVFREQ Driver, but it doesn’t seem to help.

What is needed in order to populate the sysfs with the cpufreq governors?

kind regards

I have just seen an answer from 2016 that there was no T30 cpufreq driver in Mainline at that time. Does this answer still stand?
https://www.toradex.com/community/questions/3755/limit-cpu-frequency-on-apalis-t30-and-linux-462-ke.html

As already mentioned back here I believe there is still no mainline DVFS driver available for T30.

Dear Mr. Ziswiler,

Thank you. Are there other ways to save power and reduce the heat? I have found this
https://developer.toradex.com/knowledge-base/colibri-module/thermal-management#How_to_save_power
but this seems to concern Windows.

@CornStarch: Marcel will be back next week.

We are having excellent results with patching this one against 4.18:
https://gist.github.com/digetx/267e9d3055b2f28e30f61c0906b4635f
However, we are unsure about the frequency values in this patch for T30, especially when we compare with the values mentioned on this site:
https://developer.toradex.com/knowledge-base/cpu-frequency-(linux)

do you have a clue where the discrepancies might come from?

We are having excellent results with patching this one against 4.18: https://gist.github.com/digetx/267e9d3055b2f28e30f61c0906b4635f However, we are unsure about the frequency values in this patch for T30, especially when we compare with the values mentioned on this site: https://developer.toradex.com/knowledge-base/cpu-frequency-(linux)

do you have a clue where the discrepancies might come from?

Meanwhile, he posted a version to the mailing list. This one he limited the max frequency on T30 to 1 GHz which is probably a safe value considering all available flavours. So basically, the discrepancies come from whether or not it properly takes resp. SKU into account (e.g. T30 IT aka Industrial Temperature SKU would be 1 GHz max, our regular T30 aka Embedded SKU 1.3 GHz max resp. 1.4 GHz single core only, commercial T30 aka AP33 or T33 or whatever it is called 1.6 GHz max resp. 1.7 GHz single core only). Another problem I see is that his driver currently does not adjust any core/cpu voltages as far as I can tell. Plus it does not take any silicon parameters aka speedo whatever into account. So I guess a good first step but still a long way until the same validated & verified functionality as available downstream.

BTW: I also reworked our Tegras in mainline quite a bit lately as you may find here: Apalis T30, Colibri T30, Apalis TK1 and Colibri T20.