[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 07/17] hw/sd: Add sd_cmd_SEND_OP_CMD() handler
From: |
Cédric Le Goater |
Subject: |
[RFC PATCH 07/17] hw/sd: Add sd_cmd_SEND_OP_CMD() handler |
Date: |
Fri, 18 Mar 2022 14:28:14 +0100 |
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210624142209.1193073-9-f4bug@amsat.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/sd/sd.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 30429e8954d3..a6ce54433388 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1010,6 +1010,13 @@ static sd_rsp_type_t sd_cmd_GO_IDLE_STATE(SDState *sd,
SDRequest req)
return sd->spi ? sd_r1 : sd_r0;
}
+static sd_rsp_type_t sd_cmd_SEND_OP_CMD(SDState *sd, SDRequest req)
+{
+ sd->state = sd_transfer_state;
+
+ return sd_r1;
+}
+
static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
{
uint32_t rca = 0x0000;
@@ -1049,10 +1056,6 @@ static sd_rsp_type_t sd_normal_command(SDState *sd,
SDRequest req)
switch (req.cmd) {
/* Basic commands (Class 0 and Class 1) */
- case 1: /* CMD1: SEND_OP_CMD */
- sd->state = sd_transfer_state;
- return sd_r1;
-
case 2: /* CMD2: ALL_SEND_CID */
switch (sd->state) {
case sd_ready_state:
@@ -1602,11 +1605,6 @@ static sd_rsp_type_t sd_app_command(SDState *sd,
break;
case 41: /* ACMD41: SD_APP_OP_COND */
- if (sd->spi) {
- /* SEND_OP_CMD */
- sd->state = sd_transfer_state;
- return sd_r1;
- }
if (sd->state != sd_idle_state) {
break;
}
@@ -2111,6 +2109,7 @@ static const SDProto sd_proto_spi = {
.name = "SPI",
.cmd = {
[0] = sd_cmd_GO_IDLE_STATE,
+ [1] = sd_cmd_SEND_OP_CMD,
[2 ... 4] = sd_cmd_illegal,
[5] = sd_cmd_illegal,
[7] = sd_cmd_illegal,
@@ -2120,6 +2119,7 @@ static const SDProto sd_proto_spi = {
},
.cmd = {
[6] = sd_cmd_unimplemented,
+ [41] = sd_cmd_SEND_OP_CMD,
},
};
--
2.34.1
- [RFC PATCH 12/17] hw/sd: Fix SET_BLOCK_COUNT command argument, (continued)
- [RFC PATCH 12/17] hw/sd: Fix SET_BLOCK_COUNT command argument, Cédric Le Goater, 2022/03/18
- [RFC PATCH 17/17] hw/sd: Subtract bootarea size from blk, Cédric Le Goater, 2022/03/18
- [RFC PATCH 06/17] hw/sd: Add sd_cmd_GO_IDLE_STATE() handler, Cédric Le Goater, 2022/03/18
- [RFC PATCH 04/17] hw/sd: Add sd_cmd_illegal() handler, Cédric Le Goater, 2022/03/18
- [RFC PATCH 14/17] hw/sd: Add CMD21 tuning sequence, Cédric Le Goater, 2022/03/18
- [RFC PATCH 05/17] hw/sd: Add sd_cmd_unimplemented() handler, Cédric Le Goater, 2022/03/18
- [RFC PATCH 13/17] hw/sd: Update CMD1 definition for MMC, Cédric Le Goater, 2022/03/18
- [RFC PATCH 11/17] hw/sd: Add eMMC support, Cédric Le Goater, 2022/03/18
- [RFC PATCH 07/17] hw/sd: Add sd_cmd_SEND_OP_CMD() handler,
Cédric Le Goater <=
- [RFC PATCH 10/17] hw/sd: Add sd_cmd_SEND_TUNING_BLOCK() handler, Cédric Le Goater, 2022/03/18
- [RFC PATCH 03/17] hw/sd: Introduce sd_cmd_handler type, Cédric Le Goater, 2022/03/18
- [RFC PATCH 16/17] hw/sd: Support boot area in emmc image, Cédric Le Goater, 2022/03/18
- [RFC PATCH 15/17] hw/sd: Add mmc switch function support, Cédric Le Goater, 2022/03/18
- [RFC PATCH 08/17] hw/sd: Add sd_cmd_ALL_SEND_CID() handler, Cédric Le Goater, 2022/03/18
- [RFC PATCH 09/17] hw/sd: Add sd_cmd_SEND_RELATIVE_ADDR() handler, Cédric Le Goater, 2022/03/18