diff mbox series

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

Message ID 20190214082207.12082-1-yangbo.lu@nxp.com
State Superseded
Delegated to: Prabhakar Kushwaha
Headers show
Series [U-Boot,1/3] mmc: fsl_esdhc: add esdhc_imx flag | expand

Commit Message

Yangbo Lu Feb. 14, 2019, 8:21 a.m. UTC
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@nxp.com>
---
 drivers/mmc/fsl_esdhc.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Peng Fan Feb. 14, 2019, 9:11 a.m. UTC | #1
> -----Original Message-----
> From: Y.b. Lu
> Sent: 2019年2月14日 16:21
> To: u-boot@lists.denx.de
> Cc: Jaehoon Chung <jh80.chung@samsung.com>; Prabhakar Kushwaha
> <prabhakar.kushwaha@nxp.com>; Peng Fan <peng.fan@nxp.com>; Y.b. Lu
> <yangbo.lu@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@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
Yangbo Lu Feb. 15, 2019, 2:28 a.m. UTC | #2
> -----Original Message-----
> From: Peng Fan
> Sent: Thursday, February 14, 2019 5:11 PM
> To: Y.b. Lu <yangbo.lu@nxp.com>; u-boot@lists.denx.de
> Cc: Jaehoon Chung <jh80.chung@samsung.com>; Prabhakar Kushwaha
> <prabhakar.kushwaha@nxp.com>
> Subject: RE: [PATCH 1/3] mmc: fsl_esdhc: add esdhc_imx flag
> 
> 
> 
> > -----Original Message-----
> > From: Y.b. Lu
> > Sent: 2019年2月14日 16:21
> > To: u-boot@lists.denx.de
> > Cc: Jaehoon Chung <jh80.chung@samsung.com>; Prabhakar Kushwaha
> > <prabhakar.kushwaha@nxp.com>; Peng Fan <peng.fan@nxp.com>; Y.b. Lu
> > <yangbo.lu@nxp.com>
> > Subject: [PATCH 1/3] mmc: fsl_esdhc: add esdhc_imx flag
> >
[...]
> > +	/*
> > +	 * 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.
> 

[Y.b. Lu] Sent out v2, and converted to use device_is_compatible().
Thanks a lot.

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

Patch

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;
+
 	val = dev_read_u32_default(dev, "bus-width", -1);
 	if (val == 8)
 		priv->bus_width = 8;