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.

AM67: How to change AM67x CPU clock to 1.4Ghz

Part Number: AM67
Other Parts Discussed in Thread: DRA821,

Tool/software:

Champs, 

By using K3conf in AM67x pre-build image on AM67x EVM, the A53x clock are running only 1.25Ghz.

How to change the A53 clock from 1.25Ghz to 1.4Ghz? 

Also what the setting (temperature thread hold) in Linux to reduce clock rate when SOC die temperature reach high (setting) temperature for thermal protection and reduce power consumption?  

By checking Linux SDK document, not seeing similar topic for power management like AM62x as below line for reference. 

https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/11_00_09_04/exports/docs/linux/Foundational_Components_Power_Management.html

Only power management and thermal related chapter in AM67x is VTM, but DFS chapter is blank or not be able to connect.  

https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-am67/10_01_08_01/exports/docs/linux/Foundational_Components/Kernel/Kernel_Drivers/VTM.html

Could team point us to related document and setting on how to do ARM A53 clock setting and power management policy? 

BR, Rich 

  • Hi Rich,

    Responses will be delayed owing to the Good Friday/Easter holidays across TI.

    regards

    Suman

  • Hello Rich,

    U-Boot dts file: arch/arm/dts/k3-j722s-r5-evm.dts

            a53_0: a53@0 {
                    compatible = "ti,am654-rproc";
                    reg = <0x00 0x00a90000 0x00 0x10>;
                    power-domains = <&k3_pds 61 TI_SCI_PD_EXCLUSIVE>,
                            <&k3_pds 135 TI_SCI_PD_EXCLUSIVE>,
                            <&k3_pds 166 TI_SCI_PD_EXCLUSIVE>;
                    resets = <&k3_reset 135 0>;
                    clocks = <&k3_clks 61 0>;
                    assigned-clocks = <&k3_clks 61 0>, <&k3_clks 135 0>;
                    assigned-clock-parents = <&k3_clks 61 2>;
                    assigned-clock-rates = <200000000>, <1400000000>;
                    ti,sci = <&dmsc>;
                    ti,sci-proc-id = <32>;
                    ti,sci-host-id = <10>;
                    bootph-all;
            };

    assigned-clock-rates = <200000000>, <1400000000>;

    By default the R5F configures A72 to boot at 1.4GHz

    But k3conf as you rightly observed is showing the frequency is 1.25 GHz.

    k3conf dump clock 135
    |------------------------------------------------------------------------------|
    | VERSION INFO                                                                 |
    |------------------------------------------------------------------------------|
    | K3CONF | (version 0.3-nogit built Thu Jul 25 14:13:02 UTC 2024)              |
    | SoC    | J722S SR1.0                                                         |
    | SYSFW  | ABI: 4.0 (firmware version 0x000a '10.1.6--v10.01.06 (Fiery Fox))') |
    |------------------------------------------------------------------------------|
    
    |----------------------------------------------------------------------------------------------------|
    | Device ID | Clock ID | Clock Name                              | Status          | Clock Frequency |
    |----------------------------------------------------------------------------------------------------|
    |   135     |     0    | DEV_A53SS0_CORE_0_A53_CORE0_ARM_CLK_CLK | CLK_STATE_READY | 1250000000      |
    |----------------------------------------------------------------------------------------------------|
    
    root@j722s-evm:~# k3conf set clock 135 0 1400000000
    |------------------------------------------------------------------------------|
    | VERSION INFO                                                                 |
    |------------------------------------------------------------------------------|
    | K3CONF | (version 0.3-nogit built Thu Jul 25 14:13:02 UTC 2024)              |
    | SoC    | J722S SR1.0                                                         |
    | SYSFW  | ABI: 4.0 (firmware version 0x000a '10.1.6--v10.01.06 (Fiery Fox))') |
    |------------------------------------------------------------------------------|
    

    You can use:

    k3conf set clock 135 0 1400000000

    to set the clock to 1.4GHz

    I will check with our U-Boot experts on this behavior & get back.

    - Keerthy

  • Keerthy, 

    Thanks, that's helpful. 

    Do we have power management policy to support DFS and setting temperature threadhold to reduce clock? 

    BR, Rich

  • Hello Rich,

    No support for DFS on AM67x.

    Also I got the internal confirmation that with 11.0 SDK which will be released in a month the default boot frequency of A53s will be 1.4 GHz.

    I am attaching the boot binaries which you can replace from the 10.1 SDL.

    Download the below zip and copy all the binaries to the boot partition.

    j722s-11.0-boot-bins.tar

    You should be able to see that the boot frequency is 1.4 GHz.

    root@j722s-evm:~# k3conf dump clock 135
    |------------------------------------------------------------------------------|
    | VERSION INFO                                                                 |
    |------------------------------------------------------------------------------|
    | K3CONF | (version 0.3-nogit built Thu Jul 25 14:13:02 UTC 2024)              |
    | SoC    | J722S SR1.0                                                         |
    | SYSFW  | ABI: 4.0 (firmware version 0x000a '10.1.6--v10.01.06 (Fiery Fox))') |
    |------------------------------------------------------------------------------|
    
    |----------------------------------------------------------------------------------------------------|
    | Device ID | Clock ID | Clock Name                              | Status          | Clock Frequency |
    |----------------------------------------------------------------------------------------------------|
    |   135     |     0    | DEV_A53SS0_CORE_0_A53_CORE0_ARM_CLK_CLK | CLK_STATE_READY | 1400000000      |
    |----------------------------------------------------------------------------------------------------|
    

    - Keerthy

  • Keerthy, 

    What's the temperature threshold setting to reduce clock to cool down SOC?

    Does current Linux SDK power management policy support this? (change OPP?)

    BR, Rich

  • Rich,

    Does current Linux SDK power management policy support this? (change OPP?)


    There is no support for cooling using DFS in the SDK. No plans yet to add in the next SDK.

    - Keerthy

  • Keerthy, 

    There is no power management policy and always performance mode.

    This is a not common for customer application which no way to cool down and support thermal protection. 

    Thermal protection and switch OPP to a lower clock mode is the minimal requirement for customer production or it could run into overheat.  

    We have to add this on as other Sitara SOC supports.

    Is it possible to support thermal protection by reducing clock rate (DFS) in SDK11? 

    BR, Rich

  • Rich,

    I have checked with our internal team in the past. I will double check again and get back by Friday.

    Best Regards,

    Keerthy 

  • Hi Rich,

    Closing this thread as there is no plans to support this from the development team.

    - Keerthy

  • Keerthy, 

    You are the one who create support for this feature on DRA821 and we are escalating to add this feature on AM67x in next coming SDK.

    It is a must have feature to our product for industrial application and we need to enable support to our product reliability and customer trust. 

    BR, Rich   

  • Rich,

    I will need sometime to get to that. SDK integration is something the development team can comment.

    - Keerthy

  • Rich,

    I worked on enabling cooling based on dynamic frequency scaling for AM67.

    I am attaching the patches that should apply cleanly on top of 11.0 SDK.https://www.ti.com/tool/download/PROCESSOR-SDK-LINUX-J722S/11.00.00.08

    Patches:

    cooling-wth-dfs.tar

    Best Regards,
    Keerthy

  • Keerthy,

    Thanks for the effort to create it.

    Is there user instruction to set OPP? K3conf? 

    What's the setting temperature for cooling?

    BR, Rich

  • Rich,

    The Linux kernel automatically drops the OPP to lower OPP as and when it reaches a threshold.
    In the above patches I have set a threshold of 60C.

     		trips {
    +			main0_alert0: main0_alert0 {
    +				temperature = <60000>; /* millicelsius */
    +				hysteresis = <2000>; /* millicelsius */
    +				type = "passive";
    +			};
    +

    Also 2 Degree hysteresis.

    Once you the AM67 touches 60C, the frequency will drop to lower frequencies.

    - Keerthy

  • Keerthy, 

    May I know the mechanism how to set default operation OPP and cooling OPP since there is no power management policy. Is there Max Operation Point and Min Operation Point setting in governor? 

    In what condition system will return to normal frequency?

    How does 2 degree hysteresis work? 

    I see there is critical temperature setting in 125 degree C. What will happen when critical temperature is reached?

    BR, Rich

  • Rich, 

    Have you tried the patches already?

    Can you check if they are working as expected?

    May I know the mechanism how to set default operation OPP and cooling OPP since there is no power management policy. Is there Max Operation Point and Min Operation Point setting in governor? 

    But default we will be at the highest frequency. 

    Once the temperature raises above the 60c then the thermal governor kicks in and reduces the frequency to cool. 

    Please follow the patches to see the max and min frequencies.

    In what condition system will return to normal frequency?

    How does 2 degree hysteresis work

    When the system cools below 60-2 aka 58 degrees the higher frequency will be used.

    That's where 2 degrees hysteresis kicks in. 

    see there is critical temperature setting in 125 degree C. What will happen when critical temperature is reached?

    This will trigger SoC reset. 

    Best Regards,

    Keerthy 

  • Keerthy,

    I cannot tell the power management mechanism from the two patches.

    How to set max and min? Are these been set in Linux power management policy? 

    What OPP will be jump to when it reach 60 degree C? Is this OPP fixed or it will switch to lower OPP continually?

    BR, Rich 

  • How to set max and min? Are these been set in Linux power management policy? 

    Min: This will be the minimum frequency defined in the OPP table - 200M
    Max: This will be the minimum frequency defined in the OPP table - 1.4G

    The Linux thermal management uses the CPU frequencies for cooling.

    What OPP will be jump to when it reach 60 degree C? Is this OPP fixed or it will switch to lower OPP continually?

    Step wise governor keeps switching to lower frequencies until the '60 - hyst' temperature is reached. Once the system cools below that temperature the Linux thermal framework automatically increases the frequency.

    This is for 60C threshold.

    For MAX_TEMP i.e 125C. It will be thermal shutdown.

    Is that clear?

    - Keerthy

  • Keerthy, 

    From what you describe, the step wise governor will keep switching OPP to lower frequency until 58 degree (in current setting case). 

    The same, the governor will also keep switching OPP from lower to max frequency after temperature lower than 58 degree. Right? 

    BR, Rich

  • That's correct. 

    Step wise governor keeps switching to lower frequencies until the '60 - hyst' temperature is reached. Once the system cools below that temperature the Linux thermal framework automatically increases the frequency.

    That's what I have explained above. 

    Best Regards,

    Keerthy 

  • Hi Keerthy,

    when I compile this patch, it has a errer message:

    ../arch/arm64/boot/dts/ti/k3-am62p-j722s-common-thermal.dtsi:29.9-36.6: Warning (cooling_device_property): /thermal-zones/main0-thermal/cooling-maps/map0: Missing property '#cooling-cells' in node /cpus/cpu@0 or bad phandle (referred from cooling-device[0])

    but I see it has  #cooling-cells = <2>; /* min followed by max */ in the k3-j722s.dtsi file, why is it?

  • it is Warning, iWill it have any impact? I try it

  • Rich,

    I have answered that. Closing this thread as the DFS is functional based on temperature.

    - Keerthy

  • Hi Keerthy,

        Whrn I used this patch to SDK 10, the CPU freq can't get 1.4G, can you give new patch for SDK 10? thanks

  •  RE: AM67: How to change AM67x CPU clock to 1.4Ghz 

    The above post was made on 11.0 SDK. I recommend using the latest SDK.

    - Keerthy

  • Hi Keerthy,

        we want used this patch on the SDK 10.0 only, Is it extracted sdk11 patch for sdk10?

        Thanks

  • Hi,

    This is based on 11.0 which is the latest SDK. You will need to back port that to 10.x SDK. Please check on the functionality on 11.0 and then back port.

    Best Regards,

    Keerthy