[U-Boot] [PATCH v4 4/4] Add USB support for Efika

Marek Vasut marek.vasut at gmail.com
Mon Sep 26 22:51:21 CEST 2011


On Monday, September 26, 2011 10:28:17 PM Jana Rapava wrote:
> > > +     while (--timeout) {
> > > +             tmp = readl(&ehci->ulpi_viewpoint);
> > > +             if (!(tmp & ulpi_bit))
> > > +                     break;
> > > +             WATCHDOG_RESET();
> > > +     }
> > > +     if (!timeout) {
> > > +             printf("ULPI %s timed out\n", operation);
> > > +             return 0;
> > > +     }
> > > +     return tmp;
> > > +}
> > > +
> > > +void ulpi_write(u8 *reg, u32 value, struct usb_ehci *ehci)
> > 
> > ulpi_write(ehci, reg, value), please fix globally and in similar
> > functions.
> > 
> > Also, change u8 *reg to u8 reg, why are you passing a pointer?
> 
> Is it really important in ulpi_read/write function to use u8 reg instead of
> u8 *reg?
> When I rewrite this, usb reset starts giving me ULPI operations timeout,
> and I couldn't find a source of that.
> The problem is in the middle of usb_new_device, but it looks like no
> function calling ULPI operations is called from that function.

Actually I think this is the problem:
       writel(ULPI_RWRUN | (u32)reg << ULPI_ADDR_SHIFT, &ehci->ulpi_viewpoint);

You cast the u8 * to u32, making the whole first argument of writel() an u32. 
Whereas in the other case, when passing u8, the first argument stays u8 and the 
result is truncated.
> 
> Regards,
> Jana Rapava


More information about the U-Boot mailing list