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.

AM3352: Configure CPU frequency to Turbo Mode 800 MHZ

Part Number: AM3352

Hi,

I follow the below link and try to set MPU frequency from 600M Hz to 800M Hz.

https://software-dl.ti.com/processor-sdk-linux/esd/docs/latest/linux/Foundational_Components/Kernel/Kernel_Drivers/Power_Management.html

But I got logs as following,

$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_freque
300000 600000 720000 800000 1000000

$ cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
600000

$ echo 800000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
-sh: echo: write error: Invalid argument

Could you tell me how to configure frequency from 600M to 800M even 1000M Hz?

Thanks.

  • Hi,
    By default, DVFS governor state is "ondemand", where this governor samples the load of the cpu and scales it up aggressively in order to provide the proper amount of processing power. In order to select the desired OPP or speed, the governor needs to be changed to "userspace", where this governor allows the user to set the desired OPP using any value found within scaling_available_frequencies by echoing it into scaling_setspeed.
    I'm attaching a sample log for your reference,
    Best,
    -Hong

    root@am335x-evm:~# uname -a
    Linux am335x-evm 4.19.94-gbe5389fd85 #1 PREEMPT Thu Oct 29 16:23:07 CDT 2020 armv7l GNU/Linux
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_freequencies
    300000 600000 720000 800000 
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
    720000
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
    cpufreq-dt
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/stats/trans_table
       From  :    To
             :    300000    600000    720000    800000 
       300000:         0        53         9        28 
       600000:        50         0        15        39 
       720000:        16        13         0        31 
       800000:        25        37        36         0 
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state
    300000 28780
    600000 441
    720000 220
    800000 3762
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
    600000
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    ondemand
    root@am335x-evm:~# echo userspace > /sys/devices/system/cpu/cpu0/cpufreq/scaling__governor
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
    300000
    root@am335x-evm:~# echo 800000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_settspeed
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
    800000
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/stats/trans_table
       From  :    To
             :    300000    600000    720000    800000 
       300000:         0        58        10        33 
       600000:        55         0        15        40 
       720000:        18        13         0        32 
       800000:        28        38        38         0 
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state
    300000 35230
    600000 457
    720000 222
    800000 8452
    root@am335x-evm:~# 

  • Hi Hong,

    The solution do modify the MPU frequency temporarily. After I reboot the Starter Kit, the frequency is set to default value 600M HZ.

    Do you know how to keep it permanent?

  • Hi Woody,
    The "ondemand" governor is one of widely selected DVFS scheme as it dynamically adjusts OPP/speed vs CPU loading for power saving.
    To fix OPP/speed, one option is changing the governor to "userspace", and set the desired OPP/speed, then the selected OPP/speed would be fixed until
    user re-select it.
    Best,
    -Hong

  • Hi Hong,

    Could you also provide the steps of how to change "governor" to "userspace" ?

    Thanks.

  • Hi Woody,
    Will you be able to run the followings?
    echo userspace > /sys/devices/system/cpu/cpu0/cpufreq/scaling__governor
    echo 600000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_settspeed
    Best,
    -Hong

  • Hi Hong,

    Yes, I can follow the steps to config frequency.

    Do you know how to make it through bitbake/recipes way?

    Or I can write these commands into /etc/rc.local to make it happen after I  re-flash zImage?

    What I want to do is config freq. once when I boot-up the device first time.

    Thanks.