[U-Boot] [PATCH 2/3] FIX: mmc: sdhci: Board specific definitions for SDHCI CMD and READ TIMEOUTS

Lukasz Majewski l.majewski at samsung.com
Mon Jul 11 14:49:04 CEST 2016


For some boards - e.g. odroid u3, it is necessary to adjust manually those
two timeouts.

Exynos4 based boards, which use SDHCI controller to read data from SD cards,
have SDHCI_QUIRK_BROKEN_R1B flag set. This quirk requires short timeout
values, since in fact it relies on timeout exit, because the controller is
not able to read status bit properly for this kind of response.

Change: 29905a451b7ecf86785a4404e926fb14a8daced3, introduced longer timeouts
for boards with SDHCI_QUIRK_BROKEN_R1B, which resulted in write speed
regression (to ext4 fs via DFU):

Before (31 MiB test file):
32505856 bytes written in 4342 ms (7.1 MiB/s)

After this change:
32505856 bytes written in 20466 ms (1.5 MiB/s)

Such performance regression caused timeouts during DFU write (observed at
HWT test setup).

This commit, however introduces possibility to define different timeout
values for SDHCI mmc IP blocks embedded in different SoCs (and boards).

This problem was observed only in SDHCI controller, when target board was
running solely from SD card.

Signed-off-by: Lukasz Majewski <l.majewski at samsung.com>
---
 drivers/mmc/sdhci.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index aa4cd4f..9f38ecb 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -126,8 +126,12 @@ static int sdhci_transfer_data(struct sdhci_host *host, struct mmc_data *data,
 #ifndef CONFIG_SDHCI_CMD_MAX_TIMEOUT
 #define CONFIG_SDHCI_CMD_MAX_TIMEOUT		3200
 #endif
+#ifndef CONFIG_SDHCI_CMD_DEFAULT_TIMEOUT
 #define CONFIG_SDHCI_CMD_DEFAULT_TIMEOUT	100
+#endif
+#ifndef CONFIG_SDHCI_READ_STATUS_TIMEOUT
 #define CONFIG_SDHCI_READ_STATUS_TIMEOUT	1000
+#endif
 
 static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
 		       struct mmc_data *data)
-- 
2.0.0.rc2



More information about the U-Boot mailing list