This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DRA829V: CPU cooling using DFS in Linux

Part Number: DRA829V
Other Parts Discussed in Thread: DRA829, INA226

Dear experts,
 
I have applied the patch from www.ti.com/.../sdaa069.pdf for DRA829 and I have some questions. The only change to the patch is clocks parameter for the cpus.
 
  1. At first glance it looks like cpufreq subsystem is working with the OPP but verifying frequency with k3conf shows no changes to actual cpu frequency. If I set the ondemand governor both cpuinfo_cur_freq and scaling_cur_freq show 250 MHz but k3conf dump processor show 2GHz.
  2. The thermal subsystem (cpu as passive cooling device) does change cpu frequency verified with k3conf but temperature, power consumption and performance doesn't change. I set the alert trip point to 35 degC so cpu is set to 250 MHz (verified with k3conf) and I still get same performance in coremark and stress-ng benchmarks as at 2 GHz. Our idle cpu temperature is around 48 degC and during benchmark/stress test temperature increases to ~52 degC.
The diff for dra829:
diff --git a/arch/arm64/boot/dts/ti/k3-j721e-thermal.dtsi b/arch/arm64/boot/dts/ti/k3-j721e-thermal.dtsi
index 927f7614ae7a..7b308c18f148 100644
--- a/arch/arm64/boot/dts/ti/k3-j721e-thermal.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-j721e-thermal.dtsi
@@ -26,12 +26,25 @@ mpu_thermal: mpu-thermal {
                thermal-sensors = <&wkup_vtm0 1>;

                trips {
+                       mpu_alert: mpu-alert {
+                               temperature = <65000>; /* milliCelsius */
+                               hysteresis = <2000>; /* milliCelsius */
+                               type = "passive";
+                       };
+
                        mpu_crit: mpu-crit {
                                temperature = <125000>; /* milliCelsius */
                                hysteresis = <2000>; /* milliCelsius */
                                type = "critical";
                        };
                };
+
+               cpu_cooling_maps: cooling-maps {
+                       map0 {
+                               trip = <&mpu_alert>;
+                               cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                       };
+               };
        };

        c7x_thermal: c7x-thermal {
diff --git a/arch/arm64/boot/dts/ti/k3-j721e.dtsi b/arch/arm64/boot/dts/ti/k3-j721e.dtsi
index 5a72c518ceb6..e2acce5cda42 100644
--- a/arch/arm64/boot/dts/ti/k3-j721e.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-j721e.dtsi
@@ -48,6 +48,10 @@ cpu0: cpu@0 {
                        d-cache-line-size = <64>;
                        d-cache-sets = <256>;
                        next-level-cache = <&L2_0>;
+                       clocks = <&k3_clks 202 2>;
+                       clock-names = "cpu";
+                       operating-points-v2 = <&cpu0_opp_table>;
+                       #cooling-cells = <2>; /* min followed by max */
                };

                cpu1: cpu@1 {
@@ -62,9 +66,40 @@ cpu1: cpu@1 {
                        d-cache-line-size = <64>;
                        d-cache-sets = <256>;
                        next-level-cache = <&L2_0>;
+                       clocks = <&k3_clks 203 0>;
+                       clock-names = "cpu";
+                       operating-points-v2 = <&cpu0_opp_table>;
+                       #cooling-cells = <2>; /* min followed by max */
                };
        };

+       cpu0_opp_table: opp-table {
+               compatible = "operating-points-v2";
+               opp-shared;
+
+               opp6-2000000000 {
+                       opp-hz = /bits/ 64 <2000000000>;
+                       clock-latency-ns = <300000>;
+               };
+
+               opp4-1000000000 {
+                       opp-hz = /bits/ 64 <1000000000>;
+                       clock-latency-ns = <300000>;
+               };
+
+               opp2-500000000 {
+                       opp-hz = /bits/ 64 <500000000>;
+                       clock-latency-ns = <300000>;
+               };
+
+               opp1-250000000 {
+                       opp-hz = /bits/ 64 <250000000>;
+                       clock-latency-ns = <300000>;
+               };
+       };
+
+
+
        L2_0: l2-cache0 {
                compatible = "cache";
                cache-level = <2>;
 
Best regards,
Oliver Talevski
  • Hello Oliver,

    Can you share the k3conf output after the frequency is reduced by thermal framework as a cooling option. 

    Also share the cpufreq stats when the temperature crosses the programmed threshold.

    Best Regards,

    Keerthy 

  • k3conf and cpufreq stats when temperature crosses threshold and keeps rising:

    :~# cat time_in_state && cat total_trans && cat trans_table
    250000 0
    500000 0
    1000000 0
    2000000 11711

    0

    From : To
    : 250000 500000 1000000 2000000
    250000: 0 0 0 0
    500000: 0 0 0 0
    1000000: 0 0 0 0
    2000000: 0 0 0 0

    :~# k3conf dump processor
    |------------------------------------------------------------------------------|
    | VERSION INFO |
    |------------------------------------------------------------------------------|
    | K3CONF | (version 0.3-nogit built Thu Sep 25 10:19:14 UTC 2025) |
    | SoC | J721E SR2.0 |
    | SYSFW | ABI: 4.0 (firmware version 0x000b '11.1.8--v11.01.08 (Fancy Rat))') |
    |------------------------------------------------------------------------------|

    |--------------------------------------------------------------------------------------|
    | Device ID | Processor ID | Processor Name | Processor State | Processor Frequency |
    |--------------------------------------------------------------------------------------|
    | 202 | 32 | A72SS0_CORE0 | DEVICE_STATE_ON | 2000000000 |
    | 203 | 33 | A72SS0_CORE1 | DEVICE_STATE_ON | 2000000000 |
    | 142 | 3 | C66SS0_CORE0 | DEVICE_STATE_OFF | 0 |
    | 143 | 4 | C66SS1_CORE0 | DEVICE_STATE_OFF | 0 |
    | 15 | 48 | C71SS0 | DEVICE_STATE_OFF | 125000000 |
    | 250 | 1 | MCU_R5FSS0_CORE0 | DEVICE_STATE_ON | 1000000000 |
    | 251 | 2 | MCU_R5FSS0_CORE1 | DEVICE_STATE_ON | 1000000000 |
    | 245 | 6 | R5FSS0_CORE0 | DEVICE_STATE_ON | 1000000000 |
    | 246 | 7 | R5FSS0_CORE1 | DEVICE_STATE_ON | 1000000000 |
    | 247 | 8 | R5FSS1_CORE0 | DEVICE_STATE_ON | 1000000000 |
    | 248 | 9 | R5FSS1_CORE1 | DEVICE_STATE_ON | 1000000000 |
    |--------------------------------------------------------------------------------------|

    :~# cat time_in_state && cat total_trans && cat trans_table
    250000 0
    500000 0
    1000000 367
    2000000 14382

    1

    From : To
    : 250000 500000 1000000 2000000
    250000: 0 0 0 0
    500000: 0 0 0 0
    1000000: 0 0 0 0
    2000000: 0 0 1 0

    :~# k3conf dump processor
    |------------------------------------------------------------------------------|
    | VERSION INFO |
    |------------------------------------------------------------------------------|
    | K3CONF | (version 0.3-nogit built Thu Sep 25 10:19:14 UTC 2025) |
    | SoC | J721E SR2.0 |
    | SYSFW | ABI: 4.0 (firmware version 0x000b '11.1.8--v11.01.08 (Fancy Rat))') |
    |------------------------------------------------------------------------------|

    |--------------------------------------------------------------------------------------|
    | Device ID | Processor ID | Processor Name | Processor State | Processor Frequency |
    |--------------------------------------------------------------------------------------|
    | 202 | 32 | A72SS0_CORE0 | DEVICE_STATE_ON | 1000000000 |
    | 203 | 33 | A72SS0_CORE1 | DEVICE_STATE_ON | 1000000000 |
    | 142 | 3 | C66SS0_CORE0 | DEVICE_STATE_OFF | 0 |
    | 143 | 4 | C66SS1_CORE0 | DEVICE_STATE_OFF | 0 |
    | 15 | 48 | C71SS0 | DEVICE_STATE_OFF | 125000000 |
    | 250 | 1 | MCU_R5FSS0_CORE0 | DEVICE_STATE_ON | 1000000000 |
    | 251 | 2 | MCU_R5FSS0_CORE1 | DEVICE_STATE_ON | 1000000000 |
    | 245 | 6 | R5FSS0_CORE0 | DEVICE_STATE_ON | 1000000000 |
    | 246 | 7 | R5FSS0_CORE1 | DEVICE_STATE_ON | 1000000000 |
    | 247 | 8 | R5FSS1_CORE0 | DEVICE_STATE_ON | 1000000000 |
    | 248 | 9 | R5FSS1_CORE1 | DEVICE_STATE_ON | 1000000000 |
    |--------------------------------------------------------------------------------------|

    :~# cat time_in_state && cat total_trans && cat trans_table
    250000 0
    500000 305
    1000000 1486
    2000000 14382

    2

    From : To
    : 250000 500000 1000000 2000000
    250000: 0 0 0 0
    500000: 0 0 0 0
    1000000: 0 1 0 0
    2000000: 0 0 1 0

    :~# k3conf dump processor
    |------------------------------------------------------------------------------|
    | VERSION INFO |
    |------------------------------------------------------------------------------|
    | K3CONF | (version 0.3-nogit built Thu Sep 25 10:19:14 UTC 2025) |
    | SoC | J721E SR2.0 |
    | SYSFW | ABI: 4.0 (firmware version 0x000b '11.1.8--v11.01.08 (Fancy Rat))') |
    |------------------------------------------------------------------------------|

    |--------------------------------------------------------------------------------------|
    | Device ID | Processor ID | Processor Name | Processor State | Processor Frequency |
    |--------------------------------------------------------------------------------------|
    | 202 | 32 | A72SS0_CORE0 | DEVICE_STATE_ON | 500000000 |
    | 203 | 33 | A72SS0_CORE1 | DEVICE_STATE_ON | 500000000 |
    | 142 | 3 | C66SS0_CORE0 | DEVICE_STATE_OFF | 0 |
    | 143 | 4 | C66SS1_CORE0 | DEVICE_STATE_OFF | 0 |
    | 15 | 48 | C71SS0 | DEVICE_STATE_OFF | 125000000 |
    | 250 | 1 | MCU_R5FSS0_CORE0 | DEVICE_STATE_ON | 1000000000 |
    | 251 | 2 | MCU_R5FSS0_CORE1 | DEVICE_STATE_ON | 1000000000 |
    | 245 | 6 | R5FSS0_CORE0 | DEVICE_STATE_ON | 1000000000 |
    | 246 | 7 | R5FSS0_CORE1 | DEVICE_STATE_ON | 1000000000 |
    | 247 | 8 | R5FSS1_CORE0 | DEVICE_STATE_ON | 1000000000 |
    | 248 | 9 | R5FSS1_CORE1 | DEVICE_STATE_ON | 1000000000 |
    |--------------------------------------------------------------------------------------|

    :~# cat time_in_state && cat total_trans && cat trans_table
    250000 301
    500000 1322
    1000000 1486
    2000000 14382

    3

    From : To
    : 250000 500000 1000000 2000000
    250000: 0 0 0 0
    500000: 1 0 0 0
    1000000: 0 1 0 0
    2000000: 0 0 1 0

    :~# k3conf dump processor
    |------------------------------------------------------------------------------|
    | VERSION INFO |
    |------------------------------------------------------------------------------|
    | K3CONF | (version 0.3-nogit built Thu Sep 25 10:19:14 UTC 2025) |
    | SoC | J721E SR2.0 |
    | SYSFW | ABI: 4.0 (firmware version 0x000b '11.1.8--v11.01.08 (Fancy Rat))') |
    |------------------------------------------------------------------------------|

    |--------------------------------------------------------------------------------------|
    | Device ID | Processor ID | Processor Name | Processor State | Processor Frequency |
    |--------------------------------------------------------------------------------------|
    | 202 | 32 | A72SS0_CORE0 | DEVICE_STATE_ON | 250000000 |
    | 203 | 33 | A72SS0_CORE1 | DEVICE_STATE_ON | 250000000 |
    | 142 | 3 | C66SS0_CORE0 | DEVICE_STATE_OFF | 0 |
    | 143 | 4 | C66SS1_CORE0 | DEVICE_STATE_OFF | 0 |
    | 15 | 48 | C71SS0 | DEVICE_STATE_OFF | 125000000 |
    | 250 | 1 | MCU_R5FSS0_CORE0 | DEVICE_STATE_ON | 1000000000 |
    | 251 | 2 | MCU_R5FSS0_CORE1 | DEVICE_STATE_ON | 1000000000 |
    | 245 | 6 | R5FSS0_CORE0 | DEVICE_STATE_ON | 1000000000 |
    | 246 | 7 | R5FSS0_CORE1 | DEVICE_STATE_ON | 1000000000 |
    | 247 | 8 | R5FSS1_CORE0 | DEVICE_STATE_ON | 1000000000 |
    | 248 | 9 | R5FSS1_CORE1 | DEVICE_STATE_ON | 1000000000 |
    |--------------------------------------------------------------------------------------|

    :~# k3conf dump clock 202
    |------------------------------------------------------------------------------|
    | VERSION INFO |
    |------------------------------------------------------------------------------|
    | K3CONF | (version 0.3-nogit built Thu Sep 25 10:19:14 UTC 2025) |
    | SoC | J721E SR2.0 |
    | SYSFW | ABI: 4.0 (firmware version 0x000b '11.1.8--v11.01.08 (Fancy Rat))') |
    |------------------------------------------------------------------------------|

    |-----------------------------------------------------------------------------------------|
    | Device ID | Clock ID | Clock Name | Status | Clock Frequency |
    |-----------------------------------------------------------------------------------------|
    | 202 | 2 | DEV_A72SS0_CORE0_ARM_CLK_CLK | CLK_STATE_READY | 250000000 |
    |-----------------------------------------------------------------------------------------|

    :~# k3conf dump clock 203
    |------------------------------------------------------------------------------|
    | VERSION INFO |
    |------------------------------------------------------------------------------|
    | K3CONF | (version 0.3-nogit built Thu Sep 25 10:19:14 UTC 2025) |
    | SoC | J721E SR2.0 |
    | SYSFW | ABI: 4.0 (firmware version 0x000b '11.1.8--v11.01.08 (Fancy Rat))') |
    |------------------------------------------------------------------------------|

    |-----------------------------------------------------------------------------------------|
    | Device ID | Clock ID | Clock Name | Status | Clock Frequency |
    |-----------------------------------------------------------------------------------------|
    | 203 | 0 | DEV_A72SS0_CORE1_ARM_CLK_CLK | CLK_STATE_READY | 250000000 |
    |-----------------------------------------------------------------------------------------|

  • Here I run coremark at 250 MHz:

    :~# k3conf dump processor
    |------------------------------------------------------------------------------|
    | VERSION INFO |
    |------------------------------------------------------------------------------|
    | K3CONF | (version 0.3-nogit built Thu Sep 25 10:19:14 UTC 2025) |
    | SoC | J721E SR2.0 |
    | SYSFW | ABI: 4.0 (firmware version 0x000b '11.1.8--v11.01.08 (Fancy Rat))') |
    |------------------------------------------------------------------------------|

    |--------------------------------------------------------------------------------------|
    | Device ID | Processor ID | Processor Name | Processor State | Processor Frequency |
    |--------------------------------------------------------------------------------------|
    | 202 | 32 | A72SS0_CORE0 | DEVICE_STATE_ON | 250000000 |
    | 203 | 33 | A72SS0_CORE1 | DEVICE_STATE_ON | 250000000 |
    | 142 | 3 | C66SS0_CORE0 | DEVICE_STATE_OFF | 0 |
    | 143 | 4 | C66SS1_CORE0 | DEVICE_STATE_OFF | 0 |
    | 15 | 48 | C71SS0 | DEVICE_STATE_OFF | 125000000 |
    | 250 | 1 | MCU_R5FSS0_CORE0 | DEVICE_STATE_ON | 1000000000 |
    | 251 | 2 | MCU_R5FSS0_CORE1 | DEVICE_STATE_ON | 1000000000 |
    | 245 | 6 | R5FSS0_CORE0 | DEVICE_STATE_ON | 1000000000 |
    | 246 | 7 | R5FSS0_CORE1 | DEVICE_STATE_ON | 1000000000 |
    | 247 | 8 | R5FSS1_CORE0 | DEVICE_STATE_ON | 1000000000 |
    | 248 | 9 | R5FSS1_CORE1 | DEVICE_STATE_ON | 1000000000 |
    |--------------------------------------------------------------------------------------|

    :~# coremark
    2K performance run parameters for coremark.
    CoreMark Size : 666
    Total ticks : 18988
    Total time (secs): 18.988000
    Iterations/Sec : 10532.968190
    Iterations : 200000
    Compiler version : GCC13.4.0
    Compiler flags : -O2 -lrt
    Memory location : Please put data memory location here
    (e.g. code in flash, data on heap etc)
    seedcrc : 0xe9f5
    [0]crclist : 0xe714
    [0]crcmatrix : 0x1fd7
    [0]crcstate : 0x8e3a
    [0]crcfinal : 0x4983
    Correct operation validated. See README.md for run and reporting rules.
    CoreMark 1.0 : 10532.968190 / GCC13.4.0 -O2 -lrt / Heap

    :~# cat time_in_state && cat total_trans && cat trans_table
    250000 198907
    500000 1322
    1000000 1486
    2000000 14382

    3

    From : To
    : 250000 500000 1000000 2000000
    250000: 0 0 0 0
    500000: 1 0 0 0
    1000000: 0 1 0 0
    2000000: 0 0 1 0

    And then coremark again at 2GHz:

    :~# k3conf dump processor
    |------------------------------------------------------------------------------|
    | VERSION INFO |
    |------------------------------------------------------------------------------|
    | K3CONF | (version 0.3-nogit built Thu Sep 25 10:19:14 UTC 2025) |
    | SoC | J721E SR2.0 |
    | SYSFW | ABI: 4.0 (firmware version 0x000b '11.1.8--v11.01.08 (Fancy Rat))') |
    |------------------------------------------------------------------------------|

    |--------------------------------------------------------------------------------------|
    | Device ID | Processor ID | Processor Name | Processor State | Processor Frequency |
    |--------------------------------------------------------------------------------------|
    | 202 | 32 | A72SS0_CORE0 | DEVICE_STATE_ON | 2000000000 |
    | 203 | 33 | A72SS0_CORE1 | DEVICE_STATE_ON | 2000000000 |
    | 142 | 3 | C66SS0_CORE0 | DEVICE_STATE_OFF | 0 |
    | 143 | 4 | C66SS1_CORE0 | DEVICE_STATE_OFF | 0 |
    | 15 | 48 | C71SS0 | DEVICE_STATE_OFF | 125000000 |
    | 250 | 1 | MCU_R5FSS0_CORE0 | DEVICE_STATE_ON | 1000000000 |
    | 251 | 2 | MCU_R5FSS0_CORE1 | DEVICE_STATE_ON | 1000000000 |
    | 245 | 6 | R5FSS0_CORE0 | DEVICE_STATE_ON | 1000000000 |
    | 246 | 7 | R5FSS0_CORE1 | DEVICE_STATE_ON | 1000000000 |
    | 247 | 8 | R5FSS1_CORE0 | DEVICE_STATE_ON | 1000000000 |
    | 248 | 9 | R5FSS1_CORE1 | DEVICE_STATE_ON | 1000000000 |
    |--------------------------------------------------------------------------------------|

    :~# cat time_in_state && cat total_trans && cat trans_table
    250000 200471
    500000 6173
    1000000 2426
    2000000 15940

    6

    From : To
    : 250000 500000 1000000 2000000
    250000: 0 1 0 0
    500000: 1 0 1 0
    1000000: 0 1 0 1
    2000000: 0 0 1 0

    :~# coremark
    2K performance run parameters for coremark.
    CoreMark Size : 666
    Total ticks : 18959
    Total time (secs): 18.959000
    Iterations/Sec : 10549.079593
    Iterations : 200000
    Compiler version : GCC13.4.0
    Compiler flags : -O2 -lrt
    Memory location : Please put data memory location here
    (e.g. code in flash, data on heap etc)
    seedcrc : 0xe9f5
    [0]crclist : 0xe714
    [0]crcmatrix : 0x1fd7
    [0]crcstate : 0x8e3a
    [0]crcfinal : 0x4983
    Correct operation validated. See README.md for run and reporting rules.
    CoreMark 1.0 : 10549.079593 / GCC13.4.0 -O2 -lrt / Heap

    :~# cat time_in_state && cat total_trans && cat trans_table
    250000 200471
    500000 6173
    1000000 2426
    2000000 35795

    6

    From : To
    : 250000 500000 1000000 2000000
    250000: 0 1 0 0
    500000: 1 0 1 0
    1000000: 0 1 0 1
    2000000: 0 0 1 0

  • | 2 | DEV_A72SS0_CORE0_ARM_CLK_CLK | CLK_STATE_READY | 250000000

    Hello Oliver,

    K3conf also shows 250M. From software I can confirm that we are at 250M. Power should also decrease as the frequency is reduced to 1/8th of the orginal 2G.

    Best Regards,

    Keerthy 

  • Yes, I know k3conf show 250 MHz in the cooling device use case. I wrote so in my question:

    "The thermal subsystem (cpu as passive cooling device) does change cpu frequency verified with k3conf but temperature, power consumption and performance doesn't change."

    The problem is that temperature, power and performance are not affected. Look at coremark benchmark above. At 2 GHz I get 10549 points and at 250 MHz I get 10533 points.

    Best regards,

    Oliver Talevski

  • Hello Oliver,

    I have not tried the exact SDK but in the past I have seen power drop when frequency drops. 

    Do you have any power number measurements at the 250M and 2G frequencies?

    Best Regards,

    Keerthy 

  • Hello,

    At both 2 GHz and 250 MHz we idle at 8.64 W and go up to 9.36 W during coremark benchmark.

    We have u-boot 24.04, kernel 6.6.80 and meta-ti 11.01.14. 

    Best regards,

    Oliver Talevski

  • Hello Oliver,

    I will set it up and get back to you by Friday.

    In the meantime it will be good if you can check if the VDD_CPU_AVS rail which feeds on to A72 has some delta in power when you change frequency.

    - Keerthy

  • Hello,

    There is no change in power between 2GHz and 250MHz. We measured 0.86V and 1.1A in both cases.

    Br

    Oliver

  • Okay. I will get back on this in a couple of days. There are on board INA226 that I will try to configure and measure power.

    - Keerthy

  • Oliver,

    I debugged this and finally am seeing the power reduction:

    PLL8_SS_CTRL Register bit[0]. 

    Once we set the bit to 0x1 using:
    devmem2 0x688040 w 0x80000001

    Without the above change Power would not reduce.

    Please try at your end and let me know.

    - Keerthy

  • Thank you Keerthy! Both use cases (cooling device and cpufreq governors) are now working.

    Best regards,

    Oliver