Skip to contentSkip to conversation

mmc: mx6qsabrelite: fsl_esdhc: Define maximum bus width supported by SabreLite board

PATCH New Abbas Raza 3 participants 5 messages Mar 21, 2013 – Apr 3, 2013 MMC, SD and SDIO

lore
Share & tools
lore

Abbas Raza

author
#0 lore raw

PATCH 1/1 mmc: mx6qsabrelite: fsl_esdhc: Define maximum bus width supported by SabreLite board

From: Abbas Raza <[email protected]>

Maximum bus width supported by SabreLite board is not 8bit like all other mx6q specific boards. In case where both host controller and card support 8bit transfers, they agree to communicate on 8bit interface while boards like the SabreLite support only 4bit interface. Due to this reason the mmc 8bit default mode fails on the SabreLite. To rectify this, define maximum bus width supported by this board (4bit). If max_bus_width is not defined, it is 0 by default and 8bit width support will be enabled in host capabilities otherwise host capabilities are modified accordingly.

It is tested with a MMCplus card.

---
 board/freescale/mx6qsabrelite/mx6qsabrelite.c | 3 +++
 drivers/mmc/fsl_esdhc.c                       | 7 +++++++
 include/fsl_esdhc.h                           | 1 +
 3 files changed, 11 insertions(+)
board/freescale/mx6qsabrelite/mx6qsabrelite.c +3 -0
index d563464..14c299b 100644
@@ -110,6 +110,9 @@ int board_mmc_init(bd_t *bis)
 	usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
 	usdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC4_CLK);
 
+	usdhc_cfg[0].max_bus_width = 4;
+	usdhc_cfg[1].max_bus_width = 4;
+
 	for (index = 0; index < CONFIG_SYS_FSL_USDHC_NUM; ++index)
 		status |= fsl_esdhc_initialize(bis, &usdhc_cfg[index]);
 
drivers/mmc/fsl_esdhc.c +7 -0
index 3d5c9c0..d2a505e 100644
@@ -579,6 +579,13 @@ int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg)
 
 	mmc->host_caps = MMC_MODE_4BIT | MMC_MODE_8BIT | MMC_MODE_HC;
 
+	if (cfg->max_bus_width > 0) {
+		if (cfg->max_bus_width < 8)
+			mmc->host_caps &= ~MMC_MODE_8BIT;
+		if (cfg->max_bus_width < 4)
+			mmc->host_caps &= ~MMC_MODE_4BIT;
+	}
+
 	if (caps & ESDHC_HOSTCAPBLT_HSS)
 		mmc->host_caps |= MMC_MODE_HS_52MHz | MMC_MODE_HS;
 
include/fsl_esdhc.h +1 -0
index 47d2fe4..0a1a071 100644
@@ -168,6 +168,7 @@
 struct fsl_esdhc_cfg {
 	u32	esdhc_base;
 	u32	sdhc_clk;
+	u8	max_bus_width;
 };
 
 /* Select the correct accessors depending on endianess */
Signature · 1 line
1.8.2
#1 lore raw

PATCH 1/1 mmc: mx6qsabrelite: fsl_esdhc: Define maximum bus width supported by SabreLite board

Quoted 12 lines · Abbas Raza

From: Abbas Raza <[email protected]>

Maximum bus width supported by SabreLite board is not 8bit like all other mx6q specific boards. In case where both host controller and card support 8bit transfers, they agree to communicate on 8bit interface while boards like the SabreLite support only 4bit interface. Due to this reason the mmc 8bit default mode fails on the SabreLite. To rectify this, define maximum bus width supported by this board (4bit). If max_bus_width is not defined, it is 0 by default and 8bit width support will be enabled in host capabilities otherwise host capabilities are modified accordingly.

Quoted 8 lines

It is tested with a MMCplus card.

---

Applied to u-boot-imx, thanks.

FYI: of course, I will merge the same fix for max_bus_width for Nitrogen6x and Wandboard if posted.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#2 lore raw

PATCH 1/1 mmc: mx6qsabrelite: fsl_esdhc: Define maximum bus width supported by SabreLite board

Quoted 22 lines · Stefano Babic
Quoted 12 lines · Abbas Raza

From: Abbas Raza <[email protected]>

Maximum bus width supported by SabreLite board is not 8bit like all other mx6q specific boards. In case where both host controller and card support 8bit transfers, they agree to communicate on 8bit interface while boards like the SabreLite support only 4bit interface. Due to this reason the mmc 8bit default mode fails on the SabreLite. To rectify this, define maximum bus width supported by this board (4bit). If max_bus_width is not defined, it is 0 by default and 8bit width support will be enabled in host capabilities otherwise host capabilities are modified accordingly.

Quoted 8 lines

It is tested with a MMCplus card.

---

Quoted 4 lines

Applied to u-boot-imx, thanks.

FYI: of course, I will merge the same fix for max_bus_width for Nitrogen6x and Wandboard if posted.

Have you noticed v2 of this patch

http://lists.denx.de/pipermail/u-boot/2013-March/150119.html

?

Best regards

Dirk

#3 lore raw

PATCH 1/1 mmc: mx6qsabrelite: fsl_esdhc: Define maximum bus width supported by SabreLite board

Quoted 26 lines · Dirk Behme
Quoted 25 lines · Stefano Babic
Quoted 23 lines · Abbas Raza

From: Abbas Raza <[email protected]>

Maximum bus width supported by SabreLite board is not 8bit like all other mx6q specific boards. In case where both host controller and card support 8bit transfers, they agree to communicate on 8bit interface while boards like the SabreLite support only 4bit interface. Due to this reason the mmc 8bit default mode fails on the SabreLite. To rectify this, define maximum bus width supported by this board (4bit).
If max_bus_width is not defined, it is 0 by default and 8bit width support
will be enabled in host capabilities otherwise host capabilities are modified
accordingly.

It is tested with a MMCplus card.

---

Quoted 8 lines
Quoted 4 lines

Applied to u-boot-imx, thanks.

FYI: of course, I will merge the same fix for max_bus_width for Nitrogen6x and Wandboard if posted.

Have you noticed v2 of this patch

http://lists.denx.de/pipermail/u-boot/2013-March/150119.html

Right, I noted after sending the e-mail ;-)

Regards,
Stefano

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#4 lore raw

PATCH 1/1 mmc: mx6qsabrelite: fsl_esdhc: Define maximum bus width supported by SabreLite board

In reply to Stefano Babic
Quoted 22 lines · Stefano Babic
Quoted 12 lines · Abbas Raza

From: Abbas Raza <[email protected]>

Maximum bus width supported by SabreLite board is not 8bit like all other mx6q specific boards. In case where both host controller and card support 8bit transfers, they agree to communicate on 8bit interface while boards like the SabreLite support only 4bit interface. Due to this reason the mmc 8bit default mode fails on the SabreLite. To rectify this, define maximum bus width supported by this board (4bit). If max_bus_width is not defined, it is 0 by default and 8bit width support will be enabled in host capabilities otherwise host capabilities are modified accordingly.

Quoted 8 lines

It is tested with a MMCplus card.

---

Quoted 5 lines

Applied to u-boot-imx, thanks.

FYI: of course, I will merge the same fix for max_bus_width for Nitrogen6x and Wandboard if posted.

Sorry for noise - I have missed V2. I will apply V2, not V1, fixing all boards.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================