
Hello,
I'm just working on USB support for mips au1100 based board.
The problem is that when I do:
WWPC # usb start
I get:
... DEBUG: RET(rh) URB:[ 0] dev: 1,ep: 0-I,type:CTRL,len:4/4 stat:0x0 au1x00_usb_ohci.c: cmd(8): a3 00 00 00 02 00 04 00 au1x00_usb_ohci.c: data(4/4): 01 01 12 00 cannot reset port 2!? 1 USB Device(s) found scanning bus for storage devices... 0 Storage Device(s) found
An USB pen is into the USB host port and if I do:
WWPC # usb tree
I get:
Device Tree: 1 Hub (12MBit/s, 0mA) OHCI Root Hub
Since I have an au1100 I also modified the initialization code as follow:
diff --git a/cpu/mips/au1x00_usb_ohci.c b/cpu/mips/au1x00_usb_ohci.c index dbf72dc..97c5091 100644 --- a/cpu/mips/au1x00_usb_ohci.c +++ b/cpu/mips/au1x00_usb_ohci.c @@ -1581,6 +1582,7 @@ int usb_lowlevel_init(void) au_writel(sys_freqctrl, SYS_FREQCTRL0);
/* zero and disable USBH/USBD clocks */ +#if 0 sys_clksrc = au_readl(SYS_CLKSRC); sys_clksrc &= ~0x00007FE0; au_writel(sys_clksrc, SYS_CLKSRC); @@ -1590,6 +1592,17 @@ int usb_lowlevel_init(void)
sys_clksrc = au_readl(SYS_CLKSRC); sys_clksrc &= ~0x00007FE0; +#else + sys_clksrc = au_readl(SYS_CLKSRC); + sys_clksrc &= ~0x0000001F; + au_writel(sys_clksrc, SYS_CLKSRC); + + sys_freqctrl = au_readl(SYS_FREQCTRL0); + sys_freqctrl &= ~0xFFF00000; + + sys_clksrc = au_readl(SYS_CLKSRC); + sys_clksrc &= ~0x0000001F; +#endif
switch (prid & 0x000000FF) { case 0x00: /* DA */ @@ -1621,6 +1634,7 @@ int usb_lowlevel_init(void) /* * Route 48MHz FREQ2 into USB Host and/or Device */ +#if 0 sys_clksrc |= ((4<<12) | (0<<11) | (0<<10)); au_writel(sys_clksrc, SYS_CLKSRC);
@@ -1630,6 +1644,15 @@ int usb_lowlevel_init(void) au_writel(pin_func, SYS_PINFUNC); au_writel(0x2800, SYS_TRIOUTCLR); au_writel(0x0030, SYS_OUTPUTCLR); +#else + sys_clksrc |= ((4<<2) | (0<<1) | 0 ); + au_writel(sys_clksrc, SYS_CLKSRC); + + /* Set USB functionality pin state as device */ + pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x8000); + pin_func &= ~0x8000; + au_writel(pin_func, SYS_PINFUNC); +#endif
dbg("OHCI board setup complete\n");
This code is the same that I use into Linux and it works correctly!
Someone have some suggestions? Have someone already used the USB support for mips boards? :-o
Thanks in advance,
Rodolfo