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.

AM3354: Setting 600MHz MPU frequency in U-boot

Part Number: AM3354
Other Parts Discussed in Thread: TPS65217

Hi,

SDK :  ti-processor-sdk-linux-am335x-evm-03.03.00.04-Linux-x86-Install.bin 

Compile the file: am335x_boneblack_defconfig

Power chip:  TPS65217DRSL

am3354 hardware voltage value :  VDDS_DDR 1.35V,    VDD_MPU 1.01V,   VDD_CORE 1.101V , Clock crystal : 24MHZ

The purpose is to configure VDDS_DDR to 1.35V, 1.01V to VDD_MPU, 1.101V to VDD_CORE to 600M during uboot.

am3354 run to the following location card will be powered down: 

The test found that uboot stage power-down chip power supply card. 

dpll_mpu_opp100.m = am335x_get_efuse_mpu_max_freq(cdev);   //read  dpll_mpu_opp100.m is 1000MHZ

dpll_mpu_opp100.m = MPUPLL_M_600;  // dpll_mpu_opp100.m is 600MHZ

do_setup_dpll(&dpll_mpu_regs, &dpll_mpu_opp100); 

dpll_mpu_opp100.m = am335x_get_efuse_mpu_max_freq(cdev);  //After setting read dpll_mpu_opp100.m value is still 1000MHZ

How to set the MPU frequency to 600M  ??

code show as below(board/ti/am335x/board.c). AM3354 name is board_is_bone_lt() :

void am33xx_spl_board_init(void)
{
int mpu_vdd;

/* Get the frequency */
dpll_mpu_opp100.m = am335x_get_efuse_mpu_max_freq(cdev);
printf("clk = %d\n",dpll_mpu_opp100.m);          //printf  clk = 1000

if (board_is_bone() || board_is_bone_lt()) {
/* BeagleBone PMIC Code */
int usb_cur_lim;

/*
* Only perform PMIC configurations if board rev > A1
* on Beaglebone White
*/
if (board_is_bone() && !strncmp(board_ti_get_rev(), "00A1", 4))
return;

if (i2c_probe(TPS65217_CHIP_PM))
return;

/*
* On Beaglebone White we need to ensure we have AC power
* before increasing the frequency.
*/
if (board_is_bone()) {
uchar pmic_status_reg;
if (tps65217_reg_read(TPS65217_STATUS,
&pmic_status_reg))
return;
if (!(pmic_status_reg & TPS65217_PWR_SRC_AC_BITMASK)) {
puts("No AC power, disabling frequency switch\n");
return;
}
}

/*
* Override what we have detected since we know if we have
* a Beaglebone Black it supports 1GHz.
*/
if (board_is_bone_lt())
dpll_mpu_opp100.m = MPUPLL_M_600;

/*
* Increase USB current limit to 1300mA or 1800mA and set
* the MPU voltage controller as needed.
*/
if (dpll_mpu_opp100.m == MPUPLL_M_600) {
usb_cur_lim = TPS65217_USB_INPUT_CUR_LIMIT_1800MA;
mpu_vdd = TPS65217_DCDC_VOLT_SEL_1125MV;
} else {
usb_cur_lim = TPS65217_USB_INPUT_CUR_LIMIT_1300MA;
mpu_vdd = TPS65217_DCDC_VOLT_SEL_1125MV;
}

if (tps65217_reg_write(TPS65217_PROT_LEVEL_NONE,
TPS65217_POWER_PATH,
usb_cur_lim,
TPS65217_USB_INPUT_CUR_LIMIT_MASK))
puts("tps65217_reg_write failure\n");

/* Set DCDC3 (CORE) voltage to 1.125V */
if (tps65217_voltage_update(TPS65217_DEFDCDC3,
TPS65217_DCDC_VOLT_SEL_1125MV)) {
puts("tps65217_voltage_update failure\n");
return;

}

/* Set CORE Frequencies to OPP100 */
do_setup_dpll(&dpll_core_regs, &dpll_core_opp100);

/* Set DCDC2 (MPU) voltage */
if (tps65217_voltage_update(TPS65217_DEFDCDC2, mpu_vdd)) {
puts("tps65217_voltage_update failure\n");
return;
}

/*
* Set LDO3, LDO4 output voltage to 3.3V for Beaglebone.
* Set LDO3 to 1.8V and LDO4 to 3.3V for Beaglebone Black.
*/
if (board_is_bone()) {
if (tps65217_reg_write(TPS65217_PROT_LEVEL_2,
TPS65217_DEFLS1,
TPS65217_LDO_VOLTAGE_OUT_3_3,
TPS65217_LDO_MASK))
puts("tps65217_reg_write failure\n");
} else {
if (tps65217_reg_write(TPS65217_PROT_LEVEL_2,
TPS65217_DEFLS1,
TPS65217_LDO_VOLTAGE_OUT_1_8,
TPS65217_LDO_MASK))
puts("tps65217_reg_write failure\n");
}

if (tps65217_reg_write(TPS65217_PROT_LEVEL_2,
TPS65217_DEFLS2,
TPS65217_LDO_VOLTAGE_OUT_3_3,
TPS65217_LDO_MASK))
puts("tps65217_reg_write failure\n");
}

printf("write be clk = %d\n",dpll_mpu_opp100.m);  
/* Set MPU Frequency to what we detected now that voltages are set */
do_setup_dpll(&dpll_mpu_regs, &dpll_mpu_opp100);

dpll_mpu_opp100.m = am335x_get_efuse_mpu_max_freq(cdev);
printf("clk = %d\n",dpll_mpu_opp100.m);
}

BR

  • The software team have been notified. They will respond here.
  • Hi Andre,

    Please go through the below e2e thread, we have similar issue discussed there:

    e2e.ti.com/.../2093803

    Regards,
    Pavel
  • Hi,
    Thank you for sending the connection, I've seen it, but it doesn't help much.
  • Hi,
    Thank you for sending the connection, I've seen it, but it doesn't help much.
    In board/ti/am335x/board.c :
    I set VDDS_DDR 1.35V, VDD_MPU 1.01V, VDD_CORE 1.101V . By reading back registers, these voltage values are configured correctly.

    However, the MPU frequency is set to 600MHZ, and the read back is 1000MHZ.

    I set the method as follows:
    dpll_mpu_opp100.m = am335x_get_efuse_mpu_max_freq(cdev); //read dpll_mpu_opp100.m is 1000MHZ

    dpll_mpu_opp100.m = MPUPLL_M_600; // set dpll_mpu_opp100.m is 600MHZ

    struct dpll_params dpll_mpu_opp100 = {
    600, OSC-1, 1, -1, -1, -1, -1}; // OSC is 24
    const struct dpll_params dpll_core_opp100 = {
    600, OSC-1, -1, -1, 10, 8, 4}; //OSC is 24

    do_setup_dpll(&dpll_core_regs, &dpll_core_opp100);
    do_setup_dpll(&dpll_mpu_regs, &dpll_mpu_opp100);

    dpll_mpu_opp100.m = am335x_get_efuse_mpu_max_freq(cdev); //After setting read dpll_mpu_opp100.m value is still 1000MHZ

    The value read through am335x_get_efuse_mpu_max_freq(cdev) is still 1000MHZ.
    What's wrong with my method?

    This problem has been bothering me for several days, and I hope you can help me. Thank you.
    BR,
    Andre
  • Andre,

    What is the AM335x device part number that you are using? For example I have AM335x StarterKit EVM with part number XAM3359BZCZ100.

    andre feng said:
    I set the method as follows:
    dpll_mpu_opp100.m = am335x_get_efuse_mpu_max_freq(cdev); //read dpll_mpu_opp100.m is 1000MHZ

    dpll_mpu_opp100.m = MPUPLL_M_600; // set dpll_mpu_opp100.m is 600MHZ

    struct dpll_params dpll_mpu_opp100 = {
    600, OSC-1, 1, -1, -1, -1, -1}; // OSC is 24
    const struct dpll_params dpll_core_opp100 = {
    600, OSC-1, -1, -1, 10, 8, 4}; //OSC is 24

    do_setup_dpll(&dpll_core_regs, &dpll_core_opp100);
    do_setup_dpll(&dpll_mpu_regs, &dpll_mpu_opp100);

    dpll_mpu_opp100.m = am335x_get_efuse_mpu_max_freq(cdev); //After setting read dpll_mpu_opp100.m value is still 1000MHZ

    The value read through am335x_get_efuse_mpu_max_freq(cdev) is still 1000MHZ.
    What's wrong with my method?

    am335x_get_efuse_mpu_max_freq() function returns the MAX possible MPU frequency that is supported for the specific device part. This function is located in the below file:

    u-boot/arch/arm/cpu/armv7/am33xx/sys_info.c

    As you do not modify that function, it will always return the same result (1000MHz - the max frequency supported for your device).

    The correct approach for you is to dump the MPU DPLL registers to verify 600Mhz are setup correctly, not reading again the value returned from the am335x_get_efuse_mpu_max_freq. This is fully explained in the e2e thread I have provided.

    void am33xx_spl_board_init(void)
    {
        int mpu_vdd;

        /* Get the frequency */
        //dpll_mpu_opp100.m = am335x_get_efuse_mpu_max_freq(cdev);
       dpll_mpu_opp100.m = 600; //MPUPLL_M_600

     printf("dpll_mpu_opp100.m = %d\n",dpll_mpu_opp100.m);

    if (board_is_bone() || board_is_bone_lt()) {

    printf("Board is detected as Bone\n");

    .........

    /*
             * Override what we have detected since we know if we have
             * a Beaglebone Black it supports 1GHz.
             */
            if (board_is_bone_lt()) {

                printf("Board is detected as Bone LT\n");
                dpll_mpu_opp100.m = MPUPLL_M_1000;
                 printf("dpll_mpu_opp100.m = %d\n",dpll_mpu_opp100.m);
            }

     .......

    } else {

    printf("Board is NOT detected as Bone\n"); //the case for EVM, SK, IDK

    ....

    }

    /* Set MPU Frequency to what we detected now that voltages are set */

         printf("dpll_mpu_opp100.m = %d\n",dpll_mpu_opp100.m);
        do_setup_dpll(&dpll_mpu_regs, &dpll_mpu_opp100);
    }

    Please modify the am33xx_spl_board_init() function as shown above and provide the full log you have.

    Regards,
    Pavel

  • andre feng said:
    VDD_MPU 1.01V

    You still do not provide your AM335x device part number as requested, but in all cases VDD_MPU to work at 600MHz/OPP100, should be 1.100V nominal, 1.056V minimum. It can not be 1.01V. See AM335x datasheet, 5.4 Operating Performance Points (OPPs)