Skip to contentSkip to conversation

dt-bindings: mmc: add an option to disable HS400 for fsl

PATCH In review Adrien Grassein 2 participants 4 messages Nov 29, 2020 – Dec 4, 2020

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 dt-bindings: mmc: add an option to disable HS400 for fsl

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

---
 Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml +4 -0
index e71d13c2d109..070b40ae8c44 100644
@@ -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
Signature · 1 line
2.20.1
#1 lore raw

PATCH 2/2 mmc: sdhci-esdhc-imx: allow to disable HS400 support

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.

---
 drivers/mmc/host/sdhci-esdhc-imx.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/mmc/host/sdhci-esdhc-imx.c +6 -0
index fce8fa7e6b30..6fbd4bcca7a1 100644
@@ -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)) {
Signature · 1 line
2.20.1
#2 lore raw
In reply to Adrien Grassein
Quoted 14 lines · Adrien Grassein

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

---
 Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml +0 -0
index e71d13c2d109..070b40ae8c44 100644

Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml properties: · line 107

Quoted 7 lines
Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml +4 -0
@@ -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

#3 lore raw

Hello,

Thanks, it's working with your suggestion.

You can delete/abandon these patches.

Thanks a lot,
Regards,
Adrien

Quoted 31 lines · Ulf Hansson
Quoted 14 lines · Adrien Grassein

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

---
 Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml +0 -0
index e71d13c2d109..070b40ae8c44 100644

Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml properties: · line 107

Quoted 7 lines
Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml +4 -0
@@ -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