qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Bin Meng <bmeng.cn@gmail.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	qemu-block@nongnu.org, qemu-devel@nongnu.org
Cc: Bin Meng <bin.meng@windriver.com>
Subject: [PATCH] hw/sd: sd: Bypass the RCA check for CMD13 in SPI mode
Date: Fri, 29 Jan 2021 16:51:24 +0800	[thread overview]
Message-ID: <20210129085124.21525-1-bmeng.cn@gmail.com> (raw)

From: Bin Meng <bin.meng@windriver.com>

Unlike SD mode, when SD card is working in SPI mode, the argument
of CMD13 is stuff bits. Hence we should bypass the RCA check.

Signed-off-by: Bin Meng <bin.meng@windriver.com>

---
Based-on: http://patchwork.ozlabs.org/project/qemu-devel/list/?series=226787

 hw/sd/sd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 8c397d4ad7..4f902d0b72 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1166,8 +1166,9 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
     case 13:	/* CMD13:  SEND_STATUS */
         switch (sd->mode) {
         case sd_data_transfer_mode:
-            if (sd->rca != rca)
+            if (!sd->spi && sd->rca != rca) {
                 return sd_r0;
+            }
 
             return sd_r1;
 
-- 
2.25.1



             reply	other threads:[~2021-01-29  8:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-29  8:51 Bin Meng [this message]
2021-01-29 14:11 ` [PATCH] hw/sd: sd: Bypass the RCA check for CMD13 in SPI mode Philippe Mathieu-Daudé
2021-01-30 10:20   ` Bin Meng
2021-02-08 13:08     ` Philippe Mathieu-Daudé
2021-02-08 13:55       ` Bin Meng
2021-02-08 14:00         ` Bin Meng

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=20210129085124.21525-1-bmeng.cn@gmail.com \
    --to=bmeng.cn@gmail.com \
    --cc=bin.meng@windriver.com \
    --cc=f4bug@amsat.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).