summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-10-14 07:28:32 -0400
committerTom Rini <trini@konsulko.com>2019-10-14 07:28:32 -0400
commitfae79480111be47944cf66a9c052ff3934a09ce5 (patch)
tree7f7e53795d9520b2a731ac4ca8b5b94223bf3aa4 /common
parent7a779ed1755c2d5011bd9598da90291f759ae760 (diff)
parenta8ef8b22896331d0be1bb4c5bef787b3f72e793e (diff)
downloadu-boot-fae79480111be47944cf66a9c052ff3934a09ce5.tar.gz
Merge tag 'mmc-10-10-2019' of https://gitlab.denx.de/u-boot/custodians/u-boot-mmc
- Add sdhci driver for Broadcom iProc platform - Add a driver callback for power-cycle for mmc - Implement host_power_cycle callback for stm32_sdmmc2 - spl: dm_mmc: Initialize only the required mmc device
Diffstat (limited to 'common')
-rw-r--r--common/spl/spl_mmc.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index c5cae97099..34e1e73d80 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -123,31 +123,25 @@ static int spl_mmc_get_device_index(u32 boot_device)
static int spl_mmc_find_device(struct mmc **mmcp, u32 boot_device)
{
-#if CONFIG_IS_ENABLED(DM_MMC)
- struct udevice *dev;
-#endif
int err, mmc_dev;
mmc_dev = spl_mmc_get_device_index(boot_device);
if (mmc_dev < 0)
return mmc_dev;
+#if CONFIG_IS_ENABLED(DM_MMC)
+ err = mmc_init_device(mmc_dev);
+#else
err = mmc_initialize(NULL);
+#endif /* DM_MMC */
if (err) {
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
printf("spl: could not initialize mmc. error: %d\n", err);
#endif
return err;
}
-
-#if CONFIG_IS_ENABLED(DM_MMC)
- err = uclass_get_device(UCLASS_MMC, mmc_dev, &dev);
- if (!err)
- *mmcp = mmc_get_mmc_dev(dev);
-#else
*mmcp = find_mmc_device(mmc_dev);
err = *mmcp ? 0 : -ENODEV;
-#endif
if (err) {
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
printf("spl: could not find mmc device %d. error: %d\n",