[PATCH] Some SD cards require more retries in mmc_init

Paul Fertser fercerpav at gmail.com
Sat Dec 13 21:16:51 CET 2008


This patch effectively doubles maximum time allowed for retries performed by
mmc_init. Also, the delay was shortened to lower the average time needed to
init a card. Without it, i was unable to boot from Transcend TS8GUSDHC4
(appending rootdelay=1 was necessary as well).
---
 src/drivers/glamo-mmc.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/drivers/glamo-mmc.c b/src/drivers/glamo-mmc.c
index be6b6e2..8f649d1 100644
--- a/src/drivers/glamo-mmc.c
+++ b/src/drivers/glamo-mmc.c
@@ -609,7 +609,7 @@ static void print_sd_cid(const struct sd_cid *cid)
 
 int mmc_init(int verbose)
 {
-	int retries = 50, rc = -1;
+	int retries = 3000, rc = -1;
 	int resp;
 	u8 response[16];
 //	mmc_cid_t *mmc_cid = (mmc_cid_t *)response;
@@ -675,9 +675,7 @@ int mmc_init(int verbose)
 
 	while (retries--) {
 
-		udelay(100000);
-		udelay(100000);
-		udelay(100000);
+		udelay(10000);
 
 		resp = mmc_cmd(MMC_APP_CMD, 0x00000000,
 			MMC_CMD_AC | MMC_RSP_R1, 0, 0, 0,
-- 
1.5.2.2


--=-=-=

-- 
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:fercerpav at gmail.com

--=-=-=--




More information about the openmoko-kernel mailing list