[U-Boot] [PATCH v1] mmc: mmc-uclass: Add mmc_init() in mmc preinit phrase

Wenyou Yang wenyou.yang at atmel.com
Tue Aug 30 10:14:59 CEST 2016


Add mmc_init() in the mmc preinit phrase to get the device's
information. Otherwise, if the environment variables are from
the mmc device, it will fail with "** Bad device size - mmc 1 **".

Signed-off-by: Wenyou Yang <wenyou.yang at atmel.com>
---

 drivers/mmc/mmc-uclass.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c
index 425abb1..4136fee 100644
--- a/drivers/mmc/mmc-uclass.c
+++ b/drivers/mmc/mmc-uclass.c
@@ -152,11 +152,15 @@ void mmc_do_preinit(void)
 
 		if (!m)
 			continue;
-#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT
+#if defined CONFIG_FSL_ESDHC_ADAPTER_IDENT || defined CONFIG_ATMEL_SDHCI
 		mmc_set_preinit(m, 1);
 #endif
-		if (m->preinit)
+		if (m->preinit) {
 			mmc_start_init(m);
+
+			mmc_init(m);
+		}
+
 	}
 }
 
-- 
2.7.4



More information about the U-Boot mailing list