mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] mmc: atmel: Make write work on sama5d3
@ 2018-11-02  9:11 Sascha Hauer
  2018-11-02  9:14 ` Sascha Hauer
  0 siblings, 1 reply; 3+ messages in thread
From: Sascha Hauer @ 2018-11-02  9:11 UTC (permalink / raw)
  To: Barebox List; +Cc: Ahmad Fatoum

For some reason the sama5d3 needs a delay after a
MMC_CMD_STOP_TRANSMISSION command. Without it writing fails with:

ERROR: atmel_mci f0000000.mmc@f0000000: command/data timeout
ERROR: atmel_mci f0000000.mmc@f0000000: command/data timeout

The reason is not yet clear, so live with this hack for now.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mci/atmel_mci.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mci/atmel_mci.c b/drivers/mci/atmel_mci.c
index 0d3b245ced..122d999087 100644
--- a/drivers/mci/atmel_mci.c
+++ b/drivers/mci/atmel_mci.c
@@ -468,6 +468,10 @@ static int atmci_request(struct mci_host *mci, struct mci_cmd *cmd, struct mci_d
 	}
 
 	stat = atmci_poll_status(host, ATMCI_CMDRDY);
+
+	if (cmd->cmdidx == MMC_CMD_STOP_TRANSMISSION)
+		mdelay(5);
+
 	return atmci_cmd_done(host, stat);
 }
 
-- 
2.19.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-12-13 14:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-02  9:11 [PATCH] mmc: atmel: Make write work on sama5d3 Sascha Hauer
2018-11-02  9:14 ` Sascha Hauer
2022-12-13 14:13   ` Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox