[U-Boot] [PATCH 1/3] mmc: fsl_esdhc: add esdhc_imx flag

Peng Fan peng.fan at nxp.com
Thu Feb 14 09:11:09 UTC 2019



> -----Original Message-----
> From: Y.b. Lu
> Sent: 2019年2月14日 16:21
> To: u-boot at lists.denx.de
> Cc: Jaehoon Chung <jh80.chung at samsung.com>; Prabhakar Kushwaha
> <prabhakar.kushwaha at nxp.com>; Peng Fan <peng.fan at nxp.com>; Y.b. Lu
> <yangbo.lu at nxp.com>
> Subject: [PATCH 1/3] mmc: fsl_esdhc: add esdhc_imx flag
> 
> The fsl_esdhc driver was for Freescale eSDHC on MPC83XX/MPC85XX initially.
> The later QoriQ series processors (which are evolutions of
> MPC83XX/MPC85XX) and i.MX series processors were using this driver for
> their eSDHCs too.
> 
> So there are two evolution directions for eSDHC now. For the two series
> processors, the eSDHCs are becoming more and more different.
> We should have split it into two drivers, like them
> (sdhci-of-esdhc.c/sdhci-esdhc-imx.c) in linux kernel. But it seemed to be a lot
> of work now. So let's keep as it is. Be very careful to change the driver if the
> changes are not common for all eSDHCs, and clarify i.MX eSDHC specific
> things to distingush them with QorIQ eSDHC.
> 
> This patch is to added an esdhc_imx flag for the development of i.MX eSDHC,
> to distinguish it with QoriQ eSDHC.
> 
> Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
> ---
>  drivers/mmc/fsl_esdhc.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index
> 21fa2ab1d4..787a13a8a9 100644
> --- a/drivers/mmc/fsl_esdhc.c
> +++ b/drivers/mmc/fsl_esdhc.c
> @@ -147,6 +147,7 @@ struct fsl_esdhc_priv {
>  	struct gpio_desc cd_gpio;
>  	struct gpio_desc wp_gpio;
>  #endif
> +	bool esdhc_imx;
>  };
> 
>  /* Return the XFERTYP flags for a given command and data packet */ @@
> -1462,6 +1463,16 @@ static int fsl_esdhc_probe(struct udevice *dev)
>  		priv->caps = data->caps;
>  	}
> 
> +	/*
> +	 * This is to specify whether current eSDHC is an i.MX eSDHC,
> +	 * since the i.MX eSDHC has been becoming more and more different
> +	 * with QorIQ eSDHC and initial MPC83XX/MPC85XX.
> +	 */
> +	if (!fdt_node_check_compatible(fdt, node, "fsl,esdhc"))
> +		priv->esdhc_imx = true;
> +	else
> +		priv->esdhc_imx = false;

Suggest use device_is_compatible(dev, "fsl,esdhc")

Regards,
Peng.

> +
>  	val = dev_read_u32_default(dev, "bus-width", -1);
>  	if (val == 8)
>  		priv->bus_width = 8;
> --
> 2.17.1



More information about the U-Boot mailing list