mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Michael Tretter <m.tretter@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Michael Graichen <michael.graichen@hotmail.com>
Subject: [PATCH 4/5] mci: arasan: wait for XFER_COMPLETE for busy response
Date: Wed, 16 Jun 2021 09:39:56 +0200	[thread overview]
Message-ID: <20210616073957.1872965-5-m.tretter@pengutronix.de> (raw)
In-Reply-To: <20210616073957.1872965-1-m.tretter@pengutronix.de>

I observed errors on the ZynqMP during reading the EXT_CSD registers
using CMD8. The Zynq UltraScale+ Device TRM UG1085 (v2.2) p. 777 states
that the driver shall wait 2 ms after sending CMD6 for setting a EXT_CSD
register.

The JEDEC Standard No. 84-A43 p. 35 does not specify the delay but
states that CMD6 expects an R1b response and that the host has to wait
until the busy signal is de-asserted. This is signaled via the
SDHCI_INT_XFER_COMPLETE interrupt.

Wait for the XFER_COMPLETE interrupt after sending a command that
expects an R1b response.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
 drivers/mci/arasan-sdhci.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mci/arasan-sdhci.c b/drivers/mci/arasan-sdhci.c
index 732f838d8395..d45f9184cd1d 100644
--- a/drivers/mci/arasan-sdhci.c
+++ b/drivers/mci/arasan-sdhci.c
@@ -193,6 +193,8 @@ static int arasan_sdhci_send_cmd(struct mci_host *mci, struct mci_cmd *cmd,
 	mask = SDHCI_INT_CMD_COMPLETE;
 	if (data && data->flags == MMC_DATA_READ)
 		mask |= SDHCI_INT_DATA_AVAIL;
+	if (cmd->resp_type & MMC_RSP_BUSY)
+		mask |= SDHCI_INT_XFER_COMPLETE;
 
 	sdhci_set_cmd_xfer_mode(&host->sdhci,
 				cmd, data, false, &command, &xfer);
-- 
2.29.2


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


  parent reply	other threads:[~2021-06-16  7:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16  7:39 [PATCH 0/5] Cleanup and fix arasan-sdhci Michael Tretter
2021-06-16  7:39 ` [PATCH 1/5] mci: mci-core: respect disable-wp property Michael Tretter
2021-06-16  7:39 ` [PATCH 2/5] mci: arasan: fix most checkpatch warnings Michael Tretter
2021-06-16  7:39 ` [PATCH 3/5] mci: arasan: remove duplicate stop clock Michael Tretter
2021-06-16  7:39 ` Michael Tretter [this message]
2021-06-16  7:39 ` [PATCH 5/5] ARM: zynqmp: defconfig: enable MCI_ARASAN Michael Tretter
2021-06-16  7:52 ` [PATCH 0/5] Cleanup and fix arasan-sdhci Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210616073957.1872965-5-m.tretter@pengutronix.de \
    --to=m.tretter@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=michael.graichen@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox