[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 9/9] hw/sd: ssi-sd: Handle the rest commands with R1b response
From: |
Bin Meng |
Subject: |
[PATCH v4 9/9] hw/sd: ssi-sd: Handle the rest commands with R1b response type |
Date: |
Thu, 28 Jan 2021 14:30:35 +0800 |
From: Bin Meng <bin.meng@windriver.com>
Besides CMD12, the following command's reponse type is R1b:
- SET_WRITE_PROT (CMD28)
- CLR_WRITE_PROT (CMD29)
- ERASE (CMD38)
Reuse the same s->stopping to indicate a R1b reponse is needed.
Signed-off-by: Bin Meng <bin.meng@windriver.com>
---
Changes in v4:
- new patch: handle the rest commands with R1b response type
hw/sd/ssi-sd.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/sd/ssi-sd.c b/hw/sd/ssi-sd.c
index 907d681d19..97ee58e20c 100644
--- a/hw/sd/ssi-sd.c
+++ b/hw/sd/ssi-sd.c
@@ -194,6 +194,12 @@ static uint32_t ssi_sd_transfer(SSIPeripheral *dev,
uint32_t val)
/* CMD13 returns a 2-byte statuse work. Other commands
only return the first byte. */
s->arglen = (s->cmd == 13) ? 2 : 1;
+
+ /* handle R1b */
+ if (s->cmd == 28 || s->cmd == 29 || s->cmd == 38) {
+ s->stopping = 1;
+ }
+
cardstatus = ldl_be_p(longresp);
status = 0;
if (((cardstatus >> 9) & 0xf) < 4)
--
2.25.1
- [PATCH v4 0/9] hw/sd: Support block read/write in SPI mode, Bin Meng, 2021/01/28
- [PATCH v4 1/9] hw/sd: ssi-sd: Support multiple block read, Bin Meng, 2021/01/28
- [PATCH v4 2/9] hw/sd: sd: Remove duplicated codes in single/multiple block read/write, Bin Meng, 2021/01/28
- [PATCH v4 3/9] hw/sd: sd: Allow single/multiple block write for SPI mode, Bin Meng, 2021/01/28
- [PATCH v4 4/9] hw/sd: Introduce receive_ready() callback, Bin Meng, 2021/01/28
- [PATCH v4 5/9] hw/sd: ssi-sd: Support single block write, Bin Meng, 2021/01/28
- [PATCH v4 6/9] hw/sd: ssi-sd: Support multiple block write, Bin Meng, 2021/01/28
- [PATCH v4 9/9] hw/sd: ssi-sd: Handle the rest commands with R1b response type,
Bin Meng <=
- [PATCH v4 8/9] hw/sd: ssi-sd: Fix STOP_TRANSMISSION (CMD12) response, Bin Meng, 2021/01/28
- [PATCH v4 7/9] hw/sd: ssi-sd: Fix SEND_IF_COND (CMD8) response, Bin Meng, 2021/01/28