qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] hw/sd: sd: Bypass the RCA check for CMD13 in SPI mode


From: Bin Meng
Subject: [PATCH] hw/sd: sd: Bypass the RCA check for CMD13 in SPI mode
Date: Fri, 29 Jan 2021 16:51:24 +0800

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 via email to

[Prev in Thread] Current Thread [Next in Thread]