[U-Boot] [PATCH 2/2] p2020ds: use maximum timeout for esdhc

Li Yang leoli at freescale.com
Thu Jan 7 09:00:14 CET 2010


From: Jin Qing <b24347 at freescale.com>

Use timeout value to maximum due to hardware problem.  The hardware may take longer
to timeout, but it's much better than having a too-short timeout value.

Signed-off-by: Jin Qing <b24347 at freescale.com>
Signed-off-by: Li Yang <leoli at freescale.com>
---
 drivers/mmc/fsl_esdhc.c   |    4 ++++
 include/configs/P2020DS.h |    1 +
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index 4a86365..d30e15a 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -202,6 +202,10 @@ static int esdhc_setup_data(struct mmc *mmc, struct mmc_data *data)
 	if (timeout < 0)
 		timeout = 0;
 
+#ifdef CONFIG_SYS_FSL_ESDHC_BROKEN_TIMEOUT
+	timeout = 14;
+#endif
+
 	clrsetbits_be32(&regs->sysctl, SYSCTL_TIMEOUT_MASK, timeout << 16);
 
 	return 0;
diff --git a/include/configs/P2020DS.h b/include/configs/P2020DS.h
index 577d2b5..9bdc9c5 100644
--- a/include/configs/P2020DS.h
+++ b/include/configs/P2020DS.h
@@ -714,6 +714,7 @@ extern unsigned long calculate_board_ddr_clk(unsigned long dummy);
 #ifdef CONFIG_MMC
 #define CONFIG_FSL_ESDHC
 #define CONFIG_SYS_FSL_ESDHC_ADDR	CONFIG_SYS_MPC85xx_ESDHC_ADDR
+#define CONFIG_SYS_FSL_ESDHC_BROKEN_TIMEOUT
 #define CONFIG_CMD_MMC
 #define CONFIG_GENERIC_MMC
 #define CONFIG_CMD_EXT2
-- 
1.6.6-rc1.GIT



More information about the U-Boot mailing list