Change Verdin imx8mp cpu Frequency

Hello,

because of EMV restrictions I need to change CPU-Frequency to something between 1.3 - 1.5 GHz.
I followed your description here: CPU Frequency and DVFS (Linux) | Toradex Developer Center . But only 1.2GHz or 1.6GHz is available with yocto bsp for verdin imx8mp.

Is it possible to configure other frequencies within my desired range?

Maybe by changing Kernel Config similar to the description for default scaling governor: How to Lower CPU Power Consumption | Toradex Developer Center ?

Thanks for your help!

Immanuel

Hi @ImHei!

From what I could understand, the operation frequencies are defined in the device tree. This is useful: https://community.nxp.com/t5/i-MX-Processors/Lower-CPU-Freq-in-imx8mp/m-p/1703005

You can see the definition of the frequencies here (line 134): imx8mp.dtsi « freescale « dts « boot « arm64 « arch - linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules

As a test, I modified imx8mp.dtsi with the patch below, built the imx8mp-verdin-wifi-dev.dtb, and applied it on my Verdin iMX8MP Q 4GB WB IT V1.0B. Be aware that I don’t know if the values for opp-microvolt, opp-supported-hw, clock-latency-ns, and opp-suspend are correct! This was a simple quick test!

diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
index 9e0880992566..5627b5ff50df 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
@@ -135,29 +135,13 @@ a53_opp_table: opp-table {
                compatible = "operating-points-v2";
                opp-shared;

-               opp-1200000000 {
-                       opp-hz = /bits/ 64 <1200000000>;
+               opp-1400000000 {
+                       opp-hz = /bits/ 64 <1400000000>;
                        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;
-               };
        };

        memory@40000000 {

Upon the next boot, we can see that the frequency is the only one defined in the device tree:

root@verdin-imx8mp-06849036:~# cd /sys/devices/system/cpu/cpu0/cpufreq/
root@verdin-imx8mp-06849036:/sys/devices/system/cpu/cpu0/cpufreq# cat scaling_available_frequencies
1400000
root@verdin-imx8mp-06849036:/sys/devices/system/cpu/cpu0/cpufreq# cat scaling_cur_freq
1400000

For completeness, here is my tdx-info:

root@verdin-imx8mp-06849036:~# tdx-info

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           5.15.129-6.4.0+git.67c3153d20ff #1 SMP PREEMPT Wed Sep 27 12:30:36 UTC 2023
Kernel command line:      root=PARTUUID=298bca9d-02 ro rootwait console=tty1 console=ttymxc2,115200 consolebln
Distro name:              NAME="TDX Wayland with XWayland"
Distro version:           VERSION_ID=6.4.0-build.8
Hostname:                 verdin-imx8mp-06849036
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin iMX8M Plus WB on Verdin Development Board
Toradex version:          0058 V1.0B
Serial number:            06849036
Processor arch:           aarch64
------------------------------------------------------------

In addition, I also recommend you take a look at the document i.MX Linux Reference Manual from NXP, which you can download from “Documentation” on this link: Embedded Linux for i.MX Applications Processors | NXP Semiconductors. To know which Documentation version you should download, please check the version of NXP release related to the Torizon/BSP from Toradex you are using in Embedded Linux Release Matrix | Toradex Developer Center.

Let us know if this helps you.

Best regards,

Hi @henrique.tx ,
thanks for that advice. I will try and let you know if this works.
Regards
Immanuel

Hello @henrique.tx ,

turned out that CPU frequency wasn’t the reason for the EMV problems of our customer. So I don’t have to switch freauency.

Thanks for your help!