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 Max Frequency Change

Other Parts Discussed in Thread: AM5728

Hi All,

The AM5728 works at 3 operating points with maximum frequency of 1.5GHz at OPP_HIGH.

I would like to know how I can set the frequency to 1.3GHz at OPP_HIGH.

Can anyone please help me out with this.

Regards

Ayusman

  • Hi Ayusman,

    Have you tried changing the omap_opp_def dra7xx_es1_0_opp_list[] __initdata structucture in arch/arm/mach-omap2/opp7xx_data.c:
    /*
    * We only include OPP_OD and OPP_HIGH here, OPP_NOM is common to all
    * variants and left to be supplied by DT.
    */
    static struct omap_opp_def dra7xx_es1_0_opp_list[] __initdata = {
              /* MPU OPP - OPP_OD */
              OPP_INITIALIZER("mpu", false, 1176000000, 1160000),
               /* MPU OPP - OPP_HIGH */
              OPP_INITIALIZER("mpu", false, 1500000000, 1210000),
    };

    OPP_NOM is defined in dra74x.dtsi:
        operating-points = <
               /* kHz uV */
               1000000 1060000
         >;

    Best Regards,
    Yordan

  • Hi Yordan,

    Thanks. We will try this out and let you know.
    Also I see that we need to pass the clock frequency and the voltage as parameters. I would like to know what procedure should i follow to derive the required voltage for any given clock frequency.

    Regards
    Ayusman
  • Hi Ayusman,

    Follow the recommendations in AM572x DM, Table 5-7. Voltage Domains Operating Performance Points. The table describes MPU_VD voltage levels for the corresponding OPP.

    Best Regards,
    Yordan

  • Hi Yordan,

    I have gone through the table. However what I am looking for is the voltage to frequency relationship which I can use to set the register as shown in the code snippet shared by you.

    My requirement is to set the OPP_HIGH at a lower clock frequency than 1.5GHz. For example, if I want to set it to 1.35GHz can you please let me know what will be the corresponding voltage ?

    Regards
    Ayusman
  • Hi Yordan,

    Did you get a chance to go through my previous message.

    Regards
    Ayusman
  • Hi,

    For the MPU, it is stated that in OPP_HIGH, the voltage should be equal to the AVS voltage.
    So you can set frequency to 1.35 & whatever voltage you like in the rage of 0.95 V - 1.25 V (AVS voltage for VD_MPU).
    I recommend to change only the frequency to 1.35GHz & keep the default kernel setting for the voltage (1.21 V, as defined in omap_opp_def dra7xx_es1_0_opp_list).

    Best Regards,
    Yordan
  • Hi,

    I tried with the changes suggested but it didnot work. When I set the frequency to 1.35Ghz it always sets to 1.176Ghz. Do you have any idea why this doesnot work?

    Regards
    Ayusman
  • Hi Ayusman,

    I'll test it on my AM57xx GP EVM & post the feedback.
    Have you changed anything else in the kernel sources?

    Best Regards,
    Yordan
  • Hi,

    This is because you probably didn't change the following part of opp7xx_data.c:

      case EFUSE_HAS_HIGH_MPU_OPP:

               opp_def_list_enable_opp(dra7xx_es1_0_opp_list,

                                                         ARRAY_SIZE(dra7xx_es1_0_opp_list),

                                                         "mpu", 1500000000, true);

    to

     case EFUSE_HAS_HIGH_MPU_OPP:

              opp_def_list_enable_opp(dra7xx_es1_0_opp_list,

                                                        ARRAY_SIZE(dra7xx_es1_0_opp_list),

                                                        "mpu", 1350000000, true); 

    After this modification, I booted my AM57xx GP EVM and executed bellow commands: 

    root@am57xx-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq 

       1000000

    root@am57xx-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors

       conservative userspace powersave ondemand performance 

    root@am57xx-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 

       ondemand 

    As you can see by default the CPU works on 1GHz. However I can see all my frequency definitions done in opp7xx_data.c: 

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

       1000000 1176000 1350000

    And I am able to change the frequency, once I pass the control to userspace governor: 

    root@am57xx-evm:~# echo userspace > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

    root@am57xx-evm:~#  echo 1350000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed

    root@am57xx-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
        1350000

    So, as you can see, the following changes: 

    static struct omap_opp_def dra7xx_es1_0_opp_list[] __initdata = {
        /* MPU OPP - OPP_OD */
        OPP_INITIALIZER("mpu", false, 1176000000, 1160000),
        /* MPU OPP - OPP_HIGH */
        /*OPP_INITIALIZER("mpu", false, 1500000000, 1210000),*/
         OPP_INITIALIZER("mpu", false, 1350000000, 1210000),
    };

    case EFUSE_HAS_HIGH_MPU_OPP:
              opp_def_list_enable_opp(dra7xx_es1_0_opp_list,
                                                        ARRAY_SIZE(dra7xx_es1_0_opp_list),
                                                        "mpu", 1350000000, true); 

    Are enough  to change OPP_HIGH to 1.35GHz

    Best Regards, 
    Yordan

  • Hi Yordan,

    Thanks, I will test with these changes and get back to you in case I need any help.

    Regards
    Ayusman