mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Hubert Feurstein <h.feurstein@gmail.com>
To: barebox@lists.infradead.org
Subject: [RFC PATCH] atmel-mci: fix initialization of 8bit-bus-width-mode for at91sam9g45
Date: Wed, 22 Jun 2011 00:10:16 +0200	[thread overview]
Message-ID: <1308694216-6221-1-git-send-email-h.feurstein@gmail.com> (raw)

When the bus_width was set to 8, then only one data-line has been initialized.

Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
---
 It seems that nobody tried the 8bit mode yet, because this init-bug is present in the
 linux kernel as well. 

 @Sascha: I assume the mci-host-driver should set both bits (MMC_MODE_4BIT and MMC_MODE_8BIT)
 when bus_width == 8 ???

 arch/arm/mach-at91/at91sam9g45_devices.c |    4 ++--
 drivers/mci/atmel_mci.c                  |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index dc01705..a474bd7 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -285,7 +285,7 @@ void at91_add_device_mci(short mmc_id, struct atmel_mci_platform_data *data)
 
 		/* DAT0, maybe DAT1..DAT3 and maybe DAT4..DAT7 */
 		at91_set_A_periph(AT91_PIN_PA2, 1);
-		if (data->bus_width == 4) {
+		if (data->bus_width >= 4) {
 			at91_set_A_periph(AT91_PIN_PA3, 1);
 			at91_set_A_periph(AT91_PIN_PA4, 1);
 			at91_set_A_periph(AT91_PIN_PA5, 1);
@@ -310,7 +310,7 @@ void at91_add_device_mci(short mmc_id, struct atmel_mci_platform_data *data)
 
 		/* DAT0, maybe DAT1..DAT3 and maybe DAT4..DAT7 */
 		at91_set_A_periph(AT91_PIN_PA23, 1);
-		if (data->bus_width == 4) {
+		if (data->bus_width >= 4) {
 			at91_set_A_periph(AT91_PIN_PA24, 1);
 			at91_set_A_periph(AT91_PIN_PA25, 1);
 			at91_set_A_periph(AT91_PIN_PA26, 1);
diff --git a/drivers/mci/atmel_mci.c b/drivers/mci/atmel_mci.c
index 49a7851..d8bcf81 100644
--- a/drivers/mci/atmel_mci.c
+++ b/drivers/mci/atmel_mci.c
@@ -451,9 +451,9 @@ static int mci_probe(struct device_d *hw_dev)
 	host->mci.init = mci_reset;
 
 	host->mci.host_caps = pd->host_caps;
-	if (pd->bus_width == 4)
+	if (pd->bus_width >= 4)
 		host->mci.host_caps |= MMC_MODE_4BIT;
-	else if (pd->bus_width == 8)
+	if (pd->bus_width == 8)
 		host->mci.host_caps |= MMC_MODE_8BIT;
 
 	host->base = (void __iomem *)hw_dev->map_base;
-- 
1.7.4.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2011-06-21 22:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-21 22:10 Hubert Feurstein [this message]
2011-06-21 22:23 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1308694216-6221-1-git-send-email-h.feurstein@gmail.com \
    --to=h.feurstein@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox