[PATCH v3 3/3] mmc: sdhci-esdhc-imx: consolidate imx25/35 data and add Kingston CID

Luke Wang ziniu.wang_1 at nxp.com
Mon Mar 16 00:56:17 PDT 2026



> -----Original Message-----
> From: Adrián García Casado <adriangarciacasado42 at gmail.com>
> Sent: Monday, March 16, 2026 4:23 AM
> To: Ulf Hansson <ulf.hansson at linaro.org>; Adrian Hunter
> <adrian.hunter at intel.com>
> Cc: Bough Chen <haibo.chen at nxp.com>; Frank Li <frank.li at nxp.com>;
> Sascha Hauer <s.hauer at pengutronix.de>; linux-mmc at vger.kernel.org;
> imx at lists.linux.dev; linux-arm-kernel at lists.infradead.org; linux-
> kernel at vger.kernel.org; Miguel Ojeda <miguel.ojeda.sandonis at gmail.com>;
> Adrián García Casado <adriangarciacasado42 at gmail.com>
> Subject: [EXT] [PATCH v3 3/3] mmc: sdhci-esdhc-imx: consolidate imx25/35
> data and add Kingston CID
> 
> [You don't often get email from adriangarciacasado42 at gmail.com. Learn
> why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> Caution: This is an external email. Please take care when clicking links or
> opening attachments. When in doubt, report the message using the 'Report
> this email' button
> 
> 
> Consolidate esdhc_imx25 and esdhc_imx35 soc data into a single shared
> struct since they share the same flags. This reduces redundancy. Also
> add the CID_MANFID_KINGSTON definition to quirks.h for centralized
> management.
> 
> Signed-off-by: Adrián García Casado <adriangarciacasado42 at gmail.com>
> ---
>  drivers/mmc/core/quirks.h          |  4 ++++
>  drivers/mmc/host/sdhci-esdhc-imx.c | 12 ++++--------
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/mmc/core/quirks.h b/drivers/mmc/core/quirks.h
> index c417ed34c..d736bb4be 100644
> --- a/drivers/mmc/core/quirks.h
> +++ b/drivers/mmc/core/quirks.h
> @@ -15,6 +15,10 @@
> 
>  #include "card.h"
> 
> +#ifndef CID_MANFID_KINGSTON
> +#define CID_MANFID_KINGSTON    0x70
> +#endif
> +
>  static const struct mmc_fixup __maybe_unused mmc_sd_fixups[] = {
>         /*
>          * Kingston Canvas Go! Plus microSD cards never finish SD cache flush.
> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-
> esdhc-imx.c
> index a7a5df673..9cfa26722 100644
> --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
> @@ -256,11 +256,7 @@ struct esdhc_soc_data {
>         u32 quirks;
>  };
> 
> -static const struct esdhc_soc_data esdhc_imx25_data = {
> -       .flags = ESDHC_FLAG_ERR004536,
> -};
> -
> -static const struct esdhc_soc_data esdhc_imx35_data = {
> +static const struct esdhc_soc_data esdhc_imx25_35_data = {
>         .flags = ESDHC_FLAG_ERR004536,
>  };
> 
> @@ -391,8 +387,8 @@ struct pltfm_imx_data {
>  };
> 
>  static const struct of_device_id imx_esdhc_dt_ids[] = {
> -       { .compatible = "fsl,imx25-esdhc", .data = &esdhc_imx25_data, },
> -       { .compatible = "fsl,imx35-esdhc", .data = &esdhc_imx35_data, },
> +       { .compatible = "fsl,imx25-esdhc", .data = &esdhc_imx25_35_data, },
> +       { .compatible = "fsl,imx35-esdhc", .data = &esdhc_imx25_35_data, },
>         { .compatible = "fsl,imx51-esdhc", .data = &esdhc_imx51_data, },
>         { .compatible = "fsl,imx53-esdhc", .data = &esdhc_imx53_data, },
>         { .compatible = "fsl,imx6sx-usdhc", .data = &usdhc_imx6sx_data, },
> @@ -414,7 +410,7 @@ MODULE_DEVICE_TABLE(of, imx_esdhc_dt_ids);
> 
>  static inline int is_imx25_esdhc(struct pltfm_imx_data *data)
>  {
> -       return data->socdata == &esdhc_imx25_data;
> +       return data->socdata == &esdhc_imx25_35_data;
>  }

I think is_imx25_esdhc() is used to distinguish imx25 which Protocol Control Register bits 8&9 are reserved.
While imx35 has bits 8&9. 

if (!is_imx25_esdhc(imx_data)) {
	/* DMA mode bits are shifted */
	new_val |= (val & SDHCI_CTRL_DMA_MASK) << 5;
}

Regards,
Luke

> 
>  static inline int is_imx53_esdhc(struct pltfm_imx_data *data)
> --
> 2.47.3
> 




More information about the linux-arm-kernel mailing list