[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/16] hw/sd/sdcard: Cover more SDCardStates
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 14/16] hw/sd/sdcard: Cover more SDCardStates |
Date: |
Sat, 6 Jul 2024 00:04:32 +0200 |
So far eMMC will only use sd_sleep_state, but
all all states specified for completeness.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Tested-by: Andrew Jeffery <andrew@codeconstruct.com.au>
Tested-by: Cédric Le Goater <clg@redhat.com>
Message-Id: <20240628070216.92609-81-philmd@linaro.org>
---
hw/sd/sd.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 9e6b9c9c63..ecb1b2f405 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -76,7 +76,9 @@ enum SDCardModes {
};
enum SDCardStates {
+ sd_waitirq_state = -2, /* emmc */
sd_inactive_state = -1,
+
sd_idle_state = 0,
sd_ready_state = 1,
sd_identification_state = 2,
@@ -86,6 +88,9 @@ enum SDCardStates {
sd_receivingdata_state = 6,
sd_programming_state = 7,
sd_disconnect_state = 8,
+ sd_bus_test_state = 9, /* emmc */
+ sd_sleep_state = 10, /* emmc */
+ sd_io_state = 15 /* sd */
};
#define SDMMC_CMD_MAX 64
@@ -203,13 +208,19 @@ static const char *sd_state_name(enum SDCardStates state)
[sd_standby_state] = "standby",
[sd_transfer_state] = "transfer",
[sd_sendingdata_state] = "sendingdata",
+ [sd_bus_test_state] = "bus-test",
[sd_receivingdata_state] = "receivingdata",
[sd_programming_state] = "programming",
[sd_disconnect_state] = "disconnect",
+ [sd_sleep_state] = "sleep",
+ [sd_io_state] = "i/o"
};
if (state == sd_inactive_state) {
return "inactive";
}
+ if (state == sd_waitirq_state) {
+ return "wait-irq";
+ }
assert(state < ARRAY_SIZE(state_name));
return state_name[state];
}
--
2.41.0
- [PULL 04/16] hw/sd/sdcard: Generate random RCA value, (continued)
- [PULL 04/16] hw/sd/sdcard: Generate random RCA value, Philippe Mathieu-Daudé, 2024/07/05
- [PULL 05/16] hw/sd/sdcard: Remove leftover comment about removed 'spi' Property, Philippe Mathieu-Daudé, 2024/07/05
- [PULL 06/16] hw/sd/sdcard: Use spec v3.01 by default, Philippe Mathieu-Daudé, 2024/07/05
- [PULL 07/16] hw/sd/sdcard: Rename sd_cmd_SEND_OP_COND handler, Philippe Mathieu-Daudé, 2024/07/05
- [PULL 08/16] hw/sd/sdcard: Add sd_cmd_GEN_CMD handler (CMD56), Philippe Mathieu-Daudé, 2024/07/05
- [PULL 09/16] hw/sd/sdcard: Remove sd_none enum from sd_cmd_type_t, Philippe Mathieu-Daudé, 2024/07/05
- [PULL 10/16] hw/sd/sdcard: Remove noise from sd_acmd_name(), Philippe Mathieu-Daudé, 2024/07/05
- [PULL 11/16] hw/sd/sdcard: Remove noise from sd_cmd_name(), Philippe Mathieu-Daudé, 2024/07/05
- [PULL 12/16] hw/sd/sdcard: Remove default case in read/write on DAT lines, Philippe Mathieu-Daudé, 2024/07/05
- [PULL 14/16] hw/sd/sdcard: Cover more SDCardStates,
Philippe Mathieu-Daudé <=
- [PULL 13/16] hw/sd/sdcard: Trace length of data read on DAT lines, Philippe Mathieu-Daudé, 2024/07/05
- [PULL 15/16] hw/sd/sdcard: Introduce set_csd/set_cid handlers, Philippe Mathieu-Daudé, 2024/07/05
- [PULL 16/16] hw/sd/sdcard: Extract TYPE_SDMMC_COMMON from TYPE_SD_CARD, Philippe Mathieu-Daudé, 2024/07/05
- Re: [PULL 00/16] SD/MMC patches for 2024-07-06, Richard Henderson, 2024/07/07