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.

How to configure AM3874 to use the highest CPU frequency for both 800MHz and 1GHz

Other Parts Discussed in Thread: AM3874

Hello,

We are using both the 800MHz and 1GHz version of the AM3874 on our boards.  I am trying to follow the TI forum post to configure the AM3874 to its highest capable CPU frequency by changing MODENA_M in u-boot and configuring the TPS659113 device.  See the post below:

http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/t/204555.aspx

However, it looks like the AM3874 is always getting configured for 1 GHz even if the highest CPU speed for the chip is only 800 MHz (AM3874BCYE80).  This looks wrong.

Does TI have documentation on how to do increase the CPU frequency properly?

I want to have the same u-boot/linux kernel image for both the 800 MHz and 1 GHz versions of our board.  That means, I can’t hardcode some values like the MODENA_M so that it calculates the frequency correctly.

I appreciate any help with this.

Thanks,
Maynard
 

  • Hi Maynard,

    For 800MHz, you should use 0x50 value (not 0x64).

    #define MODENA_M    0x50 //0x3C

    0x3C (60) for 600MHz.

    0x50 (80) for 800MHz.

    0x64 (100) for 1000MHz/1GHz.

    Maynard Cabiente said:
    I want to have the same u-boot/linux kernel image for both the 800 MHz and 1 GHz versions of our board.  That means, I can’t hardcode some values like the MODENA_M so that it calculates the frequency correctly.

    I do not think u-boot is able to distinguish between AM3874BCYE80 and AM3874BCYE100 devices.

    BR
    Pavel

  • Hi Pavel,

    Thanks for giving me the correct value for all the desired frequencies.

    A few more questions so that I can fully resolve this issue.

    1. I guess the linux driver for Dynamic Voltage and Frequency scaling (DVFS) has a bug on it.  When using this feature in linux, AM8374BCYE80 will also be configured as 1 GHz instead of the 800 MHz.  Verified by reading /proc/cpuinfo.  I'm assuming that if I want to keep using it, I have to fix this issue.  Is this correct?  I am just following the DVFS information in this link:

    http://processors.wiki.ti.com/index.php/TI81XX_PSP_PM_DVFS_User_Guide#Frequency_Scaling

    2. I know that u-boot does not support the determination of CYE80 and CYE100 devices.  Would you know of a AM3874 register that may distinguish these two devices?  I really don't want to have 2 u-boot images to support both devices.  If nothing else, we can use GPIO pin to determine which chip we are using and modify u-boot to look at that specific GPIO pin before using MODENA_M.

    3. If u-boot is already configured for the desired frequency (e.g. 1 GHz), can I stop using the Dynamic Voltage Frequency scaling in linux?  I'm asking because it looks like this DVFS is configuring the TPS659113 chip more than what I'm trying to do in u-boot.  So, I don't know if I should rely on linux DVFS or just u-boot configuration is good enough.

    Regards,
    Maynard
     

  • Maynard,

    Maynard Cabiente said:
    1. I guess the linux driver for Dynamic Voltage and Frequency scaling (DVFS) has a bug on it.  When using this feature in linux, AM8374BCYE80 will also be configured as 1 GHz instead of the 800 MHz.  Verified by reading /proc/cpuinfo.  I'm assuming that if I want to keep using it, I have to fix this issue.  Is this correct?

    Could you please provide more details. Do you mean that you are configuring the device for 800MHz and then the DVFS increase the CPU frequency from 800MHz to 1GHz?

    Maynard Cabiente said:
    2. I know that u-boot does not support the determination of CYE80 and CYE100 devices.  Would you know of a AM3874 register that may distinguish these two devices?

    I have checked the AM387x registers (described in the TRM), with focus on the Control Module registers, but I can not find such a register. I will double check with the Sitara team and let you know their answer.

    Maynard Cabiente said:
    3. If u-boot is already configured for the desired frequency (e.g. 1 GHz), can I stop using the Dynamic Voltage Frequency scaling in linux?

    I think you can, the DVFS is not mandatory, the default kernel config (ti8148_evm_defconfig) does not support DFVS (CPUFreq), you should enable it explicitly. Without DVFS you will have higher power consumption. See AM387x TRM, section 2.1.4.3.1 Dynamic Voltage and Frequency Scaling, Figure 2-5. Comparison of Energy Consumed With/Without DVFS.

    Regards,
    Pavel


  • Hi Pavel,

    Currently, the AM3874 is just coming up with default 600MHz CPU clock, 400MHz DDR clock.  When linux boots up, the DVFS is configured to have a default of performance governor.  In the DVFS kernel configuration, there is no option to select the maximum CPU speed.  It looks like the values that are being programmed into the TPS659113 are always for the 1 GHz version of the AM387x/DM814x regardless if the chip is CYE100 or CYE80.

    Thanks for checking out the registers.  I tried doing that but couldn't find a register that has a chip speed determination.

     Thank you for all the support you have given so far.

    Regards,
    Maynard
     

  • Maynard,

    We have a bug with a patch fixing it, which might be the root cause.

    http://processors.wiki.ti.com/index.php/TI81XX_PSP_04.04.00.01_Release_Notes

    DVFS/CLOCK: A fix for frequency scaling of ARM not working issue ( SDCM00089416) is available as a patch over the release package for 04.04.00.01. This can be downloaded from ARM PLL frequency change fix

    http://arago-project.org/git/projects/?p=linux-omap3.git;a=commitdiff_plain;h=10d3731856fcfe71bbea3b256248f5d4a0974c03;hp=5b847011dceb8e2d323f28aae4e664c6bef65964

    Could you try fixing your issue with this patch.

    Best regards,
    Pavel

  • Hi Pavel,

    This patch is already in our codebase.  So, it does not fix the CYE80 CPU speed being set to 1GHz instead of 800MHz.  There is probably a setting there similar to u-boot (MODEN_A) that is hardcoded for 1GHz instead of dynamically setting it to the appropriate maximum CPU speed.

    Regards,
    Maynard
     

  • Maynard,

    Coming back to the CYE80 and CYE100 identifying register, we have such in AM335x device:

    http://www.ti.com/lit/ug/spruh73h/spruh73h.pdf

    EFUSE_SMA[12:0] ARM_MPU_MAX_FREQ - Designates the ARM MPU maximum frequency supported by the device

    0x1E2F - 800 MHz ARM MPU Maximum

    0x1C2F - 1 GHz ARM MPU Maximum

    But we do not have EFUSE_SMA register in AM387x device, for all the silicon revisions of the AM387x device.

    As we do not have a register(not documented anywhere in TRM)  to identify variations of the silicon at runtime we have chosen the frequencies as per then customer use case.

    A simple solution can be as below:
     
    1.       The following file contains the OPP table:
     
    arch/arm/mach-omap2/opp814x_data.c
     
    You can add the new OPPs to the above table if required.
     
    For example an OPP for 800MHz  can be added.
     
    static struct omap_opp_def __initdata ti814x_opp_def_list[] = {
            /* Disabling OPP50/120 and keep system default/reset voltage as
             * enough testing is not done
             * and may cause system instability on some boards
             */
            OPP_INITIALIZER("mpu", true, 600000000, 1100000),
            /* MPU OPP2 - OPP 100 */
            OPP_INITIALIZER("mpu", false, 720000000, 1200000),
    /* New OPP */
            OPP_INITIALIZER("mpu", true, 800000000, uvolts),
            /* MPU OPP3 - OPP 120 */
            OPP_INITIALIZER("mpu", true, 1000000000, 1350000),
     
    };
     
     
    2.       “performance” governor always choses the highest available frequency so to prevent going to 1GHz,  
    you can change the default governor to “userspace” through menuconfig as mentioned in http://processors.wiki.ti.com/index.php/TI81XX_PSP_PM_DVFS_User_Guide#Default_Governor

    When using “userspace” governor the device comes up at the lowest opp and then user can chose to change the frequency through sysfs entries - http://processors.wiki.ti.com/index.php/TI81XX_PSP_PM_DVFS_User_Guide#Transitioning_to_a_different_Power_state.28OPPs.29


    Best regards,
    Pavel
  • Hi Pavel,

    Yeah, that's too bad that the System Engineers did not think about this max frequency determination in AM3874.  But, at least they did it for a newer chip.

    I tried your solution for supporting the 800MHz CPU frequency and that seems to work.

    Thanks for all the support that you have given.  It's been really helpful.

    Regards,
    Maynard