On Tue, 11 Mar 2025, Philippe Mathieu-Daudé wrote:
> All instances of TYPE_IMX_USDHC set vendor=SDHCI_VENDOR_IMX.
> No need to special-case it.
Typo in subject. It's actually SDHCI_VENDOR_IMX which is removed by this
patch.
Regards,
BALATON Zoltan
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu>
> Reviewed-by: Bernhard Beschow <shentey@gmail.com>
> Message-Id: <20250308213640.13138-3-philmd@linaro.org>
> ---
> include/hw/sd/sdhci.h | 1 -
> hw/arm/fsl-imx25.c | 2 --
> hw/arm/fsl-imx6.c | 2 --
> hw/arm/fsl-imx6ul.c | 2 --
> hw/arm/fsl-imx7.c | 2 --
> hw/arm/fsl-imx8mp.c | 2 --
> hw/sd/sdhci.c | 14 ++++----------
> 7 files changed, 4 insertions(+), 21 deletions(-)
>
> diff --git a/include/hw/sd/sdhci.h b/include/hw/sd/sdhci.h
> index f722d8eb1cc..51fb30ea528 100644
> --- a/include/hw/sd/sdhci.h
> +++ b/include/hw/sd/sdhci.h
> @@ -109,7 +109,6 @@ struct SDHCIState {
> typedef struct SDHCIState SDHCIState;
>
> #define SDHCI_VENDOR_NONE 0
> -#define SDHCI_VENDOR_IMX 1
> #define SDHCI_VENDOR_FSL 2
>
> /*
> diff --git a/hw/arm/fsl-imx25.c b/hw/arm/fsl-imx25.c
> index 5359a6d8d3b..02214ca1a1c 100644
> --- a/hw/arm/fsl-imx25.c
> +++ b/hw/arm/fsl-imx25.c
> @@ -243,8 +243,6 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
> &error_abort);
> object_property_set_uint(OBJECT(&s->esdhc[i]), "capareg",
> IMX25_ESDHC_CAPABILITIES, &error_abort);
> - object_property_set_uint(OBJECT(&s->esdhc[i]), "vendor",
> - SDHCI_VENDOR_IMX, &error_abort);
> if (!sysbus_realize(SYS_BUS_DEVICE(&s->esdhc[i]), errp)) {
> return;
> }
> diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c
> index dc86338b3a5..a114dc0d63d 100644
> --- a/hw/arm/fsl-imx6.c
> +++ b/hw/arm/fsl-imx6.c
> @@ -327,8 +327,6 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
> &error_abort);
> object_property_set_uint(OBJECT(&s->esdhc[i]), "capareg",
> IMX6_ESDHC_CAPABILITIES, &error_abort);
> - object_property_set_uint(OBJECT(&s->esdhc[i]), "vendor",
> - SDHCI_VENDOR_IMX, &error_abort);
> if (!sysbus_realize(SYS_BUS_DEVICE(&s->esdhc[i]), errp)) {
> return;
> }
> diff --git a/hw/arm/fsl-imx6ul.c b/hw/arm/fsl-imx6ul.c
> index 34c4aa15cd0..ce8d3ef535f 100644
> --- a/hw/arm/fsl-imx6ul.c
> +++ b/hw/arm/fsl-imx6ul.c
> @@ -531,8 +531,6 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
> FSL_IMX6UL_USDHC2_IRQ,
> };
>
> - object_property_set_uint(OBJECT(&s->usdhc[i]), "vendor",
> - SDHCI_VENDOR_IMX, &error_abort);
> sysbus_realize(SYS_BUS_DEVICE(&s->usdhc[i]), &error_abort);
>
> sysbus_mmio_map(SYS_BUS_DEVICE(&s->usdhc[i]), 0,
> diff --git a/hw/arm/fsl-imx7.c b/hw/arm/fsl-imx7.c
> index 3374018cde0..ed1f10bca26 100644
> --- a/hw/arm/fsl-imx7.c
> +++ b/hw/arm/fsl-imx7.c
> @@ -471,8 +471,6 @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
> FSL_IMX7_USDHC3_IRQ,
> };
>
> - object_property_set_uint(OBJECT(&s->usdhc[i]), "vendor",
> - SDHCI_VENDOR_IMX, &error_abort);
> sysbus_realize(SYS_BUS_DEVICE(&s->usdhc[i]), &error_abort);
>
> sysbus_mmio_map(SYS_BUS_DEVICE(&s->usdhc[i]), 0,
> diff --git a/hw/arm/fsl-imx8mp.c b/hw/arm/fsl-imx8mp.c
> index 1ea98e14635..c3f6da63220 100644
> --- a/hw/arm/fsl-imx8mp.c
> +++ b/hw/arm/fsl-imx8mp.c
> @@ -524,8 +524,6 @@ static void fsl_imx8mp_realize(DeviceState *dev, Error **errp)
> { fsl_imx8mp_memmap[FSL_IMX8MP_USDHC3].addr, FSL_IMX8MP_USDHC3_IRQ },
> };
>
> - object_property_set_uint(OBJECT(&s->usdhc[i]), "vendor",
> - SDHCI_VENDOR_IMX, &error_abort);
> if (!sysbus_realize(SYS_BUS_DEVICE(&s->usdhc[i]), errp)) {
> return;
> }
> diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
> index fe87e18d5d2..69baf73ae9b 100644
> --- a/hw/sd/sdhci.c
> +++ b/hw/sd/sdhci.c
> @@ -1735,16 +1735,10 @@ usdhc_write(void *opaque, hwaddr offset, uint64_t val, unsigned size)
>
> case USDHC_VENDOR_SPEC:
> s->vendor_spec = value;
> - switch (s->vendor) {
> - case SDHCI_VENDOR_IMX:
> - if (value & USDHC_IMX_FRC_SDCLK_ON) {
> - s->prnsts &= ~SDHC_IMX_CLOCK_GATE_OFF;
> - } else {
> - s->prnsts |= SDHC_IMX_CLOCK_GATE_OFF;
> - }
> - break;
> - default:
> - break;
> + if (value & USDHC_IMX_FRC_SDCLK_ON) {
> + s->prnsts &= ~SDHC_IMX_CLOCK_GATE_OFF;
> + } else {
> + s->prnsts |= SDHC_IMX_CLOCK_GATE_OFF;
> }
> break;
>
>