qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hw/sd: sd: Bypass the RCA check for CMD13 in SPI mode
@ 2021-01-29  8:51 Bin Meng
  2021-01-29 14:11 ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 6+ messages in thread
From: Bin Meng @ 2021-01-29  8:51 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-block, qemu-devel; +Cc: Bin Meng

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



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

end of thread, other threads:[~2021-02-08 20:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-29  8:51 [PATCH] hw/sd: sd: Bypass the RCA check for CMD13 in SPI mode Bin Meng
2021-01-29 14:11 ` 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

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).