mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
hw/sd/sdcard: Allow using SWITCH_FUNCTION in more SPI states
In SPI mode, SWITCH_FUNCTION is valid in all mode
(except the IDLE one).
Fixes: 775616c3ae ("Partial SD card SPI mode support")
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250804133406.17456-8-philmd@linaro.org>
This commit is contained in:
+8
-2
@@ -1488,8 +1488,14 @@ static sd_rsp_type_t sd_cmd_SWITCH_FUNCTION(SDState *sd, SDRequest req)
|
||||
if (sd->mode != sd_data_transfer_mode) {
|
||||
return sd_invalid_mode_for_cmd(sd, req);
|
||||
}
|
||||
if (sd->state != sd_transfer_state) {
|
||||
return sd_invalid_state_for_cmd(sd, req);
|
||||
if (sd_is_spi(sd)) {
|
||||
if (sd->state == sd_idle_state) {
|
||||
return sd_invalid_state_for_cmd(sd, req);
|
||||
}
|
||||
} else {
|
||||
if (sd->state != sd_transfer_state) {
|
||||
return sd_invalid_state_for_cmd(sd, req);
|
||||
}
|
||||
}
|
||||
|
||||
sd_function_switch(sd, req.arg);
|
||||
|
||||
Reference in New Issue
Block a user