How to enable cpufreq in Linux imx8mmevk 5.10.35-lts Hardknott

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to enable cpufreq in Linux imx8mmevk 5.10.35-lts Hardknott

跳至解决方案
6,628 次查看
paulw2
Contributor II

Hi,

I'm running stock Linux 5.10 Hardknott BSP built for imx8mmevk and have found that cpufreq is not available despite enabling the kernel configuration options listed in the IMX Reference Manual under 2.5.3 CPU Frequency Scaling (CPUFREQ).

The cpufreq directory does not exist under each cpu entry in /sys.

 

root@imx8mmevk:/boot# ls /sys/devices/system/cpu/cpu0/cpufreq
ls: cannot access '/sys/devices/system/cpu/cpu0/cpufreq': No such file or directory

 

 

 

root@imx8mmevk:/boot# 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

 

 

 

kernel configuration :-

#
# CPU Frequency scaling
#
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_GOV_ATTR_SET=y
CONFIG_CPU_FREQ_GOV_COMMON=y
CONFIG_CPU_FREQ_STAT=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y

#
# CPU frequency scaling drivers
#
CONFIG_CPUFREQ_DT=y
CONFIG_CPUFREQ_DT_PLATDEV=y
CONFIG_ACPI_CPPC_CPUFREQ=m
CONFIG_ARM_SCPI_CPUFREQ=y
CONFIG_ARM_IMX_CPUFREQ_DT=y
CONFIG_QORIQ_CPUFREQ=y
# end of CPU Frequency scaling

 

 

I’ve verified that the device tree includes operating-points-v2 entries.

 

# cat /proc/device-tree/model
"FSL i.MX8MM EVK board"

imx8mm-evk.dts: model = "FSL i.MX8MM EVK board";

imx8mm.dtsi:                    operating-points-v2 = <&a53_opp_table>;

 

 

 

root@imx8mmevk:/boot# dmesg | grep cpufreq
[    2.260137] imx-cpufreq-dt imx-cpufreq-dt: cpu speed grade 3 mkt segment 0 supported-hw 0x8 0x1

 

Switching back to Zeus, cpufreq works as described in IMX Reference Manual and IMX Linux Users Guide.

What am I missing, how do I enable CPUfreq with 5.10 Hardknott BSP ?

 

Thanks.

0 项奖励
1 解答
6,613 次查看
nxf63675
NXP TechSupport
NXP TechSupport

Hi @paulw2,

 

You can change the default dts on uboot with this one, https://source.codeaurora.org/external/imx/linux-imx/tree/arch/arm64/boot/dts/freescale/imx8mm-evk-q... and it will show you the frequency, we are working to know why this happens, but for the moment this will fix your issue, accept our apologies for the problems that this could cause you.

 

Regards,

Israel.

在原帖中查看解决方案

10 回复数
5,982 次查看
firas_ashkar
Contributor I

The porblem is in [ drivers/cpufreq/imx-cpufreq-dt.c ], imx_cpufreq_dt_probe function,
where it silently bails out if it can not find the 'cpu-power' property.
Disabling the code that checks for this property, makes probe imx_cpufreq_dt_probe succeed,
which in return yields :
root@mcm-imx8m-mini:~# ls -lsrt /sys/devices/system/cpu/cpu0/cpufreq/
0 drwxr-xr-x 2 root root 0 Feb 28 17:14 stats
0 -rw-r--r-- 1 root root 4096 Feb 28 17:14 scaling_setspeed
0 -rw-r--r-- 1 root root 4096 Feb 28 17:14 scaling_min_freq
0 -rw-r--r-- 1 root root 4096 Feb 28 17:14 scaling_max_freq
0 -rw-r--r-- 1 root root 4096 Feb 28 17:14 scaling_governor
0 -r--r--r-- 1 root root 4096 Feb 28 17:14 scaling_driver
0 -r--r--r-- 1 root root 4096 Feb 28 17:14 scaling_cur_freq
0 -r--r--r-- 1 root root 4096 Feb 28 17:14 scaling_available_governors
0 -r--r--r-- 1 root root 4096 Feb 28 17:14 scaling_available_frequencies
0 -r--r--r-- 1 root root 4096 Feb 28 17:14 related_cpus
0 -r--r--r-- 1 root root 4096 Feb 28 17:14 cpuinfo_transition_latency
0 -r--r--r-- 1 root root 4096 Feb 28 17:14 cpuinfo_min_freq
0 -r--r--r-- 1 root root 4096 Feb 28 17:14 cpuinfo_max_freq
0 -r-------- 1 root root 4096 Feb 28 17:14 cpuinfo_cur_freq
0 -r--r--r-- 1 root root 4096 Feb 28 17:14 affected_cpus
root@mcm-imx8m-mini:~#

5,971 次查看
firas_ashkar
Contributor I

adding to previous post, one has to add some OPP entries as following

a53_opp_table: opp-table {
compatible = "operating-points-v2";
status = "okay";
opp-shared;

opp-600000000 {
opp-hz = /bits/ 64 <600000000>;
opp-microvolt = <700000>;
opp-supported-hw = <0xf>, <0x3>;
clock-latency-ns = <150000>;
opp-suspend;
status = "okay";
};

opp-900000000 {
opp-hz = /bits/ 64 <900000000>;
opp-microvolt = <775000>;
opp-supported-hw = <0xf>, <0x3>;
clock-latency-ns = <150000>;
status = "okay";
};

opp-1200000000 {
opp-hz = /bits/ 64 <1200000000>;
opp-microvolt = <850000>;
opp-supported-hw = <0xf>, <0x3>;
clock-latency-ns = <150000>;
status = "okay";
};

opp-1500000000 {
opp-hz = /bits/ 64 <1500000000>;
opp-microvolt = <925000>;
opp-supported-hw = <0xf>, <0x3>;
clock-latency-ns = <150000>;
status = "okay";
};

opp-1800000000 {
opp-hz = /bits/ 64 <1800000000>;
opp-microvolt = <1000000>;
opp-supported-hw = <0xe>, <0x3>;
clock-latency-ns = <150000>;
turbo-mode;
status = "okay";
};
};

 

0 项奖励
6,614 次查看
nxf63675
NXP TechSupport
NXP TechSupport

Hi @paulw2,

 

You can change the default dts on uboot with this one, https://source.codeaurora.org/external/imx/linux-imx/tree/arch/arm64/boot/dts/freescale/imx8mm-evk-q... and it will show you the frequency, we are working to know why this happens, but for the moment this will fix your issue, accept our apologies for the problems that this could cause you.

 

Regards,

Israel.

563 次查看
wouher
Contributor II

What U-Boot dts property needs to be changed exactly in order for the cpufreq folder to show up in user space?

Has NXP looked into this further as you mentioned?

I have a imx8mm system where cpufreq shows up using Zeus 5.4 but not in Kirkstone 5.15, as also experienced by other users.

In case there is a dependency on uboot dts parameters (and not just Linux config/dts), that could explain why NXP has not reproduced the 5.15 problems on an EVK.

Edit: In my case the problem was related to the 5.4/5.15 pca9450 syntax change as desribed in the link below:
https://community.nxp.com/t5/i-MX-Processors/Unable-to-set-cpufreq-in-Kirkstone-5-15-71/m-p/1687173 )

0 项奖励
2,349 次查看
r_trivedi123
Contributor IV

Hi @nxf63675 ,

I believe post migration of CAF codes to git, perhaps this could be the same link ?

https://github.com/nxp-imx/linux-imx/blob/imx_5.4.70_2.3.0/arch/arm64/boot/dts/freescale/imx8mm-evk-...


However, I am also facing the same issues of CPUfreq issues, can you guide?

--
BR
rutvij.trivedi@siliconsignals.io

0 项奖励
2,440 次查看
kishan_dudhatra
Contributor III

@nxf63675 Any updates on cpufreq-set?

Regards,
Kishan Dudhatra
0 项奖励
3,035 次查看
PStoykov
Contributor I

Hi @nxf63675 ,

The link doesn't work anymore. Is there a more permanent location for this fix?

Regards,
Petar

0 项奖励
2,391 次查看
dongremayur777
Contributor I

Did u got some another link or any way to get cpufreq ?

0 项奖励
6,598 次查看
paulw2
Contributor II

Hi  @nxf63675.

Thanks for your reply, for suggesting a possible workaround and confirming that NXP are investigating the issue.

I look forward to a more complete resolution.

Best regards.

0 项奖励
6,150 次查看
krakorar
Contributor I

We are using the imx8mm in a custom board with the same kernel and Hardknott. I am not sure switching the uboot dts work in our case as we are not using the imx8mmevk.

0 项奖励