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.

AM5728: MPU frequencies

Part Number: AM5728


Hello,


I am using AM572X EVM. The available frequencies seems to be only 3, according to the following command. So, is AM572x series of processors not capable to operate in lower frequencies? or is it a limitation of the Matrix UI's kernel? If I were to change the kernel or flash a different distro like debian would other frequency modes be available at userspace?

root@am57xx-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
1000000 1176000 1500000

  • Hi,

    These three frequencies are the maximums allowed for the OPP_NOM, OPP_OD and OPP_HIGH operating performance points respectively. The DVFS governor in use will scale up/down the frequency as needed. See processors.wiki.ti.com/.../Linux_Core_Power_Management_User's_Guide_(v4.1) for more information.
  • Hello,

    Ah, I thought, issuing this command "
    root@am57xx-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies" should list all the available frequencies. You are saying that these are the "maximum" allowed frequencies in OPP_NOM, OPP_OD and OPP_HIGH operating performance points respectively. How (which command) can I see all the available frequencies for each of those OPP's? How do I pin down a particular OPP during experimentation so that it does not change during the software execution? I am sorry, if I have understood it incorrectly.
  • By choosing the governor. This is also described in the link I posted.
  • I am sorry, but changing the governor does not seem to change it. It shows the exact same available scaling frequencies for all the frequency governors.

    root@am57xx-evm:/# uname -a
    Linux am57xx-evm 4.4.32-gadde2ca9f8 #1 SMP PREEMPT Wed Dec 14 19:14:12 EST 2016 armv7l GNU/Linux
    root@am57xx-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
    conservative userspace powersave ondemand performance
    root@am57xx-evm:~# echo conservative > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    root@am57xx-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    conservative
    root@am57xx-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
    1000000 1176000 1500000
    root@am57xx-evm:~# echo userspace > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    root@am57xx-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    userspace
    root@am57xx-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
    1000000 1176000 1500000
    root@am57xx-evm:~# echo powersave > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    root@am57xx-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    powersave
    root@am57xx-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
    1000000 1176000 1500000
    root@am57xx-evm:~# echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    root@am57xx-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    ondemand
    root@am57xx-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
    1000000 1176000 1500000
    root@am57xx-evm:~# echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    root@am57xx-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    performance
    root@am57xx-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
    1000000 1176000 1500000

    I am using Matrix linux. Is it because of that?
  • Hi Kameswar,

    KameswarRao Vaddina said:
    root@am57xx-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
    1000000 1176000 1500000

    By default we have only these 3 frequencies available for AM57x Cortex-A15 MPU. Do you expect to see there all the available frequencies with 1Hz offset? Please let me know which OPP and which frequency exactly you need to setup.

    KameswarRao Vaddina said:
    I am using Matrix linux. Is it because of that?

    No. Matrix GUI has nothing in common with the DVFS available frequencies.

    Regards,
    Pavel

  • >>By default we have only these 3 frequencies available for AM57x Cortex-A15 MPU. Do you expect to see there all the available frequencies with 1Hz offset? Please let me know which OPP and which frequency exactly you need to setup.

    I am expecting to take it to 200MHz with 100MHz offset and all the way up to the max which is 1.5G. I mean, I need all the available frequencies from 200 MHz to 1.5 GHz with 100MHz offset. At the same time I would also like to vary the operating points as well. I am monitoring power consumption while varying the frequencies and OPP's.

  • KameswarRao Vaddina said:
    I am expecting to take it to 200MHz with 100MHz offset and all the way up to the max which is 1.5G. I mean, I need all the available frequencies from 200 MHz to 1.5 GHz with 100MHz offset. At the same time I would also like to vary the operating points as well. I am monitoring power consumption while varying the frequencies and OPP's.

    In this case you should update the opp table with all the frequencies you need, as we have only 3 default frequencies there.

    http://processors.wiki.ti.com/index.php/Linux_Core_Power_Management_User's_Guide_%28v4.4%29#Operating_Points

    linux-4.4.32/arch/arm/boot/dts/dra7.dtsi

    Regarding the OPP switch, this should be done automatically corresponding to the frequency switch. You can double check this monitoring the voltage you have for every frequency:

    View the current voltage:

    target# cat /sys/class/regulator/regulator.3/microvolts

    Regarding AM57x power consumption, we have info in the below wiki pages:

    Regards,
    Pavel

  • Thank you very much Pavel for the detailed reply.

    >>In this case you should update the opp table with all the frequencies you need, as we have only 3 default frequencies there.

    1) So, I have to update the opp table and re-flash the sdcard right using the "create-sdcard.sh" script? right?

    2) Regarding updating the OPP table: What are the corresponding voltage values I should use? I mean "opp-microvolt" field. If the voltage is also not scaled according to the frequency, then the power values will not be accurate/relevant at all.


    Can you please provide me with an example of an OPP table? Would the following sound right? I am using the same Voltage values though. Also, not sure about the "opp-supported-hw" hex field and opp-suspend.


                    opp_200@200000000 {
                            opp-hz = /bits/ 64 <200000000>;
                            opp-microvolt = <1060000 850000 1150000>;
                            opp-supported-hw = <0xFF 0x01>;
                            opp-suspend;
                    };


                    opp_300@300000000 {
                            opp-hz = /bits/ 64 <300000000>;
                            opp-microvolt = <1060000 850000 1150000>;
                            opp-supported-hw = <0xFF 0x01>;
                            opp-suspend;
                    };

  • Kames said:
    1) So, I have to update the opp table and re-flash the sdcard right using the "create-sdcard.sh" script? right?

    You have to update the opp table in DTS file and reflash the resulted DTB file in the SD card. You can do this manually or with create-sdcard.sh script

    Kames said:
    2) Regarding updating the OPP table: What are the corresponding voltage values I should use?

    From 200MHz to 1000MHz, you should use voltage corresponding to OPP_NOM

    From 1100MHz to 1176MHz, you should use voltage corresponding to OPP_OD

    From 1200MHz to 1500MHz, you should use voltage corresponding to OPP_HIGH

    Kames said:
    Can you please provide me with an example of an OPP table? Would the following sound right?

    Kames said:

      opp_200@200000000 {
                            opp-hz = /bits/ 64 <200000000>;
                            opp-microvolt = <1060000 850000 1150000>;
                            opp-supported-hw = <0xFF 0x01>;
                            opp-suspend;
                    };


                    opp_300@300000000 {
                            opp-hz = /bits/ 64 <300000000>;
                            opp-microvolt = <1060000 850000 1150000>;
                            opp-supported-hw = <0xFF 0x01>;
                            opp-suspend;
                    };

    I think these should be:

    opp_nom@200000000 {
                            opp-hz = /bits/ 64 <200000000>;
                            opp-microvolt = <1060000 850000 1150000>;
                            opp-supported-hw = <0xFF 0x01>;
                            opp-suspend;
                    };


                    opp_nom@300000000 {
                            opp-hz = /bits/ 64 <300000000>;
                            opp-microvolt = <1060000 850000 1150000>;
                            opp-supported-hw = <0xFF 0x01>;
                            opp-suspend;
                    };

  • Hello Pavel,

    Thanks a lot for your reply. I updated the dts file and flashed the resultant dtb file to the sdcard. I have now access to lower frequencies. The dts file and the curves (benchmark = bit-reverse) I plotted are in the following link. I am measuring the CPU power consumption with NI DAQ by measuring the voltage drop across the resistor R34 (VDD_MPU, 0.01 Ohm).


    drive.google.com/open

    My questions:

    1) There seems to be a major jump in power consumption from 1176 MHz to 1200 MHz. I understand that the voltage has increased. But for a modern SoC platform do you see this huge and sudden jump viable or OK? What could be the motivation for this?

    2) Just for the experimentation would the platform allow me to keep the voltages same (either nominal or high) for the entire range of frequencies (from 100 MHz to 1500 MHz)? That means, can I keep "opp-microvolt = <1210000 950000 1250000>" the same from 100 MHz to 1500 MHz?

    3) Am I right in assuming that for "opp-microvolt = <1210000 950000 1250000>", the numbers represent target frequency, minimum frequency and maximum frequency?

  • Kames,

    Kames said:
    I updated the dts file and flashed the resultant dtb file to the sdcard. I have now access to lower frequencies.

    Can you provide me below registers value for every frequency you are using (100MHz, 200MHz, 300MHz, etc):

    CM_CLKSEL_DPLL_MPU/0x4A00516C

    CM_DIV_M2_DPLL_MPU/0x4A005170

    How do you verify you have the correct voltage value for every frequency you are using? Do you monitor /sys/class/regulator/regulator.3/microvolts ?

    Kames said:
    1) There seems to be a major jump in power consumption from 1176 MHz to 1200 MHz. I understand that the voltage has increased. But for a modern SoC platform do you see this huge and sudden jump viable or OK? What could be the motivation for this?

    I will check this and come back to you when I have something.

    Kames said:
    2) Just for the experimentation would the platform allow me to keep the voltages same (either nominal or high) for the entire range of frequencies (from 100 MHz to 1500 MHz)? That means, can I keep "opp-microvolt = <1210000 950000 1250000>" the same from 100 MHz to 1500 MHz?

    Yes. You can use opp_high voltage level for opp_od and opp_nom frequencies.

    Kames said:
    3) Am I right in assuming that for "opp-microvolt = <1210000 950000 1250000>", the numbers represent target frequency, minimum frequency and maximum frequency?

    Yes. For more info see AM572x DM, table 5-7 and table note (5)

    Regards,
    Pavel

  • Kames said:
    1) There seems to be a major jump in power consumption from 1176 MHz to 1200 MHz. I understand that the voltage has increased. But for a modern SoC platform do you see this huge and sudden jump viable or OK? What could be the motivation for this?

    Power consumption depends also on the use case. For example, in OS Idle use case, at MPU OPP_OD we have 2433.7mW, at MPU OPP_HIGH we have 2679.1mW. In Dhrystone Single Core use case, at MPU OPP_OD we have 3514.6mW, at MPU OPP_HIGH we have 4194.7mW.

    See the below wiki page:

    processors.wiki.ti.com/.../AM57xx_Power_Consumption_Summary

  • >> Can you provide me below registers value for every frequency you are using (100MHz, 200MHz, 300MHz, etc):
    >> CM_CLKSEL_DPLL_MPU/0x4A00516C
    >> CM_DIV_M2_DPLL_MPU/0x4A005170

    I am sorry, but how do I check the values of those registers from the command line (or within the shell script)?

    >> How do you verify you have the correct voltage value for every frequency you are using? Do you monitor /sys/class/regulator/regulator.3/microvolts ?

    I did not verify it. I just verified that the frequencies are changing and also the time consumed to run the benchmark is in accordance with the frequencies. But just now, when I do "watch -n 0.1 cat /sys/class/regulator/regulator.3/microvolts", while running my script, it shows a constant 3300000. Can you confirm if the one we have to monitor is for regulator.3?

    I should also add that I am running the benchmark on only one core (cpu0) after pinning it with taskset. The second CPU is doing nothing for the time being.

    Also, when I monitor "cat /sys/class/regulator/regulator.5/microvolts", I am getting the following..

    100M - 1G: 980000

    1G - 1.176G: 1090000

    1.2G - 1.5G: 1230000

  • Kames said:
    >> Can you provide me below registers value for every frequency you are using (100MHz, 200MHz, 300MHz, etc):
    >> CM_CLKSEL_DPLL_MPU/0x4A00516C
    >> CM_DIV_M2_DPLL_MPU/0x4A005170

    I am sorry, but how do I check the values of those registers from the command line (or within the shell script)?

    You can use devmem2 user space tool.

    Kames said:
    But just now, when I do "watch -n 0.1 cat /sys/class/regulator/regulator.3/microvolts", while running my script, it shows a constant 3300000. Can you confirm if the one we have to monitor is for regulator.3?

    I will check and come back to you.

    Kames said:
    I should also add that I am running the benchmark on only one core (cpu0) after pinning it with taskset. The second CPU is doing nothing for the time being.

    Check "Dhrystone - Single Core" - In this measurement, the Dhrystone benchmark application is running on single Coretex-A15 core. In Dhrystone Single Core use case, at MPU OPP_OD we have 3514.6mW, at MPU OPP_HIGH we have 4194.7mW

    Regards,
    Pavel

  • Kames said:

    Also, when I monitor "cat /sys/class/regulator/regulator.5/microvolts", I am getting the following..

    100M - 1G: 980000

    1G - 1.176G: 1090000

    1.2G - 1.5G: 1230000

    Yes, it looks like regulator.5 should be used. On my AM572x TI EVM I have there:

    1000MHz : 1010000  (1.01V)

    1176MHz : 1030000 (1.03V)

    1500MHz: 1190000 (1.19V)

    Regards,
    Pavel

  • Thank you very much Pavel for confirming it. I did an experiment today by fixing the voltage for the entire frequency range to OPP_HIGH. The power curve does not have huge jump (from 1176 MHz to 1200 MHz) like the one in the earlier curves I sent.

    An interesting phenomenon can be seen in the energy plot. I am investigating the existence of minimum energy point for CPU (prior literature also exists on this; see the link below). That is, there exists a frequency point where the energy consumption of the CPU for a program run is minimal. That means, if performance is not an issue, then we can run the CPU at the minimal point to save energy. As you can see in the curves I plotted in the link below (U-shaped part of the energy consumption plot)

    drive.google.com/.../0BzoIenLKgsD5RjFRTzYyQjRoYTA

    I am attributing this increase in energy consumption at lower frequencies to the increase in leakage power. Do you agree? Are there any other contributing factors apart from leakage power?

  • Kames,

    Maximum power consumption for this SoC depends on the specific use conditions for the end system.

    More information regarding leakage and other factors, you can find in AM572x TRM, chapter 3 Power, Reset, and Clock Management

    Regards,
    Pavel