aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2024-06-12 23:38:31 +0200
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2024-07-02 10:08:32 +0200
commit8aaae7fd191cdb7f72d2d8956d92d3acaf7cd7a4 (patch)
treeb55bfcebab43308521e279814f8fa890a9925718
parenta171b753365d308b98d5e4db4dafa55369eea917 (diff)
hw/sd/sdcard: Add spi_cmd_READ_OCR handler (CMD58)
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Tested-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Message-Id: <20240628070216.92609-67-philmd@linaro.org>
-rw-r--r--hw/sd/sd.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index f5548d5667..08fb3cf9d3 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1641,6 +1641,12 @@ static sd_rsp_type_t sd_cmd_APP_CMD(SDState *sd, SDRequest req)
return sd_r1;
}
+/* CMD58 */
+static sd_rsp_type_t spi_cmd_READ_OCR(SDState *sd, SDRequest req)
+{
+ return sd_r3;
+}
+
static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
{
uint64_t addr;
@@ -1744,9 +1750,6 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
}
break;
- case 58: /* CMD58: READ_OCR (SPI) */
- return sd_r3;
-
case 59: /* CMD59: CRC_ON_OFF (SPI) */
return sd_r1;
@@ -2326,6 +2329,7 @@ static const SDProto sd_proto_spi = {
[53] = {9, sd_spi, "IO_RW_EXTENDED", sd_cmd_optional},
[55] = {8, sd_spi, "APP_CMD", sd_cmd_APP_CMD},
[57] = {10, sd_spi, "DIRECT_SECURE_WRITE", sd_cmd_optional},
+ [58] = {0, sd_spi, "READ_OCR", spi_cmd_READ_OCR},
},
.acmd = {
[41] = {8, sd_spi, "SEND_OP_COND", spi_cmd_SEND_OP_COND},