mmc: sdhci-esdhc-imx: enable Auto CMD12 for Vybrid
Subsystems (5)
PATCH 1/1 mmc: sdhci-esdhc-imx: enable Auto CMD12 for Vybrid
Add a compatible string to support Vybrid version of controller.
Enable Auto CMD12 for multi block read/write, as described in Vybrid Reference Manual Chapter 50.6.3 "Card access".
This patch fixes support for SDIO devices, such as WiFi kits.
Tested on a VF610-based board.
--- .../devicetree/bindings/mmc/fsl-imx-esdhc.txt | 1 + arch/arm/boot/dts/vfxxx.dtsi | 4 ++-- drivers/mmc/host/sdhci-esdhc-imx.c | 18 +++++++++++++++++- 3 files changed, 20 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt +1 -0
@@ -12,6 +12,7 @@ Required properties: "fsl,imx35-esdhc" "fsl,imx51-esdhc" "fsl,imx53-esdhc" + "fsl,vf610-esdhc" "fsl,imx6q-usdhc" "fsl,imx6sl-usdhc" "fsl,imx6sx-usdhc"
arch/arm/boot/dts/vfxxx.dtsi +2 -2
@@ -464,7 +464,7 @@ }; esdhc0: esdhc at 400b1000 { - compatible = "fsl,imx53-esdhc"; + compatible = "fsl,vf610-esdhc"; reg = <0x400b1000 0x1000>; interrupts = <27 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clks VF610_CLK_IPG_BUS>,
@@ -477,7 +477,7 @@ }; esdhc1: esdhc at 400b2000 { - compatible = "fsl,imx53-esdhc"; + compatible = "fsl,vf610-esdhc"; reg = <0x400b2000 0x1000>; interrupts = <28 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clks VF610_CLK_IPG_BUS>,
drivers/mmc/host/sdhci-esdhc-imx.c +17 -1
@@ -135,6 +135,8 @@#define ESDHC_FLAG_HS200 BIT(8)/* The IP supports HS400 mode */ #define ESDHC_FLAG_HS400 BIT(9) +/* Fix multiblock reads on Vybrid */ +#define ESDHC_FLAG_MULTIBLOCK_ACMD12 BIT(10)/* A higher clock ferquency than this rate requires strobell dll control */ #define ESDHC_STROBE_DLL_CLK_FREQ 100000000
@@ -180,6 +182,10 @@ static struct esdhc_soc_data usdhc_imx7d_data = { | ESDHC_FLAG_HS400, }; +static struct esdhc_soc_data esdhc_vf610_data = { + .flags =ESDHC_FLAG_MULTIBLK_NO_INT |ESDHC_FLAG_MULTIBLOCK_ACMD12 , +}; +struct pltfm_imx_data {u32 scratchpad;struct pinctrl *pinctrl;
@@ -224,6 +230,7 @@ static const struct of_device_id imx_esdhc_dt_ids[] = { { .compatible = "fsl,imx6sl-usdhc", .data = &usdhc_imx6sl_data, }, { .compatible = "fsl,imx6q-usdhc", .data = &usdhc_imx6q_data, }, { .compatible = "fsl,imx7d-usdhc", .data = &usdhc_imx7d_data, }, + { .compatible = "fsl,vf610-esdhc", .data = &esdhc_vf610_data, }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, imx_esdhc_dt_ids);
@@ -248,6 +255,11 @@ static inline int esdhc_is_usdhc(struct pltfm_imx_data *data)return !!(data->socdata->flags &ESDHC_FLAG_USDHC ); } +static inline int is_vf610_esdhc (struct pltfm_imx_data *data) +{ +return data->socdata == &esdhc_vf610_data; +} +static inline void esdhc_clrset_le (struct sdhci_host *host,u32 mask,u32 val,int reg) {void __iomem *base = host->ioaddr + (reg & ~0x3 );
@@ -887,7 +899,8 @@ static void esdhc_set_uhs_signaling(struct sdhci_host *host, unsigned timing) v = boarddata->delay_line <<ESDHC_DLL_OVERRIDE_VAL_SHIFT | (1 <<ESDHC_DLL_OVERRIDE_EN_SHIFT ); -if (is_imx53_esdhc (imx_data)) +if (is_imx53_esdhc (imx_data) || +is_vf610_esdhc (imx_data)) v <<=1 ;writel (v, host->ioaddr +ESDHC_DLL_CTRL ); }
@@ -1206,6 +1219,9 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)if (imx_data->socdata->flags &ESDHC_FLAG_HS400 ) host->quirks2 |=SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400 ; +if (imx_data->socdata->flags &ESDHC_FLAG_MULTIBLOCK_ACMD12 ) + host->quirks |=SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 ; +if (of_id) err =sdhci_esdhc_imx_probe_dt (pdev, host, imx_data);else
Signature · 1 line
1.9.3
PATCH 1/1 mmc: sdhci-esdhc-imx: enable Auto CMD12 for Vybrid
Quoted 7 lines · Sergei Miroshnichenko
Add a compatible string to support Vybrid version of controller.
Enable Auto CMD12 for multi block read/write, as described in Vybrid Reference Manual Chapter 50.6.3 "Card access".
This patch fixes support for SDIO devices, such as WiFi kits.
Quoted 7 lines
Tested on a VF610-based board.
Signed-off-by Sergei Miroshnichenko <[email protected]>--- .../devicetree/bindings/mmc/fsl-imx-esdhc.txt | 1 + arch/arm/boot/dts/vfxxx.dtsi | 4 ++-- drivers/mmc/host/sdhci-esdhc-imx.c | 18 +++++++++++++++++-
Please split it into 3 patches: mmc, binding and dts, and use scripts/get_maintainer.pl to get people and list patches should be sent to.
Shawn
Quoted 109 lines
3 files changed, 20 insertions(+), 3 deletions(-)Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt +1
-0@@ -12,6 +12,7 @@ Required properties: "fsl,imx35-esdhc" "fsl,imx51-esdhc" "fsl,imx53-esdhc" + "fsl,vf610-esdhc" "fsl,imx6q-usdhc" "fsl,imx6sl-usdhc" "fsl,imx6sx-usdhc"arch/arm/boot/dts/vfxxx.dtsi +2
-2@@ -464,7 +464,7 @@ }; esdhc0: esdhc at 400b1000 { - compatible = "fsl,imx53-esdhc"; + compatible = "fsl,vf610-esdhc"; reg = <0x400b1000 0x1000>; interrupts = <27 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clks VF610_CLK_IPG_BUS>,@@ -477,7 +477,7 @@ }; esdhc1: esdhc at 400b2000 { - compatible = "fsl,imx53-esdhc"; + compatible = "fsl,vf610-esdhc"; reg = <0x400b2000 0x1000>; interrupts = <28 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clks VF610_CLK_IPG_BUS>,drivers/mmc/host/sdhci-esdhc-imx.c +17
-1@@ -135,6 +135,8 @@#define ESDHC_FLAG_HS200 BIT(8)/* The IP supports HS400 mode */ #define ESDHC_FLAG_HS400 BIT(9) +/* Fix multiblock reads on Vybrid */ +#define ESDHC_FLAG_MULTIBLOCK_ACMD12 BIT(10)/* A higher clock ferquency than this rate requires strobell dll control */ #define ESDHC_STROBE_DLL_CLK_FREQ 100000000@@ -180,6 +182,10 @@ static struct esdhc_soc_data usdhc_imx7d_data = { | ESDHC_FLAG_HS400, }; +static struct esdhc_soc_data esdhc_vf610_data = { + .flags =ESDHC_FLAG_MULTIBLK_NO_INT |ESDHC_FLAG_MULTIBLOCK_ACMD12 , +}; +struct pltfm_imx_data {u32 scratchpad;struct pinctrl *pinctrl;@@ -224,6 +230,7 @@ static const struct of_device_id imx_esdhc_dt_ids[] = { { .compatible = "fsl,imx6sl-usdhc", .data = &usdhc_imx6sl_data, }, { .compatible = "fsl,imx6q-usdhc", .data = &usdhc_imx6q_data, }, { .compatible = "fsl,imx7d-usdhc", .data = &usdhc_imx7d_data, }, + { .compatible = "fsl,vf610-esdhc", .data = &esdhc_vf610_data, }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, imx_esdhc_dt_ids);@@ -248,6 +255,11 @@ static inline int esdhc_is_usdhc(struct pltfm_imx_data *data)return !!(data->socdata->flags &ESDHC_FLAG_USDHC ); } +static inline int is_vf610_esdhc (struct pltfm_imx_data *data) +{ +return data->socdata == &esdhc_vf610_data; +} +static inline void esdhc_clrset_le (struct sdhci_host *host,u32 mask,u32 val,int reg) {void __iomem *base = host->ioaddr + (reg & ~0x3 );@@ -887,7 +899,8 @@ static void esdhc_set_uhs_signaling(struct sdhci_host *host, unsigned timing) v = boarddata->delay_line <<ESDHC_DLL_OVERRIDE_VAL_SHIFT | (1 <<ESDHC_DLL_OVERRIDE_EN_SHIFT ); -if (is_imx53_esdhc (imx_data)) +if (is_imx53_esdhc (imx_data) || +is_vf610_esdhc (imx_data)) v <<=1 ;writel (v, host->ioaddr +ESDHC_DLL_CTRL ); }@@ -1206,6 +1219,9 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)if (imx_data->socdata->flags &ESDHC_FLAG_HS400 ) host->quirks2 |=SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400 ; +if (imx_data->socdata->flags &ESDHC_FLAG_MULTIBLOCK_ACMD12 ) + host->quirks |=SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 ; +if (of_id) err =sdhci_esdhc_imx_probe_dt (pdev, host, imx_data);else Signature · 7 lines
1.9.3 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel at lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel