diff options
author | Yangbo Lu <yangbo.lu@nxp.com> | 2020-09-01 16:58:04 +0800 |
---|---|---|
committer | Peng Fan <peng.fan@nxp.com> | 2020-10-12 15:46:34 +0800 |
commit | d271e10581e7f15451e9d4c3cdd39044440a848a (patch) | |
tree | 0d1d90084cc5c89957fd5aa4e9603962e36dd934 /drivers/mmc | |
parent | 8c96880814b23b5e17b5e7d350ea6066dae54bc6 (diff) | |
download | u-boot-d271e10581e7f15451e9d4c3cdd39044440a848a.tar.gz |
mmc: add a mmc_hs400_prepare_ddr() interface
Add a mmc_hs400_prepare_ddr() interface for controllers
which needs preparation before switching to DDR mode for
HS400 mode.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/mmc-uclass.c | 15 | ||||
-rw-r--r-- | drivers/mmc/mmc.c | 4 |
2 files changed, 19 insertions, 0 deletions
diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c index b90e1ee30d..ec59bcd856 100644 --- a/drivers/mmc/mmc-uclass.c +++ b/drivers/mmc/mmc-uclass.c @@ -142,6 +142,21 @@ int mmc_set_enhanced_strobe(struct mmc *mmc) } #endif +int dm_mmc_hs400_prepare_ddr(struct udevice *dev) +{ + struct dm_mmc_ops *ops = mmc_get_ops(dev); + + if (ops->hs400_prepare_ddr) + return ops->hs400_prepare_ddr(dev); + + return 0; +} + +int mmc_hs400_prepare_ddr(struct mmc *mmc) +{ + return dm_mmc_hs400_prepare_ddr(mmc->dev); +} + int dm_mmc_host_power_cycle(struct udevice *dev) { struct dm_mmc_ops *ops = mmc_get_ops(dev); diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index b75c2bc830..8502503d36 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -1993,6 +1993,10 @@ static int mmc_select_hs400(struct mmc *mmc) /* Set back to HS */ mmc_set_card_speed(mmc, MMC_HS, true); + err = mmc_hs400_prepare_ddr(mmc); + if (err) + return err; + err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BUS_WIDTH, EXT_CSD_BUS_WIDTH_8 | EXT_CSD_DDR_FLAG); if (err) |