Skip to contentSkip to conversation

mmc: omap_hsmmc: fix for pre es3.0 OMAP3

PATCH In review Nishanth Menon 3 participants 7 messages Feb 14, 2014 – Feb 28, 2014

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

v2 cover mmc: omap_hsmmc: fix for pre es3.0 OMAP3

Originally reported in: https://patchwork.kernel.org/patch/3514851/
https://patchwork.kernel.org/patch/3514881/

ES3.0+ provides MMC controller which is fixed for multi-block reads, however LDP platform

Looking at the various IP revision register information:
sdp2430: Revision: 1.2, Spec: 0.0, normal interrupt
OMAP3430-ldp: (ES2.1): Revision: 2.6, Spec: 0.0, normal interrupt SDP3430:(ES3.0) Revision: 2.6, Spec: 0.0, normal interrupt
AM3517-evm: (ES1.1): Revision: 2.6, Spec: 0.0, normal interrupt AM3517-crane:(ES1.1): Revision: 2.6, Spec: 0.0, normal interrupt
AM37x-evm: (ES1.2) Revision: 2.6, Spec: 0.0, normal interrupt OMAP3630-beag-xm (ES1.2): Revision: 2.6, Spec: 0.0, normal interrupt am335x-evm:(ES1.0): Revision: 3.1, Spec: 0.1, normal interrupt
am335x-sk: (ES2.1): Revision: 3.1, Spec: 0.1, normal interrupt am335x-beaglebone-black:(ES2.0): Revision: 3.1, Spec: 0.1, normal interrupt
sdp4430: (ES2.2): Revision: 3.1, Spec: 0.1, normal interrupt OMAP4460-panda-es (ES1.1): Revision: 3.1, Spec: 0.1, normal interrupt OMAP5uevm:(ES2.0): Revision: 3.3, Spec: 0.2, normal interrupt dra7-evm (es1.1): Revision: 3.3, Spec: 0.2, normal interrupt

This series has been tested on the following platforms:
1: BeagleBoard-XM: Boot PASS: http://slexy.org/raw/s2ObUDfm5N
2: BeagleBone-Black: Boot PASS: http://slexy.org/raw/s2xmviGgFf
3: dra7: Boot PASS: http://slexy.org/raw/s2Ad6rxaQk
4: ldp: Boot PASS: http://slexy.org/raw/s20kEx9eHg
5: PandaBoard-ES: Boot PASS: http://slexy.org/raw/s2gHT1EWKF

 6:    sdp2430:  Boot PASS: http://slexy.org/raw/s20dvr8yQA (nfs)
 7:    sdp3430:  Boot PASS: http://slexy.org/raw/s2aUEsEemS
 8:    sdp4430:  Boot PASS: http://slexy.org/raw/s20nqL8gjz

9: OMAP5432uEVM: Boot PASS: http://slexy.org/raw/s20O0QfmZw
TOTAL = 9 boards, Booted Boards = 9, No Boot boards = 0

LDP platform prior to the series reports: http://slexy.org/raw/s20qVg17T0

Series is based on v3.14-rc2

Nishanth Menon (2):
mmc: omap_hsmmc: Add support for quirky omap3 hsmmc controller
ARM: dts: omap3-ldp: fix mmc configuration

 .../devicetree/bindings/mmc/ti-omap-hsmmc.txt      |    1 +
 arch/arm/boot/dts/omap3-ldp.dts                    |   23 +++++++++++++++++
 drivers/mmc/host/omap_hsmmc.c                      |   26 +++++++++++++++++---
 3 files changed, 46 insertions(+), 4 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v2 1/2 mmc: omap_hsmmc: Add support for quirky omap3 hsmmc controller

When device is booted using devicetree, platforms impacted by Erratum 2.1.1.128 is not detected easily in the mmc driver. This erratum indicates that the module cannot do multi-block transfers. Platforms such as LDP which use OMAP3 ES revision prior to ES3.0 are impacted by this.

Provide a new compatible property "ti,omap3-pre-es3-hsmmc" to allow driver to determine if driver needs to implement quirks associated with the specific module version (primarily because the IP revision information is not sufficient for the same).

---
Changes since v1:
- new compatible flag as suggested by Tony which contains the relevant controller flag to work around the erratum

V1: https://patchwork.kernel.org/patch/3514851/

 .../devicetree/bindings/mmc/ti-omap-hsmmc.txt      |    1 +
 drivers/mmc/host/omap_hsmmc.c                      |   26 +++++++++++++++++---
 2 files changed, 23 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt +1 -0
index 8c8908a..ce80561 100644
@@ -10,6 +10,7 @@ Required properties:
 - compatible:
  Should be "ti,omap2-hsmmc", for OMAP2 controllers
  Should be "ti,omap3-hsmmc", for OMAP3 controllers
+ Should be "ti,omap3-pre-es3-hsmmc" for OMAP3 controllers pre ES3.0
  Should be "ti,omap4-hsmmc", for OMAP4 controllers
 - ti,hwmods: Must be "mmc<n>", n is controller instance starting 1
 
drivers/mmc/host/omap_hsmmc.c +22 -4
index 575f9cc..390f421 100644
@@ -192,6 +192,11 @@ struct omap_hsmmc_host {
 	struct	omap_mmc_platform_data	*pdata;
 };
 
+struct omap_mmc_of_data {
+	u32 reg_offset;
+	u8 controller_flags;
+};
+
 static int omap_hsmmc_card_detect(struct device *dev, int slot)
 {
 	struct omap_hsmmc_host *host = dev_get_drvdata(dev);
@@ -1678,18 +1683,29 @@ static void omap_hsmmc_debugfs(struct mmc_host *mmc)
 #endif
 
 #ifdef CONFIG_OF
-static u16 omap4_reg_offset = 0x100;
+static const struct omap_mmc_of_data omap3_pre_es3_mmc_of_data = {
+	/* See 35xx errata 2.1.1.128 in SPRZ278F */
+	.controller_flags = OMAP_HSMMC_BROKEN_MULTIBLOCK_READ,
+};
+
+static const struct omap_mmc_of_data omap4_mmc_of_data = {
+	.reg_offset = 0x100,
+};
 
 static const struct of_device_id omap_mmc_of_match[] = {
 	{
 		.compatible = "ti,omap2-hsmmc",
 	},
 	{
+		.compatible = "ti,omap3-pre-es3-hsmmc",
+		.data = &omap3_pre_es3_mmc_of_data,
+	},
+	{
 		.compatible = "ti,omap3-hsmmc",
 	},
 	{
 		.compatible = "ti,omap4-hsmmc",
-		.data = &omap4_reg_offset,
+		.data = &omap4_mmc_of_data,
 	},
 	{},
 };
@@ -1759,6 +1775,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
 	dma_cap_mask_t mask;
 	unsigned tx_req, rx_req;
 	struct pinctrl *pinctrl;
+	const struct omap_mmc_of_data *data;
 
 	match = of_match_device(of_match_ptr(omap_mmc_of_match), &pdev->dev);
 	if (match) {
@@ -1768,8 +1785,9 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
 			return PTR_ERR(pdata);
 
 		if (match->data) {
-			const u16 *offsetp = match->data;
-			pdata->reg_offset = *offsetp;
+			data = match->data;
+			pdata->reg_offset = data->reg_offset;
+			pdata->controller_flags |= data->controller_flags;
 		}
 	}
 
Signature · 1 line
1.7.9.5
#2 lore raw

Re: [PATCH V2 1/2] mmc: omap_hsmmc: Add support for quirky omap3 hsmmc controller

Quoted 6 lines · Nishanth Menon

When device is booted using devicetree, platforms impacted by Erratum 2.1.1.128 is not detected easily in the mmc driver. This erratum indicates that the module cannot do multi-block transfers. Platforms such as LDP which use OMAP3 ES revision prior to ES3.0 are impacted by this.

Quoted 6 lines

Provide a new compatible property "ti,omap3-pre-es3-hsmmc" to allow driver to determine if driver needs to implement quirks associated with the specific module version (primarily because the IP revision information is not sufficient for the same).

Looks good to me, would be good to get this into the -rc cycle as LDP is one of the automated boot testing boards for us.

If you guys want me to pick up both of the patches let me know, otherwise feel free to add my ack.

Regards,

Tony

#3 lore raw

Re: [PATCH V2 1/2] mmc: omap_hsmmc: Add support for quirky omap3 hsmmc controller

Quoted 12 lines · Tony Lindgren
Quoted 11 lines · Nishanth Menon

When device is booted using devicetree, platforms impacted by Erratum 2.1.1.128 is not detected easily in the mmc driver. This erratum indicates that the module cannot do multi-block transfers. Platforms such as LDP which use OMAP3 ES revision prior to ES3.0 are impacted by this.

Provide a new compatible property "ti,omap3-pre-es3-hsmmc" to allow driver to determine if driver needs to implement quirks associated with the specific module version (primarily because the IP revision information is not sufficient for the same).

Quoted 8 lines
Quoted 1 line

Looks good to me, would be good to get this into the -rc cycle as LDP is one of the automated boot testing boards for us.

If you guys want me to pick up both of the patches let me know, otherwise feel free to add my ack.

Chris,
would you be picking up the series that fixes LDP dt boot behavior or should Tony pick it up?

https://patchwork.kernel.org/patch/3650061/
https://patchwork.kernel.org/patch/3650031/

Signature · 2 lines
Regards,
Nishanth Menon
Acked-by on v2 1/2
#4 lore raw

Re: [PATCH V2 1/2] mmc: omap_hsmmc: Add support for quirky omap3 hsmmc controller

In reply to Nishanth Menon
Quoted 6 lines · Nishanth Menon

When device is booted using devicetree, platforms impacted by Erratum 2.1.1.128 is not detected easily in the mmc driver. This erratum indicates that the module cannot do multi-block transfers. Platforms such as LDP which use OMAP3 ES revision prior to ES3.0 are impacted by this.

Quoted 6 lines

Provide a new compatible property "ti,omap3-pre-es3-hsmmc" to allow driver to determine if driver needs to implement quirks associated with the specific module version (primarily because the IP revision information is not sufficient for the same).

looks good to me

Quoted 92 lines

---
Changes since v1:
- new compatible flag as suggested by Tony which contains the relevant controller flag to work around the erratum

V1: https://patchwork.kernel.org/patch/3514851/

  .../devicetree/bindings/mmc/ti-omap-hsmmc.txt      |    1 +
  drivers/mmc/host/omap_hsmmc.c                      |   26 +++++++++++++++++---
  2 files changed, 23 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt +1 -0
index 8c8908a..ce80561 100644
@@ -10,6 +10,7 @@ Required properties:
  - compatible:
   Should be "ti,omap2-hsmmc", for OMAP2 controllers
   Should be "ti,omap3-hsmmc", for OMAP3 controllers
+ Should be "ti,omap3-pre-es3-hsmmc" for OMAP3 controllers pre ES3.0
   Should be "ti,omap4-hsmmc", for OMAP4 controllers
  - ti,hwmods: Must be "mmc<n>", n is controller instance starting 1
 
drivers/mmc/host/omap_hsmmc.c +22 -4
index 575f9cc..390f421 100644
@@ -192,6 +192,11 @@ struct omap_hsmmc_host {
  	struct	omap_mmc_platform_data	*pdata;
  };
 
+struct omap_mmc_of_data {
+	u32 reg_offset;
+	u8 controller_flags;
+};
+
  static int omap_hsmmc_card_detect(struct device *dev, int slot)
  {
  	struct omap_hsmmc_host *host = dev_get_drvdata(dev);
@@ -1678,18 +1683,29 @@ static void omap_hsmmc_debugfs(struct mmc_host *mmc)
  #endif
 
  #ifdef CONFIG_OF
-static u16 omap4_reg_offset = 0x100;
+static const struct omap_mmc_of_data omap3_pre_es3_mmc_of_data = {
+	/* See 35xx errata 2.1.1.128 in SPRZ278F */
+	.controller_flags = OMAP_HSMMC_BROKEN_MULTIBLOCK_READ,
+};
+
+static const struct omap_mmc_of_data omap4_mmc_of_data = {
+	.reg_offset = 0x100,
+};
 
  static const struct of_device_id omap_mmc_of_match[] = {
  	{
  		.compatible = "ti,omap2-hsmmc",
  	},
  	{
+		.compatible = "ti,omap3-pre-es3-hsmmc",
+		.data = &omap3_pre_es3_mmc_of_data,
+	},
+	{
  		.compatible = "ti,omap3-hsmmc",
  	},
  	{
  		.compatible = "ti,omap4-hsmmc",
-		.data = &omap4_reg_offset,
+		.data = &omap4_mmc_of_data,
  	},
  	{},
  };
@@ -1759,6 +1775,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
  	dma_cap_mask_t mask;
  	unsigned tx_req, rx_req;
  	struct pinctrl *pinctrl;
+	const struct omap_mmc_of_data *data;
 
  	match = of_match_device(of_match_ptr(omap_mmc_of_match), &pdev->dev);
  	if (match) {
@@ -1768,8 +1785,9 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
  			return PTR_ERR(pdata);
 
  		if (match->data) {
-			const u16 *offsetp = match->data;
-			pdata->reg_offset = *offsetp;
+			data = match->data;
+			pdata->reg_offset = data->reg_offset;
+			pdata->controller_flags |= data->controller_flags;
  		}
  	}
 
#5 lore raw

PATCH v2 2/2 ARM: dts: omap3-ldp: fix mmc configuration

In reply to Nishanth Menon

MMC1 is the only MMC interface available on the platform. Further, since the platform is based on older revision of SoC which is not capable of doing multi-block reads, mark it with compatibility for the same and add pinmux to ensure that all relevant pins are configured for non-MMC boot mode.

---

Changes since V1:
- fixed commit message as suggested by Balaji.
- update to use new compatible match for the erratum.

V1: https://patchwork.kernel.org/patch/3514881/

 arch/arm/boot/dts/omap3-ldp.dts |   23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
arch/arm/boot/dts/omap3-ldp.dts +23 -0
index ddce0d8..0abe986 100644
@@ -174,8 +174,20 @@
 };
 
 &mmc1 {
+	/* See 35xx errata 2.1.1.128 in SPRZ278F */
+	compatible = "ti,omap3-pre-es3-hsmmc";
 	vmmc-supply = <&vmmc1>;
 	bus-width = <4>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc1_pins>;
+};
+
+&mmc2 {
+	status="disabled";
+};
+
+&mmc3 {
+	status="disabled";
 };
 
 &omap3_pmx_core {
@@ -209,6 +221,17 @@
 			0x174 (PIN_OUTPUT | MUX_MODE0)	/* hsusb0_stp.hsusb0_stp */
 		>;
 	};
+
+	mmc1_pins: pinmux_mmc1_pins {
+		pinctrl-single,pins = <
+			OMAP3_CORE1_IOPAD(0x2144, PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc1_clk.mmc1_clk */
+			OMAP3_CORE1_IOPAD(0x2146, PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc1_cmd.mmc1_cmd */
+			OMAP3_CORE1_IOPAD(0x2148, PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc1_dat0.mmc1_dat0 */
+			OMAP3_CORE1_IOPAD(0x214A, PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc1_dat1.mmc1_dat1 */
+			OMAP3_CORE1_IOPAD(0x214C, PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc1_dat2.mmc1_dat2 */
+			OMAP3_CORE1_IOPAD(0x214e, PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc1_dat3.mmc1_dat3 */
+		>;
+	};
 };
 
 &usb_otg_hs {
Signature · 1 line
1.7.9.5
Acked-by on v2 2/2
#6 lore raw

Re: [PATCH V2 2/2] ARM: dts: omap3-ldp: fix mmc configuration

Quoted 7 lines · Nishanth Menon

MMC1 is the only MMC interface available on the platform. Further, since the platform is based on older revision of SoC which is not capable of doing multi-block reads, mark it with compatibility for the same and add pinmux to ensure that all relevant pins are configured for non-MMC boot mode.

looks good to me