diff options
author | Bin Meng <bin.meng@windriver.com> | 2021-01-28 14:30:33 +0800 |
---|---|---|
committer | Philippe Mathieu-Daudé <f4bug@amsat.org> | 2021-02-20 00:17:09 +0100 |
commit | 6ae29af3ed4b24dc733ed4186ebe906b6d1063cd (patch) | |
tree | 71e9fda95765b1a901e220192d35695be1956d5d | |
parent | d56f3efa28043d17ca0c71752dbde81b25a042cb (diff) | |
download | qemu-6ae29af3ed4b24dc733ed4186ebe906b6d1063cd.zip qemu-6ae29af3ed4b24dc733ed4186ebe906b6d1063cd.tar.gz qemu-6ae29af3ed4b24dc733ed4186ebe906b6d1063cd.tar.bz2 |
hw/sd: ssi-sd: Fix SEND_IF_COND (CMD8) response
The SEND_IF_COND command (CMD8) response is of format R7, but
current code returns R1 for CMD8. Fix it.
Fixes: 775616c3ae8c ("Partial SD card SPI mode support")
Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210128063035.15674-8-bmeng.cn@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
-rw-r--r-- | hw/sd/ssi-sd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/sd/ssi-sd.c b/hw/sd/ssi-sd.c index 200e885..84c873b 100644 --- a/hw/sd/ssi-sd.c +++ b/hw/sd/ssi-sd.c @@ -176,9 +176,9 @@ static uint32_t ssi_sd_transfer(SSIPeripheral *dev, uint32_t val) s->arglen = 1; s->response[0] = 4; DPRINTF("SD command failed\n"); - } else if (s->cmd == 58) { - /* CMD58 returns R3 response (OCR) */ - DPRINTF("Returned OCR\n"); + } else if (s->cmd == 8 || s->cmd == 58) { + /* CMD8/CMD58 returns R3/R7 response */ + DPRINTF("Returned R3/R7\n"); s->arglen = 5; s->response[0] = 1; memcpy(&s->response[1], longresp, 4); |