How to enable cpufreq in Linux imx8mmevk 5.10.35-lts Hardknott

cancel
Showing results for 
Search instead for 
Did you mean: 

How to enable cpufreq in Linux imx8mmevk 5.10.35-lts Hardknott

Jump to solution
3,409 Views
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 Kudos
1 Solution
3,394 Views
nxf63675
NXP Employee
NXP Employee

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.

View solution in original post

5 Replies
2,763 Views
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:~#

2,752 Views
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 Kudos
3,395 Views
nxf63675
NXP Employee
NXP Employee

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.

3,379 Views
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 Kudos
2,931 Views
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 Kudos