public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Rodolfo Giometti <giometti@linux.it>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] USB Storage Device(s) not found
Date: Tue, 11 Apr 2006 16:51:09 +0200	[thread overview]
Message-ID: <20060411145109.GK21613@enneenne.com> (raw)

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

-- 

GNU/Linux Solutions                  e-mail:    giometti at enneenne.com
Linux Device Driver                             giometti at gnudd.com
Embedded Systems                     		giometti@linux.it
UNIX programming                     phone:     +39 349 2432127

             reply	other threads:[~2006-04-11 14:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-11 14:51 Rodolfo Giometti [this message]
2006-04-12 13:37 ` [U-Boot-Users] USB Storage Device(s) not found Rodolfo Giometti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060411145109.GK21613@enneenne.com \
    --to=giometti@linux.it \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox