summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonardo Graboski Veiga <leonardo.veiga@toradex.com>2016-11-01 13:58:25 -0200
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2017-01-11 15:44:46 +0100
commit4a8d0855432d0467928ec46bae8813f831138674 (patch)
tree79c1fcee49159446070698a6f54342fc7962df1e
parent3816bd77aad30bee3904358faa286b32c2b35b92 (diff)
sdhci-esdhc-imx: fix bus-width for 1-bit operation.
The 1-bit operation mode, enabled by setting the 'bus-width' property of the device tree 'esdhc' node to <1>, does not work while using SD card. The behavior is only noticed when only the data pin 0 is connected to the hardware. A series of kernel errors are printed to the console, all of them returning the following error message followed by some explanation: mmcblk0: error -84 transferring data If four data lines are connected, it ignores the device-tree property and works in 4-bit mode of operation without errors. The hardware used for testing does not support 8-bit mode. Check the 'bus-width' property and if set to <1>, enable the SDHCI_QUIRK_FORCE_1_BIT_DATA quirk. Signed-off-by: Leonardo Graboski Veiga <leonardo.veiga@toradex.com> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
-rw-r--r--drivers/mmc/host/sdhci-esdhc-imx.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index c9fbc4c3fcdd..deddf0dcb75f 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -1003,6 +1003,10 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V;
}
+ if (!of_property_read_u32(np, "bus-width", &boarddata->max_bus_width)
+ && boarddata->max_bus_width == 1)
+ host->quirks |= SDHCI_QUIRK_FORCE_1_BIT_DATA;
+
/* call to generic mmc_of_parse to support additional capabilities */
ret = mmc_of_parse(host->mmc);
if (ret)