From: Jaehoon Chung <jh80.chung@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 1/3] mmc: sdhci: fix the wrong operation when response type is R1b
Date: Fri, 30 Mar 2012 15:23:01 +0900 [thread overview]
Message-ID: <4F755145.2070902@samsung.com> (raw)
In-Reply-To: <CALZhoSS1ZXQp+TW8-zyNcSpZTCN6tz_gm744-c8wZPCz11r+Ww@mail.gmail.com>
On 03/30/2012 02:24 PM, Lei Wen wrote:
> Hi Jaehoon,
>
> On Fri, Mar 30, 2012 at 12:36 PM, Jaehoon Chung <jh80.chung@samsung.com> wrote:
>> Hi Lei.
>>
>> First, thanks for implemented the generic sdhci controller.
>
> It is my pleasure to share this common code, and I'm glad that it is
> used for other platforms now. :)
>
>>
>> On 03/30/2012 12:33 PM, Lei Wen wrote:
>>
>>> Hi Jaehoon,
>>>
>>> On Fri, Mar 30, 2012 at 10:39 AM, Jaehoon Chung <jh80.chung@samsung.com> wrote:
>>>> When response type is R1b, mask value is added the SDHCI_INT_DAT_END.
>>>> but in while(), didn't check that flag.
>>>> So sdhci controller didn't work fine.
>>>> CMD6 didn't always complete.
>>>
>>> Could you elaborate it more in details?
>>> do {
>>> stat = sdhci_readl(host, SDHCI_INT_STATUS);
>>> if (stat & SDHCI_INT_ERROR)
>>> break;
>>> } while ((stat & mask) != mask);
>>> Here in the while condition, if the status read out don't contain all mask,
>>> then the looping would continue.
>>> Do you mean you just need a retry max time set here?
>>
>> I found that didn't initialize the eMMC card.
>> Because when send CMD6, running infinite loop in there.
>> CMD6's mask is set to SDHCI_INT_RESPONSE and SDHCI_INT_DATA_END.
>> (Because response type is R1B).
>> Then mask value maybe is 0x3...
>> stat = sdhci_readl(host, SDHCI_INT_STATUS);
>> stat is 0x1.(cmd is done response).
>> but in while(), stat & mask is 0x1, and mask is 0x3.
>> ...doing while().
>> If just add the timeout, then always produced the timeout error.
>
> I see your problems. Your silicon only provide SDHCI_INT_RESPONSE for
> r1b, while the standard
> sdhci spec require both the flag is set when the r1b command is finished.
> So my point is you could add a quirk condition check in the previously
> endless loop checking.
> If the quirk is true, and timeout count is met, then you could jump
> out of original looping.
> And for later checking, this timeout could be regarded as no error,
> since the controller would never
> return the SDHCI_INT_DATA_END in your case.
Anyway it's need that use the timeout value. right?
And in our case, It's means that use the quirks?
I didn't find that the sdhci spec require the flag is set when the r1b command is finished.
where is specified?
I just understand that the transfer complete bit should be set to 1,
when send the command with busy flag or read/write with data.
Is this means?
If you want to use the quirks, i will test with applied your opinion.
Best Regards,
Jaehoon Chung
>
>>
>> How did you test? Is initialize the eMMC card?
>> (I tested with eMMC4.41 (exynos4).)
>
> I test on many Marvell platforms, with sd, mmc, emmc, they all works fine.
>
>>
next prev parent reply other threads:[~2012-03-30 6:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-30 2:39 [U-Boot] [PATCH v2 1/3] mmc: sdhci: fix the wrong operation when response type is R1b Jaehoon Chung
2012-03-30 3:33 ` Lei Wen
2012-03-30 4:36 ` Jaehoon Chung
2012-03-30 5:24 ` Lei Wen
2012-03-30 6:23 ` Jaehoon Chung [this message]
2012-03-30 15:54 ` Lei Wen
2012-03-31 6:55 ` Jae hoon Chung
2012-03-31 12:39 ` Lei Wen
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=4F755145.2070902@samsung.com \
--to=jh80.chung@samsung.com \
--cc=u-boot@lists.denx.de \
/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