board: phytec: phycore-imx93: Fix i.MX93 voltage modes
PATCH 1/1 board: phytec: phycore-imx93: Fix i.MX93 voltage modes
Fix support for i.MX93 voltage modes on phyCORE-i.MX93 SoM boards.
First of all, Kconfig option CONFIG_IMX9_LOW_DRIVE_MODE is gone since commit c9efcad23741 ("imx93_evk: Remove CONFIG_IMX9_LOW_DRIVE_MODE and ld defconfig") and was replaced by runtime detection mechanism. Thus lets use is_voltage_mode() instead of Kconfig to detect CPU type and select proper voltage mode.
Secondly, 1400MHz ND mode (Nominal Drive) requiring 0.85V BUCK voltage was not supported with current power_init_board() PMIC settings. Add check also for this CPU type and set BUCK voltage accordingly.
Last but not least, add printf() printouts about PMIC voltage mode to the console. This makes it more apparent and verbose about voltage mode in use. Also our internal tests depend on this printout to catch issues with i.MX93 CPU types and set PMIC voltage modes.
--- board/phytec/phycore_imx93/spl.c | 37 ++++++++++++++++---------------- 1 file changed, 18 insertions(+), 19 deletions(-)
board/phytec/phycore_imx93/spl.c +18 -19
@@ -93,7 +93,7 @@ int power_init_board(void) {struct udevice *dev;int ret; -unsigned int val =0 ; +unsigned int val =0 , buck_val; ret =pmic_get ("pmic@25" , &dev);if (ret == -ENODEV ) {
@@ -115,24 +115,23 @@ int power_init_board(void)return ret; val = ret; -if (IS_ENABLED (CONFIG_IMX9_LOW_DRIVE_MODE )) { -/* 0.8v for Low drive mode */ -if (val &PCA9450_REG_PWRCTRL_TOFF_DEB ) { -pmic_reg_write (dev,PCA9450_BUCK1OUT_DVS0 ,0x0c ); -pmic_reg_write (dev,PCA9450_BUCK3OUT_DVS0 ,0x0c ); - }else { -pmic_reg_write (dev,PCA9450_BUCK1OUT_DVS0 ,0x10 ); -pmic_reg_write (dev,PCA9450_BUCK3OUT_DVS0 ,0x10 ); - } +if (is_voltage_mode (VOLT_LOW_DRIVE )) { + buck_val =0x0c ;/* 0.8v for Low drive mode */ +printf ("PMIC: Low Drive Voltage Mode\n" ); + }else if (is_voltage_mode (VOLT_NOMINAL_DRIVE )) { + buck_val =0x10 ;/* 0.85v for Nominal drive mode */ +printf ("PMIC: Nominal Voltage Mode\n" ); }else { -/* 0.9v for Over drive mode */ -if (val &PCA9450_REG_PWRCTRL_TOFF_DEB ) { -pmic_reg_write (dev,PCA9450_BUCK1OUT_DVS0 ,0x14 ); -pmic_reg_write (dev,PCA9450_BUCK3OUT_DVS0 ,0x14 ); - }else { -pmic_reg_write (dev,PCA9450_BUCK1OUT_DVS0 ,0x18 ); -pmic_reg_write (dev,PCA9450_BUCK3OUT_DVS0 ,0x18 ); - } + buck_val =0x14 ;/* 0.9v for Over drive mode */ +printf ("PMIC: Over Drive Voltage Mode\n" ); + } + +if (val &PCA9450_REG_PWRCTRL_TOFF_DEB ) { +pmic_reg_write (dev,PCA9450_BUCK1OUT_DVS0 , buck_val); +pmic_reg_write (dev,PCA9450_BUCK3OUT_DVS0 , buck_val); + }else { +pmic_reg_write (dev,PCA9450_BUCK1OUT_DVS0 , buck_val +0x4 ); +pmic_reg_write (dev,PCA9450_BUCK3OUT_DVS0 , buck_val +0x4 ); }/* set standby voltage to 0.65v */
@@ -174,7 +173,7 @@ void board_init_f(ulong dummy)power_init_board (); -if (!IS_ENABLED (CONFIG_IMX9_LOW_DRIVE_MODE )) +if (!is_voltage_mode (VOLT_LOW_DRIVE ))set_arm_core_max_clk ();/* Init power of mix */
Signature · 1 line
2.34.1
Quoted 13 lines · Primoz Fiser
Fix support for i.MX93 voltage modes on phyCORE-i.MX93 SoM boards.
First of all,
KconfigoptionCONFIG_IMX9_LOW_DRIVE_MODEis gone since commitc9efcad23741("imx93_evk: RemoveCONFIG_IMX9_LOW_DRIVE_MODEand ld defconfig") and was replaced by runtime detection mechanism. Thus lets useis_voltage_mode()instead ofKconfigto detect CPU type and select proper voltage mode.Secondly, 1400MHz ND mode (Nominal Drive) requiring 0.85V BUCK voltage was not supported with current
power_init_board()PMIC settings. Add check also for this CPU type and set BUCK voltage accordingly.
Quoted 6 lines
Last but not least, add
printf()printouts about PMIC voltage mode to the console. This makes it more apparent and verbose about voltage mode in use. Also our internal tests depend on this printout to catch issues with i.MX93 CPU types and set PMIC voltage modes.Signed-off-by Primoz Fiser <[email protected]>
Applied to -master, thanks.