From mboxrd@z Thu Jan 1 00:00:00 1970 From: DrEagle Date: Sat, 22 Sep 2012 09:18:46 +0200 Subject: [U-Boot] [PATCH v2 5/5] Fix timeout in Marvell SDIO MMC driver In-Reply-To: <505C3E5D.8000305@doukki.net> References: <505C3E5D.8000305@doukki.net> Message-ID: <505D6656.5040108@doukki.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Fix an issue with most SDHC cards because of timeout delay Signed-off-by: drEagle --- drivers/mmc/mrvl_mmc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/mrvl_mmc.c b/drivers/mmc/mrvl_mmc.c index 8127961..bdafbc7 100644 --- a/drivers/mmc/mrvl_mmc.c +++ b/drivers/mmc/mrvl_mmc.c @@ -4,6 +4,7 @@ * (C) Copyright 2012 * Marvell Semiconductor * Written-by: Lior Amsalem + * Written-by: G?rald Kerma * See file CREDITS for list of people who contributed to this * project. * @@ -127,10 +128,9 @@ static int mrvl_mmc_send_cmd (struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_d SDIO_REG_WRITE16(SDIO_CMD, MRVL_MMC_MAKE_CMD(cmd->cmdidx, resptype)); /* Waiting for completion */ - timeout = 1000000; + timeout = 10000; while (!((SDIO_REG_READ16(SDIO_NOR_INTR_STATUS)) & waittype)) { - udelay(1); if (SDIO_REG_READ16(SDIO_NOR_INTR_STATUS) & SDIO_NOR_ERROR) { #ifdef DEBUG printf("mrvl_mmc_send_cmd: error! cmd : %d, err reg: %04x\n", cmd->cmdidx, SDIO_REG_READ16(SDIO_ERR_INTR_STATUS)); @@ -139,6 +139,7 @@ static int mrvl_mmc_send_cmd (struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_d return TIMEOUT; return COMM_ERR; } + udelay(1000); timeout--; if (timeout <= 0) { printf("MRVL MMC: command timed out\n"); -- 1.7.10.4