stm32mp1: ram: add support for LPDDR2/LPDDR3
Manage power supply configuration for board using stpmic1 with LPDDR2 or with LPDDR3: + VDD_DDR1 = 1.8V with BUCK3 (bypass if possible) + VDD_DDR2 = 1.2V with BUCK2 Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
This commit is contained in:

committed by
Patrice Chotard

parent
53bb831658
commit
1767ac2d1f
@@ -372,7 +372,7 @@ void stm32mp1_refresh_restore(struct stm32mp1_ddrctl *ctl,
|
||||
}
|
||||
|
||||
/* board-specific DDR power initializations. */
|
||||
__weak int board_ddr_power_init(void)
|
||||
__weak int board_ddr_power_init(enum ddr_type ddr_type)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -382,9 +382,14 @@ void stm32mp1_ddr_init(struct ddr_info *priv,
|
||||
const struct stm32mp1_ddr_config *config)
|
||||
{
|
||||
u32 pir;
|
||||
int ret;
|
||||
int ret = -EINVAL;
|
||||
|
||||
ret = board_ddr_power_init();
|
||||
if (config->c_reg.mstr & DDRCTRL_MSTR_DDR3)
|
||||
ret = board_ddr_power_init(STM32MP_DDR3);
|
||||
else if (config->c_reg.mstr & DDRCTRL_MSTR_LPDDR2)
|
||||
ret = board_ddr_power_init(STM32MP_LPDDR2);
|
||||
else if (config->c_reg.mstr & DDRCTRL_MSTR_LPDDR3)
|
||||
ret = board_ddr_power_init(STM32MP_LPDDR3);
|
||||
|
||||
if (ret)
|
||||
panic("ddr power init failed\n");
|
||||
|
Reference in New Issue
Block a user