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.

Set CPU frequency/clock at Kernel level

Expert 2280 points
Other Parts Discussed in Thread: TPS65217

Hi all,

I would like to run some performance tests at different CPU frequency values on a Beaglebone board.

I had a look around and it seems cpu frequency setting for AM335x is not yet supported at Kernel level in latest SDK 05.03.02.00 / PSP 04.06.00.03. Correct? Is it just a matter of Kernel configuration or are some pieces of code missing? I've found just this work in progress page but it does not help.

Is there any other way to set CPU frequency? I see the SPL seems to set it to 720 or 500 MHz depending on the power source (adapter or usb). Any suggestion?

Thanks in advance.
Regards,
Max

  • Max,

    The usual CPUFreq support is not yet implemented for AM335x.  We should have that support in the next SDK release, in the March timeframe.

    For now, your best option is to modify the SPL by hand and rebuild.  In board/ti/am335x/evm.c, look at the spl_board_init() function.  The "if" side of the statement deals with setting Beaglebone CPU frequency and voltage.  The "else" side takes care of the same for the EVM.

    In that code, be sure to set the appropriate MPU voltage along with the desired CPU frequency.  You can simply replace the parameters in the existing function calls without writing any lines of code.  Refer to the following table for the parameters:

    OPP Frequency ( passed to mpu_pll_config() )

    Beaglebone MPU Voltage Parameters
    (passed to tps65217_voltage_update())

    EVM MPU Voltage Parameters
    (passed to voltage_update())

    OPP50 MPUPLL_M_275 (275 MHz) use constant 0x02 (0.95V) PMIC_OP_REG_SEL_0_9_5 (equates to 0.95V)
    OPP100 MPUPLL_M_500 (500 MHz) use constant 0x08 (1.1V) PMIC_OP_REG_SEL_1_1_0 (1.1V)
    OPP120 MPUPLL_M_600 (600 MHz) use constant 0x0C (1.2V) PMIC_OP_REG_SEL_1_2_0 (1.2V)
    OPPTurbo MPUPLL_M_720 (720 MHz)

    DCDC_VOLT_SEL_1275MV (1.275V - only because the
    PMIC does not support 1.26V directly)

    PMIC_OP_REG_SEL_1_2_6 (1.26V)

    One other note: for OPP 50, the CORE voltage should be set to 0.95V.  For all other OPP's, the CORE voltage should be set to 1.1V.

    Regards,
    Greg

  • Hi Greg,

    I'm interested in the cpufreq support as well. Do you have a status update?

    Thanks!

    -Kyle

  • Hi all,

    We will need the OPP50 due to consumption constraints of our current application.

    But we got worried with two information in the AM335X datasheet (SPRS717C.pdf):

    - Section 5.3 (Ethernet Media Access Controller (EMAC)/Switch)

    "Operation of the Ethernet MAC/Switch is not supported for OPP50."

    - Section 5.4.1.1: (GPMC/NOR Flash—Synchronous Mode)
    "Synchronous mode is not supported for OPP50."

    Ethernet is vital in our design (2 10/100 ports) and we may need GPMC in synchronous mode.

    Are these limitations the final condition expected for AM335X ?

    Is there any workaround possible?

    Many thanks

    Rodrigo

  • These peripherals require the OPP100 operating voltage.  OPP50 defines a lower voltage operating point for AM335x which causes these limitations.

    The latest data sheet provides a 275MHz OPP100 option which does not have these limitations.

    Regards,
    Paul

  • Hi Paul,

    I have found the 275MHz OPP100(note 6) option in the  "Table 3-5. Operating Performance Points for ZCZ Package" from datasheet.

    - Could you confirm whether is this option that have no limitations for Ethernet and GPMC Synchronous mode?

    The Table also has a note: "(6) Applies to all orderable AM335x devices with a 275 MHz speed grade."

    - Does it mean that a part number terminated in 27 (DEVICE SPEED RANGE) is mandatory to have Ethernet and GPMC Synchronous mode fully functional and lower power consumption?

    Many thanks

    Rodrigo

  • Are there any news how to set the frequency?

  • Hello Does anyone have any answers to these questions?

  • Hi,

    I am interested in simply reading the current CPU frequency, e.g. by 'cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq', which is not available.

    Regards,
    Rainer

  • Hello Rainer,

    This will giving you a general (not precise) estimate of what your AM335x is running at.

    "cat /proc/cpuinfo "  , look for bogomips=****

     

    Best Regards,

    _Nic

  • In addition to the above,

    Please take a look at Supported Opps/Usage section in the following Wiki: http://processors.wiki.ti.com/index.php/AM335x_Power_Management_User_guide 

     

    Best Regards,

    Nic