]> www.infradead.org Git - users/dwmw2/qemu.git/commit
hw/sd/omap_mmc: Don't use sd_cmd_type_t
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 29 Oct 2024 12:54:42 +0000 (12:54 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 29 Oct 2024 15:04:46 +0000 (15:04 +0000)
commit77dd098a5e790e3ede0dea5ddd5f690086fe608c
tree867234d69457c6f2b93191f8690643a7e2d17a20
parent1505b651fdbd9af59a4a90876a62ae7ea2d4cd39
hw/sd/omap_mmc: Don't use sd_cmd_type_t

In commit 1ab08790bb75e4 we did some refactoring of the SD card
implementation, which included a rearrangement of the sd_cmd_type_t
enum values.  Unfortunately we didn't notice that this enum is not
used solely inside the SD card model itself, but is also used by the
OMAP MMC controller device.  In the OMAP MMC controller, it is used
to implement the handling of the Type field of the MMC_CMD register,
so changing the enum values so that they no longer lined up with the
bit definitions for that register field broke the controller model.
The effect is that Linux fails to boot from an SD card on the "sx1"
machine.

Give omap-mmc its own enum which we can document as needing to match
the encoding used in this device's register, so it isn't sharing
sd_cmd_type_t with the SD card model any more.  We can then move
sd_cmd_type_t's definition out of sd.h and into sd.c, which is the
only place that uses it.

Cc: qemu-stable@nongnu.org
Fixes: 1ab08790bb75 ("hw/sd/sdcard: Store command type in SDProto")
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20241017162755.710698-1-peter.maydell@linaro.org
hw/sd/omap_mmc.c
hw/sd/sd.c
include/hw/sd/sd.h