Lower CPU Freq in imx8mp

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Lower CPU Freq in imx8mp

3,510 Views
xgarcia
Contributor I

I'm currently utilizing Yocto's Kirkstone (last LTS) version with kernel 5.15.60 for my imx8mp project.

I need help in expanding the available frequency ranges,

root@imx8mp:/sys/devices/system/cpu/cpu0/cpufreq# cat scaling_available_frequencies
1200000 1600000

root@imx8mp:/sys/devices/system/cpu/cpu0/cpufreq# cpufreq-info
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to [email protected], please.
analyzing CPU 0:
  driver: cpufreq-dt
  CPUs which run at the same hardware frequency: 0 1 2 3
  CPUs which need to have their frequency coordinated by software: 0 1 2 3
  maximum transition latency: 182 us.
  hardware limits: 1.20 GHz - 1.60 GHz
  available frequency steps: 1.20 GHz, 1.60 GHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance, schedutil
  current policy: frequency should be within 1.20 GHz and 1.60 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.


I'm attempting to reduce the CPU frequency to 0.8GHz
.

To achieve this, I've tried editing the `a53_opp_table` in the `imx8mp.dtsi` file without success:

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

+        opp-800000000 {
+            opp-hz = /bits/ 64 <800000000>;
+            opp-microvolt = <850000>;
+            /* opp-supported-hw = <0x??>, <0x??>; */
+            clock-latency-ns = <150000>;
+            opp-suspend;
+        };

        opp-1200000000 {
            opp-hz = /bits/ 64 <1200000000>;
            opp-microvolt = <850000>;
            opp-supported-hw = <0x8a0>, <0x7>;
            clock-latency-ns = <150000>;
            opp-suspend;
        };

        opp-1600000000 {
            opp-hz = /bits/ 64 <1600000000>;
            opp-microvolt = <950000>;
            opp-supported-hw = <0xa0>, <0x7>;
            clock-latency-ns = <150000>;
            opp-suspend;
        };

        opp-1800000000 {
            opp-hz = /bits/ 64 <1800000000>;
            opp-microvolt = <1000000>;
            opp-supported-hw = <0x20>, <0x3>;
            clock-latency-ns = <150000>;
            opp-suspend;
        };
    };


Adding this entry does not have any effect. Could you please advise if there are additional configurations that need to be modified? which are the correct values for opp-supported-hw option?

Additionally, it seems that the 1.8GHz frequency is not active, leading me to believe that further adjustments might be necessary.

Thank you for your prompt assistance.

Best regards

 

0 Kudos
Reply
3 Replies

3,446 Views
Chavira
NXP TechSupport
NXP TechSupport

Hi @xgarcia!

Thank you for contacting NXP Support!

I am using the 5.15.71-2.2.1 release:

https://github.com/nxp-imx/imx-manifest/blob/imx-linux-kirkstone/README.md

I add the next lines to the opp table to set the lower frequency to the CPU:

opp-800000000 {
opp-hz = /bits/ 64 <800000000>;
opp-microvolt = <850000>;
opp-supported-hw = <0x8a0>, <0x7>;
clock-latency-ns = <150000>;
opp-suspend;
};

opp-1000000000 {
opp-hz = /bits/ 64 <1000000000>;
opp-microvolt = <850000>;
opp-supported-hw = <0x8a0>, <0x7>;
clock-latency-ns = <150000>;
opp-suspend;
};

The following are some of the more frequently used commands:
These commands return information about the system and the current settings.
• The kernel is pre-configured to support only certain frequencies. The list of frequencies currently supported
can be obtained from:
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
• To get the available scaling governors:
cat /sys/devices/system/cpu/*/cpufreq/scaling_available_governors
• To check the current CPU frequency:
cat /sys/devices/system/cpu/*/cpufreq/cpuinfo_cur_freq
The frequency is displayed depending on the governor set.
• To check the maximum frequency:
cat /sys/devices/system/cpu/*/cpufreq/cpuinfo_max_freq
• To check the minimum frequency:
cat /sys/devices/system/cpu/*/cpufreq/cpuinfo_min_freq
These commands set a constant CPU frequency:
• Use the maximum frequency:
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
• Use the current frequency to be the constant frequency:
echo userspace > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
• The following two commands set the scaling governor to a specified frequency, if that frequency is supported.
If the frequency is not supported, the closest supported frequency is used:
echo userspace > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo <frequency> > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed

Chavira_0-1691769851117.png

 

0 Kudos
Reply

3,276 Views
mengfei
Contributor III

If I want to reduce power consumption, the frequency should be set to 800Mhz and the voltage should also be reduced. The voltage value you provided for the 800Mhz node is the same as 1.2Ghz. If I want to reduce the voltage, what is the recommended voltage value

0 Kudos
Reply

3,278 Views
mengfei
Contributor III

opp-800000000 { opp-hz = /bits/ 64 <800000000>; opp-microvolt = <850000>; opp-supported-hw = <0x8a0>, <0x7>; clock-latency-ns = <150000>; opp-suspend; };

What does opp-supported-hw   mean? Why can this value be set to be the same as 1.2Ghz

0 Kudos
Reply