All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] dt-bindings: mmc: add an option to disable HS400 for fsl
@ 2020-11-29 20:31 Adrien Grassein
  2020-11-29 20:31 ` [PATCH 2/2] mmc: sdhci-esdhc-imx: allow to disable HS400 support Adrien Grassein
  2020-12-04 13:18 ` [PATCH 1/2] dt-bindings: mmc: add an option to disable HS400 for fsl Ulf Hansson
  0 siblings, 2 replies; 4+ messages in thread
From: Adrien Grassein @ 2020-11-29 20:31 UTC (permalink / raw)
  Cc: ulf.hansson, robh+dt, shawnguo, s.hauer, kernel, festevam,
	linux-imx, linux-mmc, devicetree, Adrien Grassein

Add an option to disable the hs400 support in the fsl esdhc
driver.

Signed-off-by: Adrien Grassein <adrien.grassein@gmail.com>
---
 Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
index e71d13c2d109..070b40ae8c44 100644
--- a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
+++ b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
@@ -101,6 +101,10 @@ properties:
       If not use this property, driver default set the delay target to value 7.
       Only eMMC HS400 mode need to take care of this property.
     default: 0
+  fsl,no-mmc-hs400:
+    description: |
+      boolean, if present, indicate to disable mmc-hs400 support.
+    type: boolean
 
 required:
   - compatible
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] mmc: sdhci-esdhc-imx: allow to disable HS400 support
  2020-11-29 20:31 [PATCH 1/2] dt-bindings: mmc: add an option to disable HS400 for fsl Adrien Grassein
@ 2020-11-29 20:31 ` Adrien Grassein
  2020-12-04 13:18 ` [PATCH 1/2] dt-bindings: mmc: add an option to disable HS400 for fsl Ulf Hansson
  1 sibling, 0 replies; 4+ messages in thread
From: Adrien Grassein @ 2020-11-29 20:31 UTC (permalink / raw)
  Cc: ulf.hansson, robh+dt, shawnguo, s.hauer, kernel, festevam,
	linux-imx, linux-mmc, devicetree, Adrien Grassein

This patch adds the posibility to remove the HS400
support directly from the devicetree.

This is useful for example for the sdcard slot of the
Nitrogen8M mini that doesn't support the HS400 standard.

Signed-off-by: Adrien Grassein <adrien.grassein@gmail.com>
---
 drivers/mmc/host/sdhci-esdhc-imx.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index fce8fa7e6b30..6fbd4bcca7a1 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -294,6 +294,7 @@ struct pltfm_imx_data {
 	} multiblock_status;
 	u32 is_ddr;
 	struct pm_qos_request pm_qos_req;
+	u32 disable_caps;
 };
 
 static const struct platform_device_id imx_esdhc_devtype[] = {
@@ -454,6 +455,8 @@ static u32 esdhc_readl_le(struct sdhci_host *host, int reg)
 			    IS_ERR_OR_NULL(imx_data->pins_200mhz))
 				val &= ~(SDHCI_SUPPORT_SDR50 | SDHCI_SUPPORT_DDR50
 					 | SDHCI_SUPPORT_SDR104 | SDHCI_SUPPORT_HS400);
+
+			val &= ~imx_data->disable_caps;
 		}
 	}
 
@@ -1502,6 +1505,9 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
 	if (of_property_read_u32(np, "fsl,delay-line", &boarddata->delay_line))
 		boarddata->delay_line = 0;
 
+	if (of_find_property(np, "fsl,no-mmc-hs400", NULL))
+		imx_data->disable_caps |= SDHCI_SUPPORT_HS400;
+
 	mmc_of_parse_voltage(np, &host->ocr_mask);
 
 	if (esdhc_is_usdhc(imx_data)) {
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] dt-bindings: mmc: add an option to disable HS400 for fsl
  2020-11-29 20:31 [PATCH 1/2] dt-bindings: mmc: add an option to disable HS400 for fsl Adrien Grassein
  2020-11-29 20:31 ` [PATCH 2/2] mmc: sdhci-esdhc-imx: allow to disable HS400 support Adrien Grassein
@ 2020-12-04 13:18 ` Ulf Hansson
  2020-12-04 20:06   ` Adrien Grassein
  1 sibling, 1 reply; 4+ messages in thread
From: Ulf Hansson @ 2020-12-04 13:18 UTC (permalink / raw)
  To: Adrien Grassein
  Cc: Rob Herring, Shawn Guo, Sascha Hauer, Sascha Hauer,
	Fabio Estevam, dl-linux-imx, linux-mmc, DTML

On Sun, 29 Nov 2020 at 21:31, Adrien Grassein <adrien.grassein@gmail.com> wrote:
>
> Add an option to disable the hs400 support in the fsl esdhc
> driver.
>
> Signed-off-by: Adrien Grassein <adrien.grassein@gmail.com>
> ---
>  Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
> index e71d13c2d109..070b40ae8c44 100644
> --- a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
> +++ b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
> @@ -101,6 +101,10 @@ properties:
>        If not use this property, driver default set the delay target to value 7.
>        Only eMMC HS400 mode need to take care of this property.
>      default: 0
> +  fsl,no-mmc-hs400:
> +    description: |
> +      boolean, if present, indicate to disable mmc-hs400 support.
> +    type: boolean

You need to disable hs400, because the sdhci capability register
wrongly claims it to be supported, right?

May I suggest using the DT property "sdhci-caps-mask" instead?

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] dt-bindings: mmc: add an option to disable HS400 for fsl
  2020-12-04 13:18 ` [PATCH 1/2] dt-bindings: mmc: add an option to disable HS400 for fsl Ulf Hansson
@ 2020-12-04 20:06   ` Adrien Grassein
  0 siblings, 0 replies; 4+ messages in thread
From: Adrien Grassein @ 2020-12-04 20:06 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Rob Herring, Shawn Guo, Sascha Hauer, Sascha Hauer,
	Fabio Estevam, dl-linux-imx, linux-mmc, DTML

Hello,

Thanks, it's working with your suggestion.

You can delete/abandon these patches.

Thanks a lot,
Regards,
Adrien

Le ven. 4 déc. 2020 à 14:18, Ulf Hansson <ulf.hansson@linaro.org> a écrit :
>
> On Sun, 29 Nov 2020 at 21:31, Adrien Grassein <adrien.grassein@gmail.com> wrote:
> >
> > Add an option to disable the hs400 support in the fsl esdhc
> > driver.
> >
> > Signed-off-by: Adrien Grassein <adrien.grassein@gmail.com>
> > ---
> >  Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
> > index e71d13c2d109..070b40ae8c44 100644
> > --- a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
> > +++ b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
> > @@ -101,6 +101,10 @@ properties:
> >        If not use this property, driver default set the delay target to value 7.
> >        Only eMMC HS400 mode need to take care of this property.
> >      default: 0
> > +  fsl,no-mmc-hs400:
> > +    description: |
> > +      boolean, if present, indicate to disable mmc-hs400 support.
> > +    type: boolean
>
> You need to disable hs400, because the sdhci capability register
> wrongly claims it to be supported, right?
>
> May I suggest using the DT property "sdhci-caps-mask" instead?
>
> Kind regards
> Uffe

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-04 20:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-29 20:31 [PATCH 1/2] dt-bindings: mmc: add an option to disable HS400 for fsl Adrien Grassein
2020-11-29 20:31 ` [PATCH 2/2] mmc: sdhci-esdhc-imx: allow to disable HS400 support Adrien Grassein
2020-12-04 13:18 ` [PATCH 1/2] dt-bindings: mmc: add an option to disable HS400 for fsl Ulf Hansson
2020-12-04 20:06   ` Adrien Grassein

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.