Skip to contentSkip to conversation

Porting Au1x000 USB host controller on u-boot

DISCUSSION Rodolfo Giometti 2 participants 6 messages May 4, 2006 MIPS

lore
Share & tools
lore
#0 lore raw

Hello,

I'm trying to implement support for USB host into u-boot. I initialized the USB controller just as linux does, the EDs and the TDs look like good in memory but the controller seems not well reading them and on the bus I see random USB messages...

I think that there could be some problem on memory coherency... some suggestion?

Thanks,

Rodolfo

Signature · 4 lines
GNU/Linux Solutions                  e-mail:    [email protected]
Linux Device Driver                             [email protected]
Embedded Systems                     		[email protected]
UNIX programming                     phone:     +39 349 2432127
#1 lore raw

Hello,

Quoted 7 lines · Rodolfo Giometti

I'm trying to implement support for USB host into u-boot. I initialized the USB controller just as linux does, the EDs and the TDs look like good in memory but the controller seems not well reading them and on the bus I see random USB messages...

I think that there could be some problem on memory coherency... some suggestion?

Be sure to set Config0.OD (bit 19), it's proven to fix the USB-related
lockups on Au1500 at least. See arch/mips/common/cputable.c for the CPU steppings where it must be set to mask various errata. Also, try to disable USB controller's DMA coherency in the USB enable register (there's a related errata in all Au1xx0 family) -- the Linux driver doesn't do this though, and this shouldn't matter unless you're modifying USB buffers on the fly. :-)
Also, note that this magic bit may be write only, so make sure it's set on
every write to CP0 Config0 reg. See this patch:

http://www.linux-mips.org/archives/linux-mips/2006-03/msg00243.html

Quoted 3 lines

Thanks,

Rodolfo

WBR, Sergei

#2 lore raw

Hello,

Quoted 10 lines · Sergei Shtylyov
Quoted 7 lines

I'm trying to implement support for USB host into u-boot. I initialized the USB controller just as linux does, the EDs and the TDs look like good in memory but the controller seems not well reading them and on the bus I see random USB messages...

I think that there could be some problem on memory coherency... some suggestion?

Be sure to set Config0.OD (bit 19), it's proven to fix the
USB-related lockups on Au1500 at least. See arch/mips/common/cputable.c

arch/mips/au1000/common/cputable.c, I mean... :-)

WBR, Sergei

#3 lore raw
In reply to Sergei Shtylyov
Quoted 9 lines · Hello, I wrote:
Quoted 7 lines

I'm trying to implement support for USB host into u-boot. I initialized the USB controller just as linux does, the EDs and the TDs look like good in memory but the controller seems not well reading them and on the bus I see random USB messages...

I think that there could be some problem on memory coherency... some suggestion?

try to disable USB controller's DMA coherency in the USB enable register (there's a related errata in all Au1xx0 family) -- the Linux driver doesn't do this though, and this shouldn't matter unless you're modifying USB buffers on the fly. :-)

AND make sure every buffer/TD/ED is written back / invalidated from cache
before the OHCI accesses them since the cache coherency on Au1xx0 is b0rken!

WBR, Sergei

#4 lore raw
Quoted 4 lines · Sergei Shtylyov

AND make sure every buffer/TD/ED is written back / invalidated from cache before the OHCI accesses them since the cache coherency on Au1xx0 is
b0rken!

Mmm... good suggestion! :) How can I invalidated the cache? Can you please show me some example code?

Thanks _a lot_!

Rodolfo

Signature · 4 lines
GNU/Linux Solutions                  e-mail:    [email protected]
Linux Device Driver                             [email protected]
Embedded Systems                     		[email protected]
UNIX programming                     phone:     +39 349 2432127
#5 lore raw

Hello.

Quoted 3 lines · Rodolfo Giometti
Quoted 3 lines

AND make sure every buffer/TD/ED is written back / invalidated from cache before the OHCI accesses them since the cache coherency on Au1xx0 is
b0rken!

Or, better yet, access TD/ED (and, if possible, the buffers) via uncached
KSEG1 only.

Quoted 2 lines

Mmm... good suggestion! :) How can I invalidated the cache? Can you please show me some example code?

Dig in arch/mips/mm/c-r4k.c...

Quoted 3 lines

Thanks _a lot_!

Rodolfo

WBR, Sergei