All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] mmc: mx6qsabrelite: fsl_esdhc: Define maximum bus width supported by SabreLite board
@ 2013-03-21  6:38 Abbas Raza
  2013-03-21 16:17 ` Eric Nelson
  0 siblings, 1 reply; 11+ messages in thread
From: Abbas Raza @ 2013-03-21  6:38 UTC (permalink / raw)
  To: u-boot

From: Abbas Raza <Abbas_Raza@mentor.com>

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.

Signed-off-by: Abbas Raza <Abbas_Raza@mentor.com>
cc: stefano Babic <sbabic@denx.de>
cc: Andy Fleming <afleming@gmail.com>
Acked-by: Dirk Behme <dirk.behme@de.bosch.com>
Acked-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
---
 board/freescale/mx6qsabrelite/mx6qsabrelite.c | 3 +++
 drivers/mmc/fsl_esdhc.c                       | 7 +++++++
 include/fsl_esdhc.h                           | 1 +
 3 files changed, 11 insertions(+)

diff --git a/board/freescale/mx6qsabrelite/mx6qsabrelite.c b/board/freescale/mx6qsabrelite/mx6qsabrelite.c
index d563464..14c299b 100644
--- a/board/freescale/mx6qsabrelite/mx6qsabrelite.c
+++ b/board/freescale/mx6qsabrelite/mx6qsabrelite.c
@@ -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]);
 
diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index 3d5c9c0..d2a505e 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -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;
 
diff --git a/include/fsl_esdhc.h b/include/fsl_esdhc.h
index 47d2fe4..0a1a071 100644
--- a/include/fsl_esdhc.h
+++ b/include/fsl_esdhc.h
@@ -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 */
-- 
1.8.2

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH] mmc: mx6qsabrelite: fsl_esdhc: Define maximum bus width supported by SabreLite board
  2013-03-21  6:38 [U-Boot] [PATCH] mmc: mx6qsabrelite: fsl_esdhc: Define maximum bus width supported by SabreLite board Abbas Raza
@ 2013-03-21 16:17 ` Eric Nelson
  2013-03-25 11:02   ` Abbas Raza
  0 siblings, 1 reply; 11+ messages in thread
From: Eric Nelson @ 2013-03-21 16:17 UTC (permalink / raw)
  To: u-boot

Thanks Abbas,

On 03/20/2013 11:38 PM, Abbas Raza wrote:
> From: Abbas Raza <Abbas_Raza@mentor.com>
>
> 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.
>
> Signed-off-by: Abbas Raza <Abbas_Raza@mentor.com>
> cc: stefano Babic <sbabic@denx.de>
> cc: Andy Fleming <afleming@gmail.com>
> Acked-by: Dirk Behme <dirk.behme@de.bosch.com>
> Acked-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
> ---
>   board/freescale/mx6qsabrelite/mx6qsabrelite.c | 3 +++
>   drivers/mmc/fsl_esdhc.c                       | 7 +++++++
>   include/fsl_esdhc.h                           | 1 +
>   3 files changed, 11 insertions(+)
>

Tested-by: Eric Nelson <eric.nelson@boundarydevices.com>

Note that the board settings also apply to nitrogen6x and wandboard
if you want to expand the patch a bit:

	http://git.denx.de/u-boot.git/?p=u-boot/u-boot-imx.git;a=blob;f=board/boundary/nitrogen6x/nitrogen6x.c;h=229c2378396d43a365d6682af35c0e519ccd69d4;hb=HEAD#l304
	http://git.denx.de/u-boot.git/?p=u-boot/u-boot-imx.git;a=blob;f=board/wandboard/wandboard.c;h=d95189f77de4c3573ec30c53e04fe1b083c1d2b5;hb=HEAD#l107

I also tested against a custom board with 8-bit eMMC.

Regards,


Eric

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH] mmc: mx6qsabrelite: fsl_esdhc: Define maximum bus width supported by SabreLite board
  2013-03-21 16:17 ` Eric Nelson
@ 2013-03-25 11:02   ` Abbas Raza
  2013-03-25 13:52     ` Eric Nelson
  2013-06-06 20:25     ` Eric Nelson
  0 siblings, 2 replies; 11+ messages in thread
From: Abbas Raza @ 2013-03-25 11:02 UTC (permalink / raw)
  To: u-boot

Hi, 

On 03/21/2013 09:17 PM, Eric Nelson wrote:
> Thanks Abbas,
> 
> Tested-by: Eric Nelson <eric.nelson@boundarydevices.com>
> 
> Note that the board settings also apply to nitrogen6x and wandboard
> if you want to expand the patch a bit:
> 
>     http://git.denx.de/u-boot.git/?p=u-boot/u-boot-imx.git;a=blob;f=board/boundary/nitrogen6x/nitrogen6x.c;h=229c2378396d43a365d6682af35c0e519ccd69d4;hb=HEAD#l304
>     http://git.denx.de/u-boot.git/?p=u-boot/u-boot-imx.git;a=blob;f=board/wandboard/wandboard.c;h=d95189f77de4c3573ec30c53e04fe1b083c1d2b5;hb=HEAD#l107

I would like to expand the patch but i cannot test it for boards you mentioned above. Are you sure these boards have 4-bit mmc buses?

> 
> I also tested against a custom board with 8-bit eMMC.
> 
> Regards,
> 
> 
> Eric

Thanks.
Abbas

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH] mmc: mx6qsabrelite: fsl_esdhc: Define maximum bus width supported by SabreLite board
  2013-03-25 11:02   ` Abbas Raza
@ 2013-03-25 13:52     ` Eric Nelson
  2013-06-06 20:25     ` Eric Nelson
  1 sibling, 0 replies; 11+ messages in thread
From: Eric Nelson @ 2013-03-25 13:52 UTC (permalink / raw)
  To: u-boot

Hi Abbas,

On 03/25/2013 04:02 AM, Abbas Raza wrote:
> Hi,
>
> On 03/21/2013 09:17 PM, Eric Nelson wrote:
>> Thanks Abbas,
>>
>> Tested-by: Eric Nelson <eric.nelson@boundarydevices.com>
>>
>> Note that the board settings also apply to nitrogen6x and wandboard
>> if you want to expand the patch a bit:
>>
>>      http://git.denx.de/u-boot.git/?p=u-boot/u-boot-imx.git;a=blob;f=board/boundary/nitrogen6x/nitrogen6x.c;h=229c2378396d43a365d6682af35c0e519ccd69d4;hb=HEAD#l304
>>      http://git.denx.de/u-boot.git/?p=u-boot/u-boot-imx.git;a=blob;f=board/wandboard/wandboard.c;h=d95189f77de4c3573ec30c53e04fe1b083c1d2b5;hb=HEAD#l107
>
> I would like to expand the patch but i cannot test it for boards you mentioned above. Are you sure these boards have 4-bit mmc buses?
>

Yes. The pin-mux settings confirm this.
Nitrogen6x:
	http://git.denx.de/?p=u-boot/u-boot-imx.git;a=blob;f=board/boundary/nitrogen6x/nitrogen6x.c;h=229c2378396d43a365d6682af35c0e519ccd69d4;hb=HEAD#l148

Wandboard:
	http://git.denx.de/?p=u-boot/u-boot-imx.git;a=blob;f=board/wandboard/wandboard.c;h=d95189f77de4c3573ec30c53e04fe1b083c1d2b5;hb=HEAD#l55

Regards,


Eric

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH] mmc: mx6qsabrelite: fsl_esdhc: Define maximum bus width supported by SabreLite board
  2013-03-25 11:02   ` Abbas Raza
  2013-03-25 13:52     ` Eric Nelson
@ 2013-06-06 20:25     ` Eric Nelson
  2013-06-06 21:47       ` Otavio Salvador
  1 sibling, 1 reply; 11+ messages in thread
From: Eric Nelson @ 2013-06-06 20:25 UTC (permalink / raw)
  To: u-boot

Hi Abbas,

On 03/25/2013 04:02 AM, Abbas Raza wrote:
> Hi,
>
> On 03/21/2013 09:17 PM, Eric Nelson wrote:
>> Thanks Abbas,
>>
>> Tested-by: Eric Nelson <eric.nelson@boundarydevices.com>
>>
>> Note that the board settings also apply to nitrogen6x and wandboard
>> if you want to expand the patch a bit:
>>
>>      http://git.denx.de/u-boot.git/?p=u-boot/u-boot-imx.git;a=blob;f=board/boundary/nitrogen6x/nitrogen6x.c;h=229c2378396d43a365d6682af35c0e519ccd69d4;hb=HEAD#l304
>>      http://git.denx.de/u-boot.git/?p=u-boot/u-boot-imx.git;a=blob;f=board/wandboard/wandboard.c;h=d95189f77de4c3573ec30c53e04fe1b083c1d2b5;hb=HEAD#l107
>
> I would like to expand the patch but i cannot test it for boards you mentioned above. Are you sure these boards have 4-bit mmc buses?
>

I'm certain about the Nitrogen6x. Less so about Wandboard.

I think I looked it up, but can't recall precisely.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH] mmc: mx6qsabrelite: fsl_esdhc: Define maximum bus width supported by SabreLite board
  2013-06-06 20:25     ` Eric Nelson
@ 2013-06-06 21:47       ` Otavio Salvador
  0 siblings, 0 replies; 11+ messages in thread
From: Otavio Salvador @ 2013-06-06 21:47 UTC (permalink / raw)
  To: u-boot

On Thu, Jun 6, 2013 at 5:25 PM, Eric Nelson <eric.nelson@boundarydevices.com
> wrote:

> Hi Abbas,
>
> On 03/25/2013 04:02 AM, Abbas Raza wrote:
>
>> Hi,
>>
>> On 03/21/2013 09:17 PM, Eric Nelson wrote:
>>
>>> Thanks Abbas,
>>>
>>> Tested-by: Eric Nelson <eric.nelson at boundarydevices.**com<eric.nelson@boundarydevices.com>
>>> >
>>>
>>> Note that the board settings also apply to nitrogen6x and wandboard
>>> if you want to expand the patch a bit:
>>>
>>>      http://git.denx.de/u-boot.git/**?p=u-boot/u-boot-imx.git;a=**
>>> blob;f=board/boundary/**nitrogen6x/nitrogen6x.c;h=**
>>> 229c2378396d43a365d6682af35c0e**519ccd69d4;hb=HEAD#l304<http://git.denx.de/u-boot.git/?p=u-boot/u-boot-imx.git;a=blob;f=board/boundary/nitrogen6x/nitrogen6x.c;h=229c2378396d43a365d6682af35c0e519ccd69d4;hb=HEAD#l304>
>>>      http://git.denx.de/u-boot.git/**?p=u-boot/u-boot-imx.git;a=**
>>> blob;f=board/wandboard/**wandboard.c;h=**d95189f77de4c3573ec30c53e04fe1*
>>> *b083c1d2b5;hb=HEAD#l107<http://git.denx.de/u-boot.git/?p=u-boot/u-boot-imx.git;a=blob;f=board/wandboard/wandboard.c;h=d95189f77de4c3573ec30c53e04fe1b083c1d2b5;hb=HEAD#l107>
>>>
>>
>> I would like to expand the patch but i cannot test it for boards you
>> mentioned above. Are you sure these boards have 4-bit mmc buses?
>>
>>
> I'm certain about the Nitrogen6x. Less so about Wandboard.
>
> I think I looked it up, but can't recall precisely.


I can test a patch for Wandboard :)

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://projetos.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH] mmc: mx6qsabrelite: fsl_esdhc: Define maximum bus width supported by SabreLite board
  2013-04-03  9:18   ` Dirk Behme
@ 2013-04-03  9:52     ` Stefano Babic
  0 siblings, 0 replies; 11+ messages in thread
From: Stefano Babic @ 2013-04-03  9:52 UTC (permalink / raw)
  To: u-boot

On 03/04/2013 11:18, Dirk Behme wrote:
> On 03.04.2013 11:06, Stefano Babic wrote:
>> On 21/03/2013 12:00, Abbas Raza wrote:
>>> From: Abbas Raza <Abbas_Raza@mentor.com>
>>>
>>> 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.
>>>
>>> Signed-off-by: Abbas Raza <Abbas_Raza@mentor.com>
>>> cc: stefano Babic <sbabic@denx.de>
>>> cc: Andy Fleming <afleming@gmail.com>
>>> Acked-by: Dirk Behme <dirk.behme@de.bosch.com>
>>> Acked-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
>>> ---
>>
>> 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

-- 
=====================================================================
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
=====================================================================

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH] mmc: mx6qsabrelite: fsl_esdhc: Define maximum bus width supported by SabreLite board
  2013-04-03  9:06 ` Stefano Babic
  2013-04-03  9:18   ` Dirk Behme
@ 2013-04-03  9:27   ` Stefano Babic
  1 sibling, 0 replies; 11+ messages in thread
From: Stefano Babic @ 2013-04-03  9:27 UTC (permalink / raw)
  To: u-boot

On 03/04/2013 11:06, Stefano Babic wrote:
> On 21/03/2013 12:00, Abbas Raza wrote:
>> From: Abbas Raza <Abbas_Raza@mentor.com>
>>
>> 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.
>>
>> Signed-off-by: Abbas Raza <Abbas_Raza@mentor.com>
>> cc: stefano Babic <sbabic@denx.de>
>> cc: Andy Fleming <afleming@gmail.com>
>> Acked-by: Dirk Behme <dirk.behme@de.bosch.com>
>> Acked-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
>> ---
> 
> 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

-- 
=====================================================================
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
=====================================================================

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH] mmc: mx6qsabrelite: fsl_esdhc: Define maximum bus width supported by SabreLite board
  2013-04-03  9:06 ` Stefano Babic
@ 2013-04-03  9:18   ` Dirk Behme
  2013-04-03  9:52     ` Stefano Babic
  2013-04-03  9:27   ` Stefano Babic
  1 sibling, 1 reply; 11+ messages in thread
From: Dirk Behme @ 2013-04-03  9:18 UTC (permalink / raw)
  To: u-boot

On 03.04.2013 11:06, Stefano Babic wrote:
> On 21/03/2013 12:00, Abbas Raza wrote:
>> From: Abbas Raza <Abbas_Raza@mentor.com>
>>
>> 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.
>>
>> Signed-off-by: Abbas Raza <Abbas_Raza@mentor.com>
>> cc: stefano Babic <sbabic@denx.de>
>> cc: Andy Fleming <afleming@gmail.com>
>> Acked-by: Dirk Behme <dirk.behme@de.bosch.com>
>> Acked-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
>> ---
> 
> 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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH] mmc: mx6qsabrelite: fsl_esdhc: Define maximum bus width supported by SabreLite board
  2013-03-21 11:00 Abbas Raza
@ 2013-04-03  9:06 ` Stefano Babic
  2013-04-03  9:18   ` Dirk Behme
  2013-04-03  9:27   ` Stefano Babic
  0 siblings, 2 replies; 11+ messages in thread
From: Stefano Babic @ 2013-04-03  9:06 UTC (permalink / raw)
  To: u-boot

On 21/03/2013 12:00, Abbas Raza wrote:
> From: Abbas Raza <Abbas_Raza@mentor.com>
> 
> 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.
> 
> Signed-off-by: Abbas Raza <Abbas_Raza@mentor.com>
> cc: stefano Babic <sbabic@denx.de>
> cc: Andy Fleming <afleming@gmail.com>
> Acked-by: Dirk Behme <dirk.behme@de.bosch.com>
> Acked-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
> ---

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

-- 
=====================================================================
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
=====================================================================

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH] mmc: mx6qsabrelite: fsl_esdhc: Define maximum bus width supported by SabreLite board
@ 2013-03-21 11:00 Abbas Raza
  2013-04-03  9:06 ` Stefano Babic
  0 siblings, 1 reply; 11+ messages in thread
From: Abbas Raza @ 2013-03-21 11:00 UTC (permalink / raw)
  To: u-boot

From: Abbas Raza <Abbas_Raza@mentor.com>

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.

Signed-off-by: Abbas Raza <Abbas_Raza@mentor.com>
cc: stefano Babic <sbabic@denx.de>
cc: Andy Fleming <afleming@gmail.com>
Acked-by: Dirk Behme <dirk.behme@de.bosch.com>
Acked-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
---
 board/freescale/mx6qsabrelite/mx6qsabrelite.c | 3 +++
 drivers/mmc/fsl_esdhc.c                       | 7 +++++++
 include/fsl_esdhc.h                           | 1 +
 3 files changed, 11 insertions(+)

diff --git a/board/freescale/mx6qsabrelite/mx6qsabrelite.c b/board/freescale/mx6qsabrelite/mx6qsabrelite.c
index d563464..14c299b 100644
--- a/board/freescale/mx6qsabrelite/mx6qsabrelite.c
+++ b/board/freescale/mx6qsabrelite/mx6qsabrelite.c
@@ -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]);
 
diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index 3d5c9c0..d2a505e 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -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;
 
diff --git a/include/fsl_esdhc.h b/include/fsl_esdhc.h
index 47d2fe4..0a1a071 100644
--- a/include/fsl_esdhc.h
+++ b/include/fsl_esdhc.h
@@ -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 */
-- 
1.8.2

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-06-06 21:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-21  6:38 [U-Boot] [PATCH] mmc: mx6qsabrelite: fsl_esdhc: Define maximum bus width supported by SabreLite board Abbas Raza
2013-03-21 16:17 ` Eric Nelson
2013-03-25 11:02   ` Abbas Raza
2013-03-25 13:52     ` Eric Nelson
2013-06-06 20:25     ` Eric Nelson
2013-06-06 21:47       ` Otavio Salvador
2013-03-21 11:00 Abbas Raza
2013-04-03  9:06 ` Stefano Babic
2013-04-03  9:18   ` Dirk Behme
2013-04-03  9:52     ` Stefano Babic
2013-04-03  9:27   ` Stefano Babic

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.