From: Cédric Le Goater <[email protected]>
Signed-off-by: Cédric Le Goater <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
hw/sd/sd.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 90da24ad2d..d38ee5094d 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -2207,6 +2207,17 @@ static sd_rsp_type_t sd_emmc_cmd_APP_CMD(SDState *sd,
SDRequest req)
return sd_r0;
}
+static sd_rsp_type_t sd_emmc_cmd_SEND_TUNING_BLOCK(SDState *sd, SDRequest req)
+{
+ if (sd->state != sd_transfer_state) {
+ sd_invalid_state_for_cmd(sd, req);
+ }
+
+ sd->state = sd_sendingdata_state;
+ sd->data_offset = 0;
+ return sd_r1;
+}
+
static const SDProto sd_proto_emmc = {
.name = "eMMC",
.cmd = {
@@ -2216,6 +2227,7 @@ static const SDProto sd_proto_emmc = {
[3] = sd_emmc_cmd_SEND_RELATIVE_ADDR,
[5] = sd_cmd_illegal,
[19] = sd_cmd_SEND_TUNING_BLOCK,
+ [21] = sd_emmc_cmd_SEND_TUNING_BLOCK,
[41] = sd_cmd_illegal,
[52 ... 54] = sd_cmd_illegal,
[55] = sd_emmc_cmd_APP_CMD,
--
2.36.1