All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tonyliu <Bo.Liu@windriver.com>
To: Maria Johansen <m.johansen@no.parkairsystems.com>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: eSDHC controller driver on MPC8308rdb
Date: Tue, 19 Oct 2010 15:55:39 +0800	[thread overview]
Message-ID: <4CBD4EFB.6070603@windriver.com> (raw)
In-Reply-To: <DF61B4AD1C20A54EADF5C05E1F1110DE08D44C@Exchange.parkairsystems.net>

Maria Johansen wrote:
>   
>> -----Original Message-----
>> From: Tonyliu [mailto:Bo.Liu@windriver.com] 
>> <snip>
>>     
>>> Could this be a problem related the eSDHC controller (or the driver), 
>>> or is it the memory card? (a 4GB SanDisk Extreme SDHC card, which unfortunately is the only card I have available at the moment.) I will keep digging into drivers/mmc/host/sdhci.c in search of a solution, and any tips to how I should proceed would be greatly appreciated!
>>>   
>>>       
>> Hi,
>> Try the patch in attatchment. By default, on some e300 platforms such as mpc8308_rdb, the entry "clock-frequency" of section sdchi in DTB is not fixed by u-boot, so has to >caculate the input clock for sdhci controller explicitly in driver.
>>
>> Tony
>>     
>
> Thanks, the missing clock-frequency was part of my problem. The rest was solved by adding some more quirks to the esdhc-driver (SDHCI_QUIRK_FORCE_1_BIT_DATA and SDHCI_QUIRK_RESET_AFTER_REQUEST). Why it is necessary to force 1-bit data transfers I am a bit unsure about, since the mpc8308 reference manual clearly states that 4-bit transfers are supported.
>   
Actually, I did use 4-bit mode. You can try another 2 quicks:

+   if (of_get_property(np, "sdhci,auto-cmd12", NULL))
+       host->quirks |= SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12;
+
+   if (of_get_property(np, "sdhci,broken-timeout", NULL))
+       host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
+

===================================================
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 9d4fdfa..b7a1ce4 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -807,8 +807,12 @@ static void sdhci_set_transfer_mode(struct 
sdhci_host *host,
    WARN_ON(!host->data);

    mode = SDHCI_TRNS_BLK_CNT_EN;
-   if (data->blocks > 1)
+   if (data->blocks > 1) {
+       if (host->quirks & SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12)
+           mode |= SDHCI_TRNS_MULTI | SDHCI_TRNS_ACMD12;
+       else
        mode |= SDHCI_TRNS_MULTI;
+   }
    if (data->flags & MMC_DATA_READ)
        mode |= SDHCI_TRNS_READ;
    if (host->flags & SDHCI_REQ_USE_DMA)
@@ -1099,6 +1103,13 @@ static void sdhci_request(struct mmc_host *mmc, 
struct mmc_request *mrq)
    sdhci_activate_led(host);
 #endif

+   if (host->quirks & SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12) {
+       if (mrq->stop) {
+           mrq->data->stop = NULL;
+           mrq->stop = NULL;
+       }
+   }
+
    host->mrq = mrq;


I don't have patch for upstream, you can add them manually.

Tony
> Thanks for your help :)
>
> --
> Maria
>
>
>
>
>   

  reply	other threads:[~2010-10-19  7:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-14 14:42 eSDHC controller driver on MPC8308rdb Maria Johansen
2010-10-18  8:27 ` Tonyliu
2010-10-19  7:26   ` Maria Johansen
2010-10-19  7:55     ` Tonyliu [this message]
2010-10-19  8:09       ` Zang Roy-R61911
2010-10-19  8:49       ` Maria Johansen

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=4CBD4EFB.6070603@windriver.com \
    --to=bo.liu@windriver.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=m.johansen@no.parkairsystems.com \
    /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 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.