* [U-Boot] [PATCH v3 1/3] mmc: sdhci: add the quirk for broken R1b response
@ 2012-04-09 7:57 Jaehoon Chung
0 siblings, 0 replies; 3+ messages in thread
From: Jaehoon Chung @ 2012-04-09 7:57 UTC (permalink / raw)
To: u-boot
When response type is R1b, mask value is added the SDHCI_INT_DAT_END.
but in while(), didn't check that flag.
So sdhci controller didn't work fine.
CMD6 didn't always complete.
So add the quirks for broken r1b response
and add the timeout value to prevent the infinite loop.
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <Kyungmin.park@samsung.com>
---
drivers/mmc/sdhci.c | 12 ++++++++++++
include/sdhci.h | 1 +
2 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index fc904b5..4de19e8 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -128,6 +128,7 @@ int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
int trans_bytes = 0, is_aligned = 1;
u32 mask, flags, mode;
unsigned int timeout, start_addr = 0;
+ unsigned int retry = 1000;
/* Wait max 10 ms */
timeout = 10;
@@ -210,8 +211,19 @@ int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
stat = sdhci_readl(host, SDHCI_INT_STATUS);
if (stat & SDHCI_INT_ERROR)
break;
+ if (retry-- == 0)
+ break;
} while ((stat & mask) != mask);
+ if (retry == 0) {
+ if (host->quirks == SDHCI_QUIRK_BROKEN_R1B)
+ return 0;
+ else {
+ printf("Timeout for stauts update!\n");
+ return TIMEOUT;
+ }
+ }
+
if ((stat & (SDHCI_INT_ERROR | mask)) == mask) {
sdhci_cmd_done(host, cmd);
sdhci_writel(host, mask, SDHCI_INT_STATUS);
diff --git a/include/sdhci.h b/include/sdhci.h
index 800f9d9..a2415ba 100644
--- a/include/sdhci.h
+++ b/include/sdhci.h
@@ -216,6 +216,7 @@
*/
#define SDHCI_QUIRK_32BIT_DMA_ADDR (1 << 0)
#define SDHCI_QUIRK_REG32_RW (1 << 1)
+#define SDHCI_QUIRK_BROKEN_R1B (1 << 2)
/* to make gcc happy */
struct sdhci_host;
^ permalink raw reply related [flat|nested] 3+ messages in thread* [U-Boot] [PATCH v3 1/3] mmc: sdhci: add the quirk for broken R1b response
@ 2012-04-12 20:21 Terry Lambert
2012-04-13 2:28 ` Jaehoon Chung
0 siblings, 1 reply; 3+ messages in thread
From: Terry Lambert @ 2012-04-12 20:21 UTC (permalink / raw)
To: u-boot
Sorry for not properly threading, just joined the list formally.
inre: the subject, already replied to the author directly, but the
following comments:
The 'retriy' is post-decremented so the failure compare should be for -1.
The word 'status' is misspelled as 'stauts".
Other than that, LGTM when combined with the other 3 patches, which also LGTM.
-- Terry
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH v3 1/3] mmc: sdhci: add the quirk for broken R1b response
2012-04-12 20:21 Terry Lambert
@ 2012-04-13 2:28 ` Jaehoon Chung
0 siblings, 0 replies; 3+ messages in thread
From: Jaehoon Chung @ 2012-04-13 2:28 UTC (permalink / raw)
To: u-boot
Hi Terry.
You're right.
I sent the patch-v5..did you check them?
Best Regards,
Jaehoon Chung
On 04/13/2012 05:21 AM, Terry Lambert wrote:
> Sorry for not properly threading, just joined the list formally.
>
> inre: the subject, already replied to the author directly, but the
> following comments:
>
> The 'retriy' is post-decremented so the failure compare should be for -1.
>
> The word 'status' is misspelled as 'stauts".
>
> Other than that, LGTM when combined with the other 3 patches, which also LGTM.
>
> -- Terry
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-04-13 2:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-09 7:57 [U-Boot] [PATCH v3 1/3] mmc: sdhci: add the quirk for broken R1b response Jaehoon Chung
-- strict thread matches above, loose matches on Subject: below --
2012-04-12 20:21 Terry Lambert
2012-04-13 2:28 ` Jaehoon Chung
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox