diff mbox series

[RFC,13/17] hw/sd: Update CMD1 definition for MMC

Message ID 20220318132824.1134400-14-clg@kaod.org
State New
Headers show
Series hw/sd: Rework models for eMMC support | expand

Commit Message

Cédric Le Goater March 18, 2022, 1:28 p.m. UTC
From: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>

Add support to Power up the card and send response r3 in case of MMC.

Signed-off-by: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
[ clg: - ported on aspeed-7.0 patchset ]
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 hw/sd/sd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 517699c5fc98..289764a38bf3 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -2253,8 +2253,8 @@  static const SDProto sd_proto_sd = {
 
 static sd_rsp_type_t sd_emmc_cmd_SEND_OP_CMD(SDState *sd, SDRequest req)
 {
-    sd->state = sd_ready_state;
-    return sd_r3;
+    sd_ocr_powerup(sd);
+    return sd->state == sd_idle_state ? sd_r3 : sd_r0;
 }
 
 static sd_rsp_type_t sd_emmc_cmd_ALL_SEND_CID(SDState *sd, SDRequest req)