* [U-Boot] [PATCH] PXAMMC: Drop different delays for PXA27X
@ 2010-04-05 0:32 Marek Vasut
2010-04-14 19:43 ` Marek Vasut
2010-04-24 1:13 ` Andy Fleming
0 siblings, 2 replies; 6+ messages in thread
From: Marek Vasut @ 2010-04-05 0:32 UTC (permalink / raw)
To: u-boot
In case the delays were set to 10000, the MMC card on PXA27X boards (and PXA3xx
boards) didn't initialize on first try. Increasing the delays and leaving just
those for PXA25x and 26x (that is 200000) fixes this problem.
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
drivers/mmc/pxa_mmc.c | 8 --------
1 files changed, 0 insertions(+), 8 deletions(-)
diff --git a/drivers/mmc/pxa_mmc.c b/drivers/mmc/pxa_mmc.c
index 8225235..b155541 100644
--- a/drivers/mmc/pxa_mmc.c
+++ b/drivers/mmc/pxa_mmc.c
@@ -584,11 +584,7 @@ mmc_legacy_init(int verbose)
debug("Detected SD card\n");
break;
}
-#ifdef CONFIG_PXA27X
- udelay(10000);
-#else
udelay(200000);
-#endif
}
if (retries <= 0 || !(IF_TYPE_SD == mmc_dev.if_type)) {
@@ -598,11 +594,7 @@ mmc_legacy_init(int verbose)
retries = 10;
while (retries-- && resp && !(resp[0] & 0x80000000)) {
-#ifdef CONFIG_PXA27X
- udelay(10000);
-#else
udelay(200000);
-#endif
resp =
mmc_cmd(MMC_CMD_SEND_OP_COND, 0x00ff, 0x8000,
MMC_CMDAT_R3);
--
1.7.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] PXAMMC: Drop different delays for PXA27X
2010-04-05 0:32 [U-Boot] [PATCH] PXAMMC: Drop different delays for PXA27X Marek Vasut
@ 2010-04-14 19:43 ` Marek Vasut
2010-04-24 1:13 ` Andy Fleming
1 sibling, 0 replies; 6+ messages in thread
From: Marek Vasut @ 2010-04-14 19:43 UTC (permalink / raw)
To: u-boot
Dne Po 5. dubna 2010 02:32:50 Marek Vasut napsal(a):
> In case the delays were set to 10000, the MMC card on PXA27X boards (and
> PXA3xx boards) didn't initialize on first try. Increasing the delays and
> leaving just those for PXA25x and 26x (that is 200000) fixes this problem.
>
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> ---
> drivers/mmc/pxa_mmc.c | 8 --------
> 1 files changed, 0 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/mmc/pxa_mmc.c b/drivers/mmc/pxa_mmc.c
> index 8225235..b155541 100644
> --- a/drivers/mmc/pxa_mmc.c
> +++ b/drivers/mmc/pxa_mmc.c
> @@ -584,11 +584,7 @@ mmc_legacy_init(int verbose)
> debug("Detected SD card\n");
> break;
> }
> -#ifdef CONFIG_PXA27X
> - udelay(10000);
> -#else
> udelay(200000);
> -#endif
> }
>
> if (retries <= 0 || !(IF_TYPE_SD == mmc_dev.if_type)) {
> @@ -598,11 +594,7 @@ mmc_legacy_init(int verbose)
>
> retries = 10;
> while (retries-- && resp && !(resp[0] & 0x80000000)) {
> -#ifdef CONFIG_PXA27X
> - udelay(10000);
> -#else
> udelay(200000);
> -#endif
> resp =
> mmc_cmd(MMC_CMD_SEND_OP_COND, 0x00ff, 0x8000,
> MMC_CMDAT_R3);
CCed Andy Fleming. Please review. Thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] PXAMMC: Drop different delays for PXA27X
2010-04-05 0:32 [U-Boot] [PATCH] PXAMMC: Drop different delays for PXA27X Marek Vasut
2010-04-14 19:43 ` Marek Vasut
@ 2010-04-24 1:13 ` Andy Fleming
2010-04-24 1:29 ` Marek Vasut
1 sibling, 1 reply; 6+ messages in thread
From: Andy Fleming @ 2010-04-24 1:13 UTC (permalink / raw)
To: u-boot
On Sun, Apr 4, 2010 at 7:32 PM, Marek Vasut <marek.vasut@gmail.com> wrote:
> In case the delays were set to 10000, the MMC card on PXA27X boards (and PXA3xx
> boards) didn't initialize on first try. Increasing the delays and leaving just
> those for PXA25x and 26x (that is 200000) fixes this problem.
In general, I object to board-specific #ifdefs in drivers. At the
very least, change this so that the value
is specified like so:
#ifndef PXA_TIMEOUT_DELAY
#define PXA_TIMEOUT_DELAY 10000
#endif
And then override the value in the PXA27X config file.
That way, when the next board comes along, and someone objects to
waiting a fifth of a second between each try, but they need more than
10,000us, they can override it to a different value without doing
cascading #ifdefs.
Andy
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] PXAMMC: Drop different delays for PXA27X
2010-04-24 1:13 ` Andy Fleming
@ 2010-04-24 1:29 ` Marek Vasut
2010-04-24 1:39 ` Andy Fleming
0 siblings, 1 reply; 6+ messages in thread
From: Marek Vasut @ 2010-04-24 1:29 UTC (permalink / raw)
To: u-boot
Dne So 24. dubna 2010 03:13:07 Andy Fleming napsal(a):
> On Sun, Apr 4, 2010 at 7:32 PM, Marek Vasut <marek.vasut@gmail.com> wrote:
> > In case the delays were set to 10000, the MMC card on PXA27X boards (and
> > PXA3xx boards) didn't initialize on first try. Increasing the delays and
> > leaving just those for PXA25x and 26x (that is 200000) fixes this
> > problem.
>
> In general, I object to board-specific #ifdefs in drivers.
This is not a board specific ifdef.
> At the
> very least, change this so that the value
> is specified like so:
>
> #ifndef PXA_TIMEOUT_DELAY
> #define PXA_TIMEOUT_DELAY 10000
> #endif
>
> And then override the value in the PXA27X config file.
No need to override anything.
>
> That way, when the next board comes along, and someone objects to
> waiting a fifth of a second between each try, but they need more than
> 10,000us, they can override it to a different value without doing
> cascading #ifdefs.
There won't be any ifdefs or board specific goo.
>
> Andy
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] PXAMMC: Drop different delays for PXA27X
2010-04-24 1:29 ` Marek Vasut
@ 2010-04-24 1:39 ` Andy Fleming
2010-04-24 11:30 ` Marek Vasut
0 siblings, 1 reply; 6+ messages in thread
From: Andy Fleming @ 2010-04-24 1:39 UTC (permalink / raw)
To: u-boot
On Fri, Apr 23, 2010 at 8:29 PM, Marek Vasut <marek.vasut@gmail.com> wrote:
> Dne So 24. dubna 2010 03:13:07 Andy Fleming napsal(a):
>> On Sun, Apr 4, 2010 at 7:32 PM, Marek Vasut <marek.vasut@gmail.com> wrote:
>> > In case the delays were set to 10000, the MMC card on PXA27X boards (and
>> > PXA3xx boards) didn't initialize on first try. Increasing the delays and
>> > leaving just those for PXA25x and 26x (that is 200000) fixes this
>> > problem.
>>
>> In general, I object to board-specific #ifdefs in drivers.
>
> This is not a board specific ifdef.
I'm sorry, I misread the patch completely. I assumed you were adding
the #ifdefs, instead of removing them, as that is the usual pattern,
and I had misunderstood your patch description. 200000us is a long
time. Are you sure it's necessary (would 100000 work)? Let me know,
and I'll apply this patch.
Andy
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] PXAMMC: Drop different delays for PXA27X
2010-04-24 1:39 ` Andy Fleming
@ 2010-04-24 11:30 ` Marek Vasut
0 siblings, 0 replies; 6+ messages in thread
From: Marek Vasut @ 2010-04-24 11:30 UTC (permalink / raw)
To: u-boot
Dne So 24. dubna 2010 03:39:24 Andy Fleming napsal(a):
> On Fri, Apr 23, 2010 at 8:29 PM, Marek Vasut <marek.vasut@gmail.com> wrote:
> > Dne So 24. dubna 2010 03:13:07 Andy Fleming napsal(a):
> >> On Sun, Apr 4, 2010 at 7:32 PM, Marek Vasut <marek.vasut@gmail.com> wrote:
> >> > In case the delays were set to 10000, the MMC card on PXA27X boards
> >> > (and PXA3xx boards) didn't initialize on first try. Increasing the
> >> > delays and leaving just those for PXA25x and 26x (that is 200000)
> >> > fixes this problem.
> >>
> >> In general, I object to board-specific #ifdefs in drivers.
> >
> > This is not a board specific ifdef.
>
> I'm sorry, I misread the patch completely. I assumed you were adding
> the #ifdefs, instead of removing them, as that is the usual pattern,
> and I had misunderstood your patch description. 200000us is a long
> time. Are you sure it's necessary (would 100000 work)? Let me know,
> and I'll apply this patch.
Good. I haven't tested with shorter delays, but how would that matter? If the
card times out, it's bad none the less. If it doesn't, the whole delay isn't
used anyway.
We can adjust this timing in another patch though. As it is now, it works fine
for both PXA27x and PXA3xx and also doesn't break PXA25x -- that's why I'd
better avoid mixing it into one patch.
>
> Andy
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-04-24 11:30 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-05 0:32 [U-Boot] [PATCH] PXAMMC: Drop different delays for PXA27X Marek Vasut
2010-04-14 19:43 ` Marek Vasut
2010-04-24 1:13 ` Andy Fleming
2010-04-24 1:29 ` Marek Vasut
2010-04-24 1:39 ` Andy Fleming
2010-04-24 11:30 ` Marek Vasut
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.