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/AM4378: Configuring CPU frequency in U-boot

Part Number: AM4378


Tool/software: Linux

My target: To keep my system more stable and chip more cool, I try to decrease my cpu frequency. 

uboot version: 201507

When I read my CPU frequency with 'cat /proc/cpuinfo', I get my bogomips as 1993.93. Then, I check my cpu frequency in uboot/arch/arm/cpu/armv7/am33xx/board.c----->am33xx_spl_board_init------->do_setup_dpll(dpll_core_opp100)/do_setup_dpll(dpll_mpu_opp100), It seems my cpu running at 1GHz, So I try to update it to 720M with below:

--- a/arch/arm/cpu/armv7/am33xx/clock_am33xx.c
+++ b/arch/arm/cpu/armv7/am33xx/clock_am33xx.c
@@ -54,7 +54,7 @@ const struct dpll_regs dpll_ddr_regs = {
 struct dpll_params dpll_mpu_opp100 = {
                CONFIG_SYS_MPUCLK, OSC-1, 1, -1, -1, -1, -1};
 const struct dpll_params dpll_core_opp100 = {
-               1000, OSC-1, -1, -1, 10, 8, 4};
+               /*1000*/720, OSC-1, -1, -1, 10, 8, 4};
 const struct dpll_params dpll_mpu = {
                MPUPLL_M_300, OSC-1, 1, -1, -1, -1, -1};
 const struct dpll_params dpll_core = {




After this, I execute 'cat /proc/cpuinfo', bogomips keeps 1993.93, It seems to have no changing. So can someone tell me how to change frequency of cpu.

PS: I have no cpufreq folder in /sys/....../cpu0, So I give up this methods.

Thanks for any help

  • After this, I execute 'cat /proc/cpuinfo', bogomips keeps 1993.93, It seems to have no changing. So can someone tell me how to change frequency of cpu.PS: I have no cpufreq folder in /sys/....../cpu0, So I give up this methods.Thanks for any help
  • The software team have been notified. They will respond here.
  • Hi Aaron,

    Are you sure that you have made the changes in the right file /arch/arm/cpu/armv7/am33xx/clock_am33xx.c instead of clock_am43xx.c ?
    Also I suggest you to add cpufreq-stats support in your kernel to get ability to observe and configure cpu frequency by adding the following configuration to your kernel config:
    Config Main Menu
    CPU Power management --->
       CPU Frequency scaling --->
         [*] CPU Frequency scaling
        [*] CPU frequency translation statistics
        [*] CPU frequency translation statistics details
        Default CPUFreq governor (ondemand) --->
        -*- 'performance' governor
         <*> 'powersave' governor
         <*> 'userspace' governor for userspace frequency scaling
        -*- 'ondemand' cpufreq policy governor
         <*> 'conservative' cpufreq governor
        *** CPU frequency scaling drivers ***
        <*> Generic DT based cpufreq driver
        < > Generic ARM big LITTLE CPUfreq driver
        [ ] TI OMAP2+
        <*> Texas Instruments CPUFreq support
        < > CPU frequency scaling driver for Freescale QorIQ SoCs

    "CPU Frequency scaling" (CONFIG_CPU_FREQ) should be enabled to configure cpufreq-stats.
    "CPU frequency translation statistics" (CONFIG_CPU_FREQ_STAT) provides the statistics which includes time_in_state, total_trans and trans_table.
    Once this option is enabled and your CPU supports cpufrequency, you will be able to see the CPU frequency statistics in /sysfs.

    BR
    Tsvetolin Shulev

  • I am not trying to add cpufreq to kernel, and I am intending to modify cpu frequency in uboot.
    Can you directly tell me where should I modify code in uboot.
    clocks_am33xx.c is not built in uboot actually, but i also cannot find dpll_core_opp100 in clock_am43xx.c.

    Thank you very much.
  • Hi Aaron,

    For checking and changing Cortex-A9 CPU frequency in u-boot, refer to the below files:

    u-boot/arch/arm/cpu/armv7/am33xx/clock_am43xx.c
    u-boot/arch/arm/cpu/armv7/omap-common/clocks-common.c
    u-boot/board/ti/am43xx/board.c

    You can check registers PRCM_CM_CLKSEL_DPLL_MPU (0x44DF2800 + 0x560) and PRCM_CM_DIV_M2_DPLL_MPU (0x44DF2800 + 0x570) from the u-boot prompt with "md" command and thus get M,N and M2 values. Then you can calculate the CPU frequency according to the formula provided in AM437x TRM (section 6.6.3 ADPLLS).

    You need also define what is the DPLL_MPU input frequency. It is based on main OSC frequency, which is 24MHz on the TI EVM.

    Regards,
    Pavel