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.

Linux/AM5726: Thermal monitoring and frequency measurements

Part Number: AM5726
Other Parts Discussed in Thread: AM5728, DRA752

Tool/software: Linux

Hi,

Please help us out with the questions below regarding thermal monitoring and frequency configuration on the AM572x IDK.

Best regards,

Joakim

---------

I have some questions regarding the Frequency configuration and the thermal monitoring on the AM5728 IDK.

I use the Kernel from the TI SDK 03.03.00.04.

-          Is CONFIG_DRA752_THERMAL the crucial switch for the overheating protection?

-          CONFIG_TI_THERMAL is the switch which allows to access the junction temperature by <cat /sys/class/thermal/thermal_zone0/temp>. But this switch is depending on CPU_THERMAL [=y] and CPU_THERMAL is described with “This implements the generic cpu cooling mechanism through frequency reduction.” If I understand it right this mechanism gets only active above a certain temperature threshold. However it is not possible to run the CPU on a constant frequency and read out junction temperature. Could this drivers be adapted by TI?

-          If I select the Performance Governor, <cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq> prints <1500000> and I measure with perf on an almost idle system a frequency around 10MHz. Is there a control algorithm which throttle the frequency down or is the core just set to an suspend state where no instructions are executed. How big does this affect the real time behavior?

  • Hi Joakim,

    This behaviour can be explained as performance on demand. The technical term is Smartreflex and power management. For more detail see the linked article:
    wiki.tiprocessors.com/.../Linux_Core_Power_Management_User's_Guide_(v4.1)

    BR
    Tsvetolin Shulev
  • Hi,

    Finally I could investigate some more about the linux kernel configuration.

     

    My setup:

    I got the latest linux source code from http://software-dl.ti.com/processor-sdk-linux-rt/esd/AM57X/latest/exports/am57xx-evm-linux-rt-sdk-src-03.03.00.04.tar.xz

    On my target when I do `uname –a`

    Linux sitara 4.4.41-rt50-g968d071ce9 #3 SMP PREEMPT RT Fri May 19 10:12:37 CEST 2017 armv7l GNU/Linux

    So we are working on the same git commit.

    I agree we have to disabled CONFIG_CPU_FREQ and CONFIG_CPU_IDLE to run the RT patched kernel. But we also would like to log the junction temperature to track the dependency of load, frequency and temperature. Until now we only found the possibility to read the temperature with <cat /sys/class/thermal/thermal_zone0/temp>  but this interface is only provided when TI_THERMAL is enabled. But TI_THERMAL depends on CPU_THERMAL which depends on CPU_FREQ.

    So is there another way to track the temperature without enabling any configuration of the CPU Power Management?

    Best regards,

    Joakim

  • Joakim,

    "I agree we have to disabled CONFIG_CPU_FREQ and CONFIG_CPU_IDLE to run the RT patched kernel. "

    From where you get this info? Are you planning to use ti-processor-sdk-linux-rt-am57xx-evm-03.03.00.04?

    When CPUFreq is used, by default the ondemand governor is selected. You can switch to userspace governor, thus MPU frequency will be be constant unless you decide to change it manually.

    Other approach can be to disable CPU_THERMAL and CPU_FREQ from linux kernel, then to enable only thrermal management in user space through sysfs entries, see wiki below:

    processors.wiki.ti.com/index.php/DRA7xx_GLSDK_7.02.00.02_Release_Notes#Known_Issues - GLSDK-1725

    See also if the below pointers will be in help:

    processors.wiki.ti.com/.../AM57x_Thermal_Considerations
    processors.wiki.ti.com/.../GLSDK_Thermal_framework

    Regards,
    Pavel
  • Hi Pavel,

    Yes we are working with the ti-processor-sdk-linux-rt-am57xx-evm-03.03.00.04 on the AM572x IDK.

    Pavel Botev said:
    Other approach can be to disable CPU_THERMAL and CPU_FREQ from linux kernel, then to enable only thrermal management in user space through sysfs entries

    /sys/class/thermal/thermal_zone0 is present but if I enable the thermal_zone0 ( echo -n "enabled" > /sys/class/thermal/thermal_zone0/mode)  it is still not possible to get the temperature.

    cat: /sys/class/thermal/thermal_zone0/temp: Invalid argument

    So this sysfs interface is only provided when TI_THERMAL is enabled as described above.

    Do we miss something to activate this interface?

    Thank you for the answer & regards Guy

    PS. Joakim and me are working together on this problem.

  • Guy,

    Guy Bilgerig said:
    /sys/class/thermal/thermal_zone0 is present but if I enable the thermal_zone0 ( echo -n "enabled" > /sys/class/thermal/thermal_zone0/mode)  it is still not possible to get the temperature.

    Can you check if "enabled" is actually set (cat the "mode" entry before and after "enabled")?

    Do you have also the below path available?

    /sys/devices/virtual/thermal/thermal_zone0/mode

    Regards,
    Pavel

  • Hi Pavel,

    Yes the mode is afterwards enabled and also the /sys/devices/virtual/thermal is present.

    root@sitara:/# cat /sys/class/thermal/thermal_zone0/mode
    disabled
    root@sitara:/# echo -n "enabled" > /sys/class/thermal/thermal_zone0/mode
    root@sitara:/# cat /sys/class/thermal/thermal_zone0/mode
    enabled
    root@sitara:/# cat /sys/class/thermal/thermal_zone0/temp
    cat: /sys/class/thermal/thermal_zone0/temp: Invalid argument
    root@sitara:/#
    
    root@sitara:/# cat /sys/devices/virtual/thermal/thermal_zone0/mode
    enabled
    root@sitara:/# cat /sys/devices/virtual/thermal/thermal_zone0/temp
    cat: /sys/devices/virtual/thermal/thermal_zone0/temp: Invalid argument

  • Hi Pavel,

    In another thread you recommended to use omapconf from TI. I saw that you also can use it to read out the temperature like this:

    user@sitara:~/omapconf$ sudo omapconf show temp mpu
    OMAPCONF (rev 1.73-nogit built Thu Jun 8 09:59:20 UTC 2017)
    
    HW Platform:
      Generic DRA74X (Flattened Device Tree)
      DRA75X ES2.0 GP Device (STANDARD performance (1.0GHz))
      TPS659038  ES2.2
    
    SW Build Details:
      Build:
        Version: Debian GNU/Linux 8
      Kernel:
        Version: 4.4.41-rt50-g968d071ce9
        Author: devel@debian
        Toolchain: gcc version 4.9.4 (Linaro GCC 4.9-2017.01)
        Type: #12 SMP PREEMPT RT
        Date: Wed Jun 7 16:47:59 CEST 2017
    
    51
    

    So actually this is also a way to get the temperature without the sysfs.. Anyhow is it possible to surpress the HW Platform and SW Build Details? So I just get 51 as an answer without parsing the output with another command?

    Regards Guy

  • Guy,

    Type "./omapconf --help" to get complete list of available commands and options.

    If there is no such option, than you should change the omapconf source and build new binary file.

    Regards,
    Pavel