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.

[FAQ] AM335x: How to migrate to a different speed grade SoC in the existing product design with u-boot/Linux SW

Part Number: AM3358
Other Parts Discussed in Thread: TPS65910

Hi,

Linux Version: Linux 4.9.28
Uboot Version: U-Boot 2013.10

We are in process of evaluating partno AM3358BZCZA80 for our custom board which is based on AM3358BZCZA60 and it is clocked at 600MHz (OPP100).

In our existing uboot code VDD MPU & VDD CORE are set to below
#define TPS65910_OP_REG_SEL_1_1_3 (0x2E) /* 1.1375 V */

and the DPLLs are set to below.

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};


We would like to understand what is involved in downgrading clock of AM3358BZCZA80 to operate at 600MHz (OPP100).
Does downgrading requires additional changes in our existing code? 


Regards,
Mahidhar

  • Hi Mahidhar,

    I have an AM335x GP EVM (w/ 1GHz P/N).
    I'm using SDK 6.3 to list code changes for ceiling the max speed from the default 1GHz to 600MHz for your reference:
    1. u-boot/SPL change:
    Depending on the max speed detected in SPL code via calling am335x_get_efuse_mpu_max_freq(),
    - DPLL_MPU parameters are setup via calling get_dpll_mpu_params()
    - VDD_MPU, VDD_CORE are setup via calling scale_vcores() to configure PMIC
    I uploaded SPL code change, where skipping max speed detection from reading efuse, instead hard coding to always return “MPUPLL_M_600”.

    2. kernel dts change for PMIC regulator to configure VDD_MPU
    The kernel dts change for VDD_MPU is uploaded for setting max speed to 600MHz instead of the default 1GHz.
    Please refer to Table 5-7. VDD_MPU OPPs for ZCZ Package in AM335x data sheet.

    I also uploaded two log files:
    - am3_6.3_regulator.txt: the default log captured on AM335x GP EVM (1GHZ P/N) using SDK 6.3
    - am3_6.3_regulator_600MHz.txt: the log captured on AM335x GP EVM (1GHZ P/N) using the code changes to ceiling max speed to 600MHz.

    Best,
    -Hong

    am3_spl_600MHz.patch.txt
    diff --git a/arch/arm/mach-omap2/am33xx/sys_info.c b/arch/arm/mach-omap2/am33xx/sys_info.c
    index 17b46619b5..338ae99a5c 100644
    --- a/arch/arm/mach-omap2/am33xx/sys_info.c
    +++ b/arch/arm/mach-omap2/am33xx/sys_info.c
    @@ -135,6 +135,7 @@ int print_cpuinfo(void)
     #ifdef CONFIG_AM33XX
     int am335x_get_efuse_mpu_max_freq(struct ctrl_dev *cdev)
     {
    +	return MPUPLL_M_600;
     	int sil_rev;
     
     	sil_rev = readl(&cdev->deviceid) >> 28;
    

    am3_kernel_dts_600MHz.patch.txt
    diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
    index 52fff6bb15..fac1e79485 100644
    --- a/arch/arm/boot/dts/am335x-evm.dts
    +++ b/arch/arm/boot/dts/am335x-evm.dts
    @@ -672,7 +672,7 @@
     			/* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */
     			regulator-name = "vdd_mpu";
     			regulator-min-microvolt = <912500>;
    -			regulator-max-microvolt = <1351500>;
    +			regulator-max-microvolt = <1122000>;
     			regulator-boot-on;
     			regulator-always-on;
     		};
    

    0741.am3_6.3_regulator.txt
    root@am335x-evm:~# uname -a
    Linux am335x-evm 4.19.94-gbe5389fd85 #1 PREEMPT Thu Oct 29 16:23:07 CDT 2020 armv7l GNU/Linux
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
    300000 600000 720000 800000 1000000 
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/stats/trans_table
       From  :    To
             :    300000    600000    720000    800000   1000000 
       300000:         0        27         8         8         8 
       600000:        33         0        17        14        10 
       720000:         3        18         0         6         9 
       800000:         6        16         5         0        35 
      1000000:         9        14         6        34         0 
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state
    300000 6683
    600000 281
    720000 96
    800000 245
    1000000 3081
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
    300000
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
    1000000
    root@am335x-evm:~# cat /sys/kernel/debug/regulator/regulator_summary
     regulator                      use open bypass voltage current     min     max
    -------------------------------------------------------------------------------
     regulator-dummy                  0    3      0     0mV     0mA     0mV     0mV 
        47401b00.usb-phy                                                0mV     0mV
        47401300.usb-phy                                                0mV     0mV
        backlight                                                       0mV     0mV
     vbat                            14   15      0  5000mV     0mA  5000mV  5000mV 
        v1_8d                         0    1      0  1800mV     0mA  1800mV  1800mV 
           1-001b                                                       0mV     0mV
        v3_3d                         0    3      0  3300mV     0mA  3300mV  3300mV 
           1-001b                                                       0mV     0mV
           1-001b                                                       0mV     0mV
           1-001b                                                       0mV     0mV
        vrtc                          0    0      0     0mV     0mA  1800mV  1800mV 
        vio                           0    0      0  1500mV     0mA     0mV     0mV 
        vdd_mpu                       0    1      0  1100mV     0mA   912mV  1350mV 
           cpu0                                                      1100mV  1122mV
        vdd_core                      0    0      0  1100mV     0mA   912mV  1150mV 
        vdig1                         0    0      0  1800mV     0mA     0mV     0mV 
        vdig2                         0    0      0  1800mV     0mA     0mV     0mV 
        vpll                          0    0      0  1800mV     0mA     0mV     0mV 
        vdac                          0    0      0  1800mV     0mA     0mV     0mV 
        vaux1                         0    0      0  1800mV     0mA     0mV     0mV 
        vaux2                         0    0      0  3300mV     0mA     0mV     0mV 
        vaux33                        0    0      0  3300mV     0mA     0mV     0mV 
        vmmc                          0    1      0  3300mV     0mA  1800mV  3300mV 
           48060000.mmc                                              3300mV  3300mV
        vbb                           0    0      0  3000mV     0mA     0mV     0mV 
     lis3_reg                         0    0      0     0mV     0mA     0mV     0mV 
     wlan-en-regulator                0    1      0  1800mV     0mA  1800mV  1800mV 
        47810000.mmc                                                 1650mV  1950mV
     vdd3                             0    0      0  5000mV     0mA  5000mV  5000mV 
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
    600000
    root@am335x-evm:~# 

    am3_6.3_regulator_600MHz.txt
    root@am335x-evm:~# uname -a
    Linux am335x-evm 4.19.94-gbe5389fd85 #1 PREEMPT Thu Oct 29 16:23:07 CDT 2020 armv7l GNU/Linux
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
    300000 600000 
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/stats/trans_table
       From  :    To
             :    300000    600000 
       300000:         0        78 
       600000:        79         0 
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state
    300000 9389
    600000 5117
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
    300000
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
    600000
    root@am335x-evm:~# cat /sys/kernel/debug/regulator/regulator_summary
     regulator                      use open bypass voltage current     min     max
    -------------------------------------------------------------------------------
     regulator-dummy                  0    3      0     0mV     0mA     0mV     0mV 
        47401b00.usb-phy                                                0mV     0mV
        47401300.usb-phy                                                0mV     0mV
        backlight                                                       0mV     0mV
     vbat                            14   15      0  5000mV     0mA  5000mV  5000mV 
        v1_8d                         0    1      0  1800mV     0mA  1800mV  1800mV 
           1-001b                                                       0mV     0mV
        v3_3d                         0    3      0  3300mV     0mA  3300mV  3300mV 
           1-001b                                                       0mV     0mV
           1-001b                                                       0mV     0mV
           1-001b                                                       0mV     0mV
        vrtc                          0    0      0     0mV     0mA  1800mV  1800mV 
        vio                           0    0      0  1500mV     0mA     0mV     0mV 
        vdd_mpu                       0    1      0   950mV     0mA   912mV  1112mV 
           cpu0                                                       950mV   969mV
        vdd_core                      0    0      0  1100mV     0mA   912mV  1150mV 
        vdig1                         0    0      0  1800mV     0mA     0mV     0mV 
        vdig2                         0    0      0  1800mV     0mA     0mV     0mV 
        vpll                          0    0      0  1800mV     0mA     0mV     0mV 
        vdac                          0    0      0  1800mV     0mA     0mV     0mV 
        vaux1                         0    0      0  1800mV     0mA     0mV     0mV 
        vaux2                         0    0      0  3300mV     0mA     0mV     0mV 
        vaux33                        0    0      0  3300mV     0mA     0mV     0mV 
        vmmc                          0    1      0  3300mV     0mA  1800mV  3300mV 
           48060000.mmc                                              3300mV  3300mV
        vbb                           0    0      0  3000mV     0mA     0mV     0mV 
     lis3_reg                         0    0      0     0mV     0mA     0mV     0mV 
     wlan-en-regulator                0    1      0  1800mV     0mA  1800mV  1800mV 
        47810000.mmc                                                 1650mV  1950mV
     vdd3                             0    0      0  5000mV     0mA  5000mV  5000mV 
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
    300000
    root@am335x-evm:~#