From: Bernhard Beschow Date: Thu, 1 Jan 2026 08:44:55 +0000 (+0100) Subject: hw/sd/sdhci: Remove vendor property X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7980909d65d5650f51fde560736eaa7e5d72c019;p=thirdparty%2Fqemu.git hw/sd/sdhci: Remove vendor property Now that there are dedicated eSDHC device models it is possible to replace the "vendor" property (which is really a device-specific property) with a dynamic cast, "fishing" out only the device models which shall have the quirk applied. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Tested-by: BALATON Zoltan Message-ID: <20260112145418.220506-14-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- diff --git a/hw/sd/sdhci-internal.h b/hw/sd/sdhci-internal.h index 50fb746a17..4aeed120bf 100644 --- a/hw/sd/sdhci-internal.h +++ b/hw/sd/sdhci-internal.h @@ -309,7 +309,6 @@ extern const VMStateDescription sdhci_vmstate; #define DEFINE_SDHCI_COMMON_PROPERTIES(_state) \ DEFINE_PROP_UINT8("sd-spec-version", _state, sd_spec_version, 2), \ DEFINE_PROP_UINT8("uhs", _state, uhs_mode, UHS_NOT_SUPPORTED), \ - DEFINE_PROP_UINT8("vendor", _state, vendor, SDHCI_VENDOR_NONE), \ \ /* Capabilities registers provide information on supported * features of this specific host controller implementation */ \ diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index eab814096d..c86dfa281f 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -307,7 +307,8 @@ static void sdhci_reset(SDHCIState *s) s->data_count = 0; s->stopped_state = sdhc_not_stopped; s->pending_insert_state = false; - if (s->vendor == SDHCI_VENDOR_FSL) { + if (object_dynamic_cast(OBJECT(s), TYPE_FSL_ESDHC_BE) || + object_dynamic_cast(OBJECT(s), TYPE_FSL_ESDHC_LE)) { s->norintstsen = 0x013f; s->errintstsen = 0x117f; } @@ -1863,7 +1864,6 @@ static void fsl_esdhc_be_init(Object *obj) s->io_ops = &esdhc_mmio_be_ops; s->quirks = SDHCI_QUIRK_NO_BUSY_IRQ; qdev_prop_set_uint8(dev, "sd-spec-version", 2); - qdev_prop_set_uint8(dev, "vendor", SDHCI_VENDOR_FSL); } static const MemoryRegionOps esdhc_mmio_le_ops = { @@ -1889,7 +1889,6 @@ static void fsl_esdhc_le_init(Object *obj) s->io_ops = &esdhc_mmio_le_ops; s->quirks = SDHCI_QUIRK_NO_BUSY_IRQ; qdev_prop_set_uint8(dev, "sd-spec-version", 2); - qdev_prop_set_uint8(dev, "vendor", SDHCI_VENDOR_FSL); } static const MemoryRegionOps usdhc_mmio_ops = { diff --git a/include/hw/sd/sdhci.h b/include/hw/sd/sdhci.h index 51551348cf..a9da6203fc 100644 --- a/include/hw/sd/sdhci.h +++ b/include/hw/sd/sdhci.h @@ -98,7 +98,6 @@ struct SDHCIState { uint32_t quirks; uint8_t sd_spec_version; uint8_t uhs_mode; - uint8_t vendor; /* For vendor specific functionality */ /* * Write Protect pin default active low for detecting SD card * to be protected. Set wp_inverted to invert the signal. @@ -107,9 +106,6 @@ struct SDHCIState { }; typedef struct SDHCIState SDHCIState; -#define SDHCI_VENDOR_NONE 0 -#define SDHCI_VENDOR_FSL 2 - /* * Controller does not provide transfer-complete interrupt when not * busy.