Skip to contentSkip to conversation

babbage: support mmc device

PATCH New Shawn Guo 6 participants 24 messages Oct 20, 2010 – Nov 7, 2010

Subsystems (6)
lore
Share & tools
lore

Shawn Guo

author
#0 lore raw

cover babbage: support mmc device

The patches are to support mmc device on imx51 babbage board, based on Wolfram Sang's esdhc driver and Eric B?nard's device registration bits.

The patches were tested on babbage with Sascha's tree

git://git.pengutronix.de/git/imx/linux-2.6.git imx-for-2.6.37

merging mmc-next branch of cjb's tree below.

git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc.git

Shawn Guo (2):
[PATCH 1/2] mmc: quirk fix for timeout problem
[PATCH 2/2] babbage: esdhc device registration

 arch/arm/mach-mx5/Kconfig              |    1 +
 arch/arm/mach-mx5/board-mx51_babbage.c |   19 +++++++++++++++++++
 drivers/mmc/host/sdhci-esdhc-imx.c     |    3 ++-
 3 files changed, 22 insertions(+), 1 deletions(-)
author
#1 lore raw

PATCH 1/2 mmc: quirk fix for timeout problem

This patch is to fix timeout problem which was seen on babbage. Thanks Richard Zhu <[email protected]> for catching this.

---
 drivers/mmc/host/sdhci-esdhc-imx.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/mmc/host/sdhci-esdhc-imx.c +2 -1
index 2e9cca1..e8f7048 100644
@@ -134,7 +134,8 @@ static struct sdhci_ops sdhci_esdhc_ops = {
 
 struct sdhci_pltfm_data sdhci_esdhc_imx_pdata = {
 	.quirks = ESDHC_DEFAULT_QUIRKS | SDHCI_QUIRK_NO_MULTIBLOCK
-			| SDHCI_QUIRK_BROKEN_ADMA,
+			| SDHCI_QUIRK_BROKEN_ADMA
+			| SDHCI_QUIRK_BROKEN_TIMEOUT_VAL,
 	/* ADMA has issues. Might be fixable */
 	/* NO_MULTIBLOCK might be MX35 only (Errata: ENGcm07207) */
 	.ops = &sdhci_esdhc_ops,
Signature · 1 line
1.7.1
#2 lore raw

PATCH 1/2 mmc: quirk fix for timeout problem

Quoted 4 lines · Shawn Guo

This patch is to fix timeout problem which was seen on babbage. Thanks Richard Zhu <[email protected]> for catching this.

NACK. It is still untested if we need that quirk on MX25/35. Eric wanted to send an updated patch next week.

(And this patch has to go via the mmc-tree IMO)

Signature · 9 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20101020/94769a16/attachment.sig>
author
#3 lore raw

PATCH 1/2 mmc: quirk fix for timeout problem

Hi Wolfram,

Quoted 9 lines · Wolfram Sang
Quoted 4 lines · Shawn Guo

This patch is to fix timeout problem which was seen on babbage. Thanks Richard Zhu <[email protected]> for catching this.

NACK. It is still untested if we need that quirk on MX25/35. Eric wanted to send an updated patch next week.

I just tested the code change on mx35_3ds and mx25_3ds, and no problem was seen. I will send the patch for mmc support on mx35_3ds and mx25_3ds soon.

Signature · 2 lines
Regards,
Shawn
#4 lore raw

PATCH 1/2 mmc: quirk fix for timeout problem

Quoted 9 lines · Shawn Guo

Hi Wolfram,

Quoted 6 lines · Wolfram Sang
Quoted 4 lines · Shawn Guo

This patch is to fix timeout problem which was seen on babbage. Thanks Richard Zhu <[email protected]> for catching this.

Quoted 7 lines
Quoted 3 lines

NACK. It is still untested if we need that quirk on MX25/35. Eric wanted to send an updated patch next week.

I just tested the code change on mx35_3ds and mx25_3ds, and no problem was seen. I will send the patch for mmc support on mx35_3ds and mx25_3ds soon.

The question is more if they work _without_ the additional quirk.

Signature · 9 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20101021/dd3ed0ab/attachment.sig>
#5 lore raw

PATCH 1/2 mmc: quirk fix for timeout problem

In reply to Shawn Guo
Quoted 9 lines · Shawn Guo

Hi Wolfram,

Quoted 6 lines · Wolfram Sang
Quoted 4 lines · Shawn Guo

This patch is to fix timeout problem which was seen on babbage. Thanks Richard Zhu <[email protected]> for catching this.

Quoted 7 lines
Quoted 3 lines

NACK. It is still untested if we need that quirk on MX25/35. Eric wanted to send an updated patch next week.

I just tested the code change on mx35_3ds and mx25_3ds, and no problem was seen. I will send the patch for mmc support on mx35_3ds and mx25_3ds soon.

The question is... is this quirk actually needed on those? Did you test _without_ it?

Nicolas

author
#6 lore raw

PATCH 1/2 mmc: quirk fix for timeout problem

It also works fine on mx35_3ds without that timeout quirk.

My mx25_3ds gets something wrong. Will try to fix it and test this tomorrow.

Quoted 25 lines · Nicolas Pitre
Quoted 9 lines · Shawn Guo

Hi Wolfram,

Quoted 6 lines · Wolfram Sang
Quoted 4 lines · Shawn Guo

This patch is to fix timeout problem which was seen on babbage. Thanks Richard Zhu <[email protected]> for catching this.

Quoted 7 lines
Quoted 3 lines

NACK. It is still untested if we need that quirk on MX25/35. Eric wanted to send an updated patch next week.

I just tested the code change on mx35_3ds and mx25_3ds, and no problem was seen. ?I will send the patch for mmc support on mx35_3ds and mx25_3ds soon.

The question is... is this quirk actually needed on those? ?Did you test _without_ it?

Nicolas

Signature · 2 lines
Regards,
Shawn
#7 lore raw

PATCH 1/2 mmc: quirk fix for timeout problem

Hi,

test protocol : booting a 2.6.36-rc8 kernel with a rootfs (ext3 formated, generated with OpenEmbedded for armv5, loading and launching qtdemo 4.6.3) on a 8GB ?SDHC (uSD reformated after each board tests to trigger lot of read/writes on the first init).

* on an i.MX357 (rev 2.1) without this patch leads to :
mmcblk0: error -110 transferring data, sector 7347024, nr 8, card status 0xe00
end_request: I/O error, dev mmcblk0, sector 7347025

Same card, same board, with the timeout quirk patch : boots fine without any error.

Reverted the patch: timeout errors came back.

==> quirk timeout patch needed for the i.MX35

* on an i.MX257 (tested twice) :
Same kernel tree, same rootfs, same motherboard, same uSD, only the CPU module change : no error without the patch (and no error with the patch also ;-).

==> quirk timeout patch not needed for the i.MX25

* on an i.MX515 :
Same kernel tree, same rootfs, same motherboard, same uSD (re-formated), only the CPU module change without this patch leads to :
mmcblk0: error -84 transferring data, sector 1315598, nr 2, card status 0x900
end_request: I/O error, dev mmcblk0, sector 1315598

Same card, same board, with the timeout quirk patch : boots fine without any error.

Reverted the patch: timeout errors came back.

==> quirk timeout patch needed for the i.MX51

Updated patch follows.

Eric

#8 lore raw

PATCH 1/2 sdhci-esdhc-imx: fix timeout on i.MX's sdhci

this patch fix timeout problems on i.MX's sdhci as suggested by Richard Zhu.

Tested on :
- i.MX257 : not needed
- i.MX357 : needed
- i.MX515 : needed

more details can be found here :
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-October/029748.html

---
 drivers/mmc/host/sdhci-esdhc-imx.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
drivers/mmc/host/sdhci-esdhc-imx.c +6 -0
index afbac9a..11e1ae1 100644
@@ -130,6 +130,12 @@ static int esdhc_pltfm_init(struct sdhci_host *host, struct sdhci_pltfm_data *pd
 		gpio_request(boarddata->wp_gpio, "SD_WP");
 		gpio_direction_input(boarddata->wp_gpio);
 	}
+
+	if (cpu_is_mx35() || cpu_is_mx51()) {
+		dev_info(mmc_dev(host->mmc), "using broken timeout quirk\n");
+		host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
+	}
+
 	return 0;
 }
 
Signature · 1 line
1.7.0.4
#9 lore raw

PATCH 1/2 sdhci-esdhc-imx: fix timeout on i.MX's sdhci

Quoted 22 lines · Eric B?nard

this patch fix timeout problems on i.MX's sdhci as suggested by Richard Zhu.

Tested on :
- i.MX257 : not needed
- i.MX357 : needed
- i.MX515 : needed

more details can be found here :
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-October/029748.html

---
 drivers/mmc/host/sdhci-esdhc-imx.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
drivers/mmc/host/sdhci-esdhc-imx.c +0 -0
index afbac9a..11e1ae1 100644

drivers/mmc/host/sdhci-esdhc-imx.c static int esdhc_pltfm_init(struct sdhci_host *host, struct sdhci_pltfm_data *pd · line 135

Quoted 6 lines
drivers/mmc/host/sdhci-esdhc-imx.c +3 -0
@@ -130,6 +130,12 @@ static int esdhc_pltfm_init(struct sdhci_host *host, struct sdhci_pltfm_data *pd
 		gpio_request(boarddata->wp_gpio, "SD_WP");
 		gpio_direction_input(boarddata->wp_gpio);
 	}
+
+	if (cpu_is_mx35() || cpu_is_mx51()) {
+		dev_info(mmc_dev(host->mmc), "using broken timeout quirk\n");

Please drop this line. The boot log is full enough IMO :)

Other than that:

Quoted 9 lines
drivers/mmc/host/sdhci-esdhc-imx.c +3 -0
+		host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
+	}
+
 	return 0;
 }
 
Signature · 1 line
1.7.0.4
Signature · 9 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20101022/ed08e96b/attachment.sig>
#10 lore raw

PATCH 1/2 sdhci-esdhc-imx: fix timeout on i.MX's sdhci

In reply to Eric Bénard
Quoted 24 lines · Eric B?nard

this patch fix timeout problems on i.MX's sdhci as suggested by Richard Zhu.

Tested on :
- i.MX257 : not needed
- i.MX357 : needed
- i.MX515 : needed

more details can be found here :
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-October/029748.html

---
 drivers/mmc/host/sdhci-esdhc-imx.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
drivers/mmc/host/sdhci-esdhc-imx.c +0 -0
index afbac9a..11e1ae1 100644
@@ -130,6 +130,12 @@ static int esdhc_pltfm_init(struct sdhci_host *host, struct sdhci_pltfm_data *pd
 		gpio_request(boarddata->wp_gpio, "SD_WP");
 		gpio_direction_input(boarddata->wp_gpio);

drivers/mmc/host/sdhci-esdhc-imx.c static int esdhc_pltfm_init(struct sdhci_host *host, struct sdhci_pltfm_data *pd · line 141

Quoted 10 lines
drivers/mmc/host/sdhci-esdhc-imx.c +6 -0
 	}
+
+	if (cpu_is_mx35() || cpu_is_mx51()) {
+		dev_info(mmc_dev(host->mmc), "using broken timeout quirk\n");
+		host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
+	}
+
 	return 0;
 }
 

This has Wolfram's RFC wp-on-gpio patch applied. Want to repost these against mmc-next?

I'll plan on leaving this until after -rc1, so that I can send out a pull request shortly. Thanks,

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child
#11 lore raw

PATCH 1/2 sdhci-esdhc-imx: fix timeout on i.MX's sdhci

this patch fix timeout problems on i.MX's sdhci as suggested by Richard Zhu.

Tested on :
- i.MX257 : not needed
- i.MX357 : needed
- i.MX515 : needed

more details can be found here :
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-October/029748.html

---
 drivers/mmc/host/sdhci-esdhc-imx.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/mmc/host/sdhci-esdhc-imx.c +4 -0
index 2e9cca1..28e63ef 100644
@@ -17,6 +17,7 @@
 #include <linux/clk.h>
 #include <linux/mmc/host.h>
 #include <linux/mmc/sdhci-pltfm.h>
+#include <mach/hardware.h>
 #include "sdhci.h"
 #include "sdhci-pltfm.h"
 #include "sdhci-esdhc.h"
@@ -112,6 +113,9 @@ static int esdhc_pltfm_init(struct sdhci_host *host, struct sdhci_pltfm_data *pd
 	clk_enable(clk);
 	pltfm_host->clk = clk;
 
+	if (cpu_is_mx35() || cpu_is_mx51())
+		host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
+
 	return 0;
 }
 
Signature · 1 line
1.7.0.4
#12 lore raw

PATCH 1/2 sdhci-esdhc-imx: fix timeout on i.MX's sdhci

Hi Eric,

Quoted 8 lines · Eric B?nard

this patch fix timeout problems on i.MX's sdhci as suggested by Richard Zhu.

Tested on :
- i.MX257 : not needed
- i.MX357 : needed
- i.MX515 : needed

Quoted 6 lines

more details can be found here :
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-October/029748.html

Thanks, I've pushed and queued these two patches for 2.6.37.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child
#13 lore raw

PATCH 2/2 sdhci-esdhc-imx: enable QUIRK_NO_MULTIBLOCK only for i.MX25 and i.MX35

In reply to Chris Ball

only these CPU's errata list this bug.

---
 drivers/mmc/host/sdhci-esdhc-imx.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
drivers/mmc/host/sdhci-esdhc-imx.c +5 -3
index 28e63ef..8308bcd 100644
@@ -116,6 +116,10 @@ static int esdhc_pltfm_init(struct sdhci_host *host, struct sdhci_pltfm_data *pd
 	if (cpu_is_mx35() || cpu_is_mx51())
 		host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
 
+	/* fix errata ENGcm07207 which is present on i.MX25 and i.MX35 */
+	if (cpu_is_mx25() || cpu_is_mx35())
+		host->quirks |= SDHCI_QUIRK_NO_MULTIBLOCK;
+
 	return 0;
 }
 
@@ -137,10 +141,8 @@ static struct sdhci_ops sdhci_esdhc_ops = {
 };
 
 struct sdhci_pltfm_data sdhci_esdhc_imx_pdata = {
-	.quirks = ESDHC_DEFAULT_QUIRKS | SDHCI_QUIRK_NO_MULTIBLOCK
-			| SDHCI_QUIRK_BROKEN_ADMA,
+	.quirks = ESDHC_DEFAULT_QUIRKS | SDHCI_QUIRK_BROKEN_ADMA,
 	/* ADMA has issues. Might be fixable */
-	/* NO_MULTIBLOCK might be MX35 only (Errata: ENGcm07207) */
 	.ops = &sdhci_esdhc_ops,
 	.init = esdhc_pltfm_init,
 	.exit = esdhc_pltfm_exit,
Signature · 1 line
1.7.0.4
#14 lore raw

PATCH 2/2 sdhci-esdhc-imx: enable QUIRK_NO_MULTIBLOCK only for i.MX25 and i.MX35

In reply to Eric Bénard

only these CPU's errata list this bug.

---
 drivers/mmc/host/sdhci-esdhc-imx.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
drivers/mmc/host/sdhci-esdhc-imx.c +7 -3
index 11e1ae1..4d67f58 100644
@@ -136,6 +136,12 @@ static int esdhc_pltfm_init(struct sdhci_host *host, struct sdhci_pltfm_data *pd
 		host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
 	}
 
+	/* fix errata ENGcm07207 which is present on i.MX25 and i.MX35 */
+	if (cpu_is_mx25() || cpu_is_mx35()) {
+		dev_info(mmc_dev(host->mmc), "using ENGcm07207 workaround\n");
+		host->quirks |= SDHCI_QUIRK_NO_MULTIBLOCK;
+	}
+
 	return 0;
 }
 
@@ -162,10 +168,8 @@ static struct sdhci_ops sdhci_esdhc_ops = {
 };
 
 struct sdhci_pltfm_data sdhci_esdhc_imx_pdata = {
-	.quirks = ESDHC_DEFAULT_QUIRKS | SDHCI_QUIRK_NO_MULTIBLOCK
-			| SDHCI_QUIRK_BROKEN_ADMA,
+	.quirks = ESDHC_DEFAULT_QUIRKS | SDHCI_QUIRK_BROKEN_ADMA,
 	/* ADMA has issues. Might be fixable */
-	/* NO_MULTIBLOCK might be MX35 only (Errata: ENGcm07207) */
 	.ops = &sdhci_esdhc_ops,
 	.init = esdhc_pltfm_init,
 	.exit = esdhc_pltfm_exit,
Signature · 1 line
1.7.0.4
#15 lore raw

PATCH 2/2 sdhci-esdhc-imx: enable QUIRK_NO_MULTIBLOCK only for i.MX25 and i.MX35

Quoted 1 line · Eric B?nard

only these CPU's errata list this bug.

So, it was not directly tested?

Quoted 11 lines
---
 drivers/mmc/host/sdhci-esdhc-imx.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
drivers/mmc/host/sdhci-esdhc-imx.c +0 -0
index 11e1ae1..4d67f58 100644

drivers/mmc/host/sdhci-esdhc-imx.c static int esdhc_pltfm_init(struct sdhci_host *host, struct sdhci_pltfm_data *pd · line 141

Quoted 6 lines
drivers/mmc/host/sdhci-esdhc-imx.c +3 -0
@@ -136,6 +136,12 @@ static int esdhc_pltfm_init(struct sdhci_host *host, struct sdhci_pltfm_data *pd
 		host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
 	}
 
+	/* fix errata ENGcm07207 which is present on i.MX25 and i.MX35 */
+	if (cpu_is_mx25() || cpu_is_mx35()) {
+		dev_info(mmc_dev(host->mmc), "using ENGcm07207 workaround\n");

Same here, no printout please (or do you see a reason for it?)

Quoted 8 lines
drivers/mmc/host/sdhci-esdhc-imx.c +3 -0
+		host->quirks |= SDHCI_QUIRK_NO_MULTIBLOCK;
+	}
+
 	return 0;
 }
 
@@ -162,10 +168,8 @@ static struct sdhci_ops sdhci_esdhc_ops = {
 };

drivers/mmc/host/sdhci-esdhc-imx.c static struct sdhci_ops sdhci_esdhc_ops = { · line 175

Quoted 10 lines
drivers/mmc/host/sdhci-esdhc-imx.c +1 -3
 
 struct sdhci_pltfm_data sdhci_esdhc_imx_pdata = {
-	.quirks = ESDHC_DEFAULT_QUIRKS | SDHCI_QUIRK_NO_MULTIBLOCK
-			| SDHCI_QUIRK_BROKEN_ADMA,
+	.quirks = ESDHC_DEFAULT_QUIRKS | SDHCI_QUIRK_BROKEN_ADMA,
 	/* ADMA has issues. Might be fixable */
-	/* NO_MULTIBLOCK might be MX35 only (Errata: ENGcm07207) */
 	.ops = &sdhci_esdhc_ops,
 	.init = esdhc_pltfm_init,
 	.exit = esdhc_pltfm_exit,

Other than that, looks good. Thanks.

Signature · 9 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20101022/28acc0da/attachment.sig>
#16 lore raw

PATCH 2/2 sdhci-esdhc-imx: enable QUIRK_NO_MULTIBLOCK only for i.MX25 and i.MX35

Hi Wolfram,

Le 22/10/2010 08:18, Wolfram Sang a ?crit :

Quoted 5 lines · Eric B?nard
Quoted 1 line

only these CPU's errata list this bug.

So, it was not directly tested?

While I was testing the other quirk, I tested this one on 25, 35 & 51, but I can't trigger the bug on any of these CPU (without the quirk : the bug suppose there is an error reading one block and that the MMC layer then sends CMD12 which can't stop the AHB transfer and thus the controler stays blocked. As I didn't met an error to read a block, I wasn't able to trigger the bug.

Eric

#17 lore raw

PATCH v2 1/2 sdhci-esdhc-imx: fix timeout on i.MX's sdhci

In reply to Wolfram Sang

this patch fix timeout problems on i.MX's sdhci as suggested by Richard Zhu.

Tested on :
- i.MX257 : not needed
- i.MX357 : needed
- i.MX515 : needed

more details can be found here :
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-October/029748.html

---
 drivers/mmc/host/sdhci-esdhc-imx.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/mmc/host/sdhci-esdhc-imx.c +4 -0
index afbac9a..31256ad 100644
@@ -130,6 +130,10 @@ static int esdhc_pltfm_init(struct sdhci_host *host, struct sdhci_pltfm_data *pd
 		gpio_request(boarddata->wp_gpio, "SD_WP");
 		gpio_direction_input(boarddata->wp_gpio);
 	}
+
+	if (cpu_is_mx35() || cpu_is_mx51())
+		host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
+
 	return 0;
 }
 
Signature · 1 line
1.7.0.4
#18 lore raw

PATCH v2 2/2 sdhci-esdhc-imx: enable QUIRK_NO_MULTIBLOCK only for i.MX25 and i.MX35

In reply to Wolfram Sang

only these CPU's errata list this bug.

---
 drivers/mmc/host/sdhci-esdhc-imx.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
drivers/mmc/host/sdhci-esdhc-imx.c +5 -3
index 31256ad..14d2836 100644
@@ -134,6 +134,10 @@ static int esdhc_pltfm_init(struct sdhci_host *host, struct sdhci_pltfm_data *pd
 	if (cpu_is_mx35() || cpu_is_mx51())
 		host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
 
+	/* fix errata ENGcm07207 which is present on i.MX25 and i.MX35 */
+	if (cpu_is_mx25() || cpu_is_mx35())
+		host->quirks |= SDHCI_QUIRK_NO_MULTIBLOCK;
+
 	return 0;
 }
 
@@ -160,10 +164,8 @@ static struct sdhci_ops sdhci_esdhc_ops = {
 };
 
 struct sdhci_pltfm_data sdhci_esdhc_imx_pdata = {
-	.quirks = ESDHC_DEFAULT_QUIRKS | SDHCI_QUIRK_NO_MULTIBLOCK
-			| SDHCI_QUIRK_BROKEN_ADMA,
+	.quirks = ESDHC_DEFAULT_QUIRKS | SDHCI_QUIRK_BROKEN_ADMA,
 	/* ADMA has issues. Might be fixable */
-	/* NO_MULTIBLOCK might be MX35 only (Errata: ENGcm07207) */
 	.ops = &sdhci_esdhc_ops,
 	.init = esdhc_pltfm_init,
 	.exit = esdhc_pltfm_exit,
Signature · 1 line
1.7.0.4
#19 lore raw

PATCH v2 2/2 sdhci-esdhc-imx: enable QUIRK_NO_MULTIBLOCK only for i.MX25 and i.MX35

Quoted 3 lines · Eric B?nard

only these CPU's errata list this bug.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20101022/bb1a5808/attachment.sig>

author
#20 lore raw

PATCH 1/2 mmc: quirk fix for timeout problem

In reply to Eric Bénard

Last night, I booted the system up with NFS, tested mmc mount/read/write, and did not see timeout error. With Eric's result, I just did the test differently. Writing an ext2 rootfs image on the card, booting the system from mmc directly, and timeout error is being seen on mx35_3ds. As expected, the timeout quirk can fix it.

Sorry for the confusion.

Quoted 44 lines · Eric B?nard

Hi,

test protocol : booting a 2.6.36-rc8 kernel with a rootfs (ext3 formated, generated with OpenEmbedded for armv5, loading and launching qtdemo 4.6.3) on a 8GB ?DHC ?(uSD reformated after each board tests to trigger lot of read/writes on the first init).

* on an i.MX357 (rev 2.1) without this patch leads to :
mmcblk0: error -110 transferring data, sector 7347024, nr 8, card status 0xe00
end_request: I/O error, dev mmcblk0, sector 7347025

Same card, same board, with the timeout quirk patch : boots fine without any error.

Reverted the patch: timeout errors came back.

==> quirk timeout patch needed for the i.MX35

* on an i.MX257 (tested twice) :
Same kernel tree, same rootfs, same motherboard, same uSD, only the CPU module change : no error without the patch (and no error with the patch also ;-).

==> quirk timeout patch not needed for the i.MX25

* on an i.MX515 :
Same kernel tree, same rootfs, same motherboard, same uSD (re-formated), only the CPU module change without this patch leads to :
mmcblk0: error -84 transferring data, sector 1315598, nr 2, card status 0x900
end_request: I/O error, dev mmcblk0, sector 1315598

Same card, same board, with the timeout quirk patch : boots fine without any error.

Reverted the patch: timeout errors came back.

==> quirk timeout patch needed for the i.MX51

Updated patch follows.

Eric

Signature · 2 lines
Regards,
Shawn
author
#21 lore raw

PATCH 2/2 babbage: esdhc device registration

In reply to Shawn Guo

This patch is based on Eric B?nard's bits below to add esdhc device registration for babbage board.

- cpuimx51: update board support
- clock-mx51: factorize clk_set_parent and clk_get_rate
- imx-esdhc: update devices registration

---
 arch/arm/mach-mx5/Kconfig              |    1 +
 arch/arm/mach-mx5/board-mx51_babbage.c |   19 +++++++++++++++++++
 2 files changed, 20 insertions(+), 0 deletions(-)
arch/arm/mach-mx5/Kconfig +1 -0
index a2df9ac..fe96cd2 100644
@@ -13,6 +13,7 @@ config MACH_MX51_BABBAGE
 	bool "Support MX51 BABBAGE platforms"
 	select IMX_HAVE_PLATFORM_IMX_I2C
 	select IMX_HAVE_PLATFORM_IMX_UART
+	select IMX_HAVE_PLATFORM_ESDHC
 	help
 	  Include support for MX51 Babbage platform, also known as MX51EVK in
 	  u-boot. This includes specific configurations for the board and its
arch/arm/mach-mx5/board-mx51_babbage.c +19 -0
index 23ee4a4..39304b4 100644
@@ -112,6 +112,22 @@ static struct pad_desc mx51babbage_pads[] = {
 
 	/* FEC PHY reset line */
 	MX51_PAD_EIM_A20__GPIO_2_14,
+
+	/* SD 1 */
+	MX51_PAD_SD1_CMD__SD1_CMD,
+	MX51_PAD_SD1_CLK__SD1_CLK,
+	MX51_PAD_SD1_DATA0__SD1_DATA0,
+	MX51_PAD_SD1_DATA1__SD1_DATA1,
+	MX51_PAD_SD1_DATA2__SD1_DATA2,
+	MX51_PAD_SD1_DATA3__SD1_DATA3,
+
+	/* SD 2 */
+	MX51_PAD_SD2_CMD__SD2_CMD,
+	MX51_PAD_SD2_CLK__SD2_CLK,
+	MX51_PAD_SD2_DATA0__SD2_DATA0,
+	MX51_PAD_SD2_DATA1__SD2_DATA1,
+	MX51_PAD_SD2_DATA2__SD2_DATA2,
+	MX51_PAD_SD2_DATA3__SD2_DATA3,
 };
 
 /* Serial ports */
@@ -304,6 +320,9 @@ static void __init mxc_board_init(void)
 	/* setback USBH1_STP to be function */
 	mxc_iomux_v3_setup_pad(&usbh1stp);
 	babbage_usbhub_reset();
+
+	imx51_add_esdhc(0, NULL);
+	imx51_add_esdhc(1, NULL);
 }
 
 static void __init mx51_babbage_timer_init(void)
Signature · 1 line
1.7.1
#22 lore raw

PATCH 2/2 babbage: esdhc device registration

Quoted 8 lines · Shawn Guo

This patch is based on Eric B?nard's bits below to add esdhc device registration for babbage board.

- cpuimx51: update board support
- clock-mx51: factorize clk_set_parent and clk_get_rate
- imx-esdhc: update devices registration

Signature · 9 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20101020/10db5b55/attachment.sig>
#23 lore raw

PATCH 2/2 babbage: esdhc device registration

In reply to Shawn Guo
Quoted 6 lines · Shawn Guo

This patch is based on Eric B?nard's bits below to add esdhc device registration for babbage board.

- cpuimx51: update board support
- clock-mx51: factorize clk_set_parent and clk_get_rate
- imx-esdhc: update devices registration

This is a description of Eric's patches, you don't require them in your patch description. Just noting in your 0/2 that this patchset depends on Eric's is ok.

Your desciption can be

"Update babbage board support to register esdhc device"

Quoted 1 line

Otherwise,

Quoted 57 lines
---
 arch/arm/mach-mx5/Kconfig              |    1 +
 arch/arm/mach-mx5/board-mx51_babbage.c |   19 +++++++++++++++++++
 2 files changed, 20 insertions(+), 0 deletions(-)
arch/arm/mach-mx5/Kconfig +1 -0
index a2df9ac..fe96cd2 100644
@@ -13,6 +13,7 @@ config MACH_MX51_BABBAGE
 	bool "Support MX51 BABBAGE platforms"
 	select IMX_HAVE_PLATFORM_IMX_I2C
 	select IMX_HAVE_PLATFORM_IMX_UART
+	select IMX_HAVE_PLATFORM_ESDHC
 	help
 	  Include support for MX51 Babbage platform, also known as MX51EVK in
 	  u-boot. This includes specific configurations for the board and its
arch/arm/mach-mx5/board-mx51_babbage.c +19 -0
index 23ee4a4..39304b4 100644
@@ -112,6 +112,22 @@ static struct pad_desc mx51babbage_pads[] = {
 
 	/* FEC PHY reset line */
 	MX51_PAD_EIM_A20__GPIO_2_14,
+
+	/* SD 1 */
+	MX51_PAD_SD1_CMD__SD1_CMD,
+	MX51_PAD_SD1_CLK__SD1_CLK,
+	MX51_PAD_SD1_DATA0__SD1_DATA0,
+	MX51_PAD_SD1_DATA1__SD1_DATA1,
+	MX51_PAD_SD1_DATA2__SD1_DATA2,
+	MX51_PAD_SD1_DATA3__SD1_DATA3,
+
+	/* SD 2 */
+	MX51_PAD_SD2_CMD__SD2_CMD,
+	MX51_PAD_SD2_CLK__SD2_CLK,
+	MX51_PAD_SD2_DATA0__SD2_DATA0,
+	MX51_PAD_SD2_DATA1__SD2_DATA1,
+	MX51_PAD_SD2_DATA2__SD2_DATA2,
+	MX51_PAD_SD2_DATA3__SD2_DATA3,
 };
 
 /* Serial ports */
@@ -304,6 +320,9 @@ static void __init mxc_board_init(void)
 	/* setback USBH1_STP to be function */
 	mxc_iomux_v3_setup_pad(&usbh1stp);
 	babbage_usbhub_reset();
+
+	imx51_add_esdhc(0, NULL);
+	imx51_add_esdhc(1, NULL);
 }
 
 static void __init mx51_babbage_timer_init(void)
Signature · 1 line
1.7.1