[PATCH] - Fix MMC -- was H4 boot with latest git kernel

Woodruff, Richard
2007-02-09T21:47:24Z

[-- Attachment #1: Type: text/plain, Size: 2257 bytes --]

Hi,

So took a quick look with the emulator and see its hanging in MMC. I'm
not an MMC expert but I don't see how you can send an init-stream
command with no clocks running and if you did it looks like it should be
80clocks over 1ms.

The note in the upper layer in mmc.c says you power it first, then send
clocks out. mmc.c calls MMC_POWER_UP twice. The first time with
ios->clock = 0 and a second time with iso->clock=f_min. To me that just
says set the power bit in the first pass and set the initstream command
in the second pass.

The below patch seems to work fine and would appear to be a long
standing bug.

Signed-off-by: Richard Woodruff <r-woodruff2.com>

diff --git a/drivers/mmc/omap.c b/drivers/mmc/omap.c
index 796172a..55075cc 100644
--- a/drivers/mmc/omap.c
+++ b/drivers/mmc/omap.c
@@ -990,7 +990,7 @@ static void mmc_omap_set_ios(struct mmc_
* Writing to the CON register twice seems to do the trick. */
for (i = 0; i < 2; i++)
OMAP_MMC_WRITE(host, CON, dsor);
- if (ios->power_mode == MMC_POWER_UP) {
+ if ((ios->power_mode == MMC_POWER_UP) && ios->clock) {
/* Send clock cycles, poll completion */
OMAP_MMC_WRITE(host, IE, 0);
OMAP_MMC_WRITE(host, STAT, 0xffff);

Regards,
Richard W.

> -----Original Message-----
> From: linux-omap-open-source-bounces+r-woodruff2=ti.com@linux.omap.com
>
[mailto:linux-omap-open-source-bounces+r-woodruff2=ti.com@linux.omap.com
]
> On Behalf Of Tony Lindgren
> Sent: Friday, February 09, 2007 10:52 AM
> To: Trilok Soni
> Cc: linux-omap-open-source@linux.omap.com
> Subject: Re: H4 boot with latest git kernel
>
> * Trilok Soni <soni.trilok@gmail.com> [070209 03:30]:
> > Hi,
> >
> > H4 booting sequence stops just after the following NET messages. I
am
> > using latest pull from git. I have tried disabling IrDA, thinking
that
> > it might had created some problems. Is it working for anyone out
> > there?
>
> Maybe try booting with initcall_debug kernel parameter to see where
> it hangs?
>
> Regards,
>
> Tony
> _______________________________________________
> Linux-omap-open-source mailing list
> Linux-omap-open-source@linux.omap.com
> http://linux.omap.com/mailman/listinfo/linux-omap-open-source

[-- Attachment #2: mmcfix.diff --]
[-- Type: application/octet-stream, Size: 534 bytes --]

diff --git a/drivers/mmc/omap.c b/drivers/mmc/omap.c
index 796172a..55075cc 100644
--- a/drivers/mmc/omap.c
+++ b/drivers/mmc/omap.c
@@ -990,7 +990,7 @@ static void mmc_omap_set_ios(struct mmc_
* Writing to the CON register twice seems to do the trick. */
for (i = 0; i < 2; i++)
OMAP_MMC_WRITE(host, CON, dsor);
- if (ios->power_mode == MMC_POWER_UP) {
+ if ((ios->power_mode == MMC_POWER_UP) && ios->clock) {
/* Send clock cycles, poll completion */
OMAP_MMC_WRITE(host, IE, 0);
OMAP_MMC_WRITE(host, STAT, 0xffff);

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]