From: Pete Popov <ppopov@embeddedalley.com>
To: Rodolfo Giometti <giometti@linux.it>
Cc: "'linux-mips@linux-mips.org'" <linux-mips@linux-mips.org>
Subject: Re: USB hangs on AU1100
Date: Fri, 06 May 2005 08:51:45 -0700 [thread overview]
Message-ID: <1115394705.5785.8.camel@localhost.localdomain> (raw)
In-Reply-To: <20050506142719.GA13148@enneenne.com>
On Fri, 2005-05-06 at 16:27 +0200, Rodolfo Giometti wrote:
> On Thu, May 05, 2005 at 09:42:41AM -0700, Pete Popov wrote:
> > It sounds like this is a custom Au1100 based board? What boot code are
> > you running? I'm guessing the SOC isn't setup correctly or you have a
> > HW problem.
>
> Yes, you was right, I missing to setup USB clock... I just added this
> code to the board init function (board_setup() function) and now USB
> works:
>
> #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_AU1X00_USB_DEVICE)
> /* zero and disable FREQ2 */
> sys_freqctrl = au_readl(SYS_FREQCTRL0);
> sys_freqctrl &= ~0xFFF00000;
> au_writel(sys_freqctrl, SYS_FREQCTRL0);
>
> /* zero and disable USBH/USBD/IrDA clock */
> 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;
>
> /* FREQ2 = aux/2 = 48 MHz */
> sys_freqctrl |= ((0<<22) | (1<<21) | (1<<20));
> au_writel(sys_freqctrl, SYS_FREQCTRL0);
>
> /* Route 48MHz FREQ2 into USBH/USBD/IrDA */
> sys_clksrc |= ((4<<2) | (0<<1) | 0 );
> au_writel(sys_clksrc, SYS_CLKSRC);
>
> /* setup the static bus controller */
> au_writel(0x00000002, MEM_STCFG3); /* type = PCMCIA */
> au_writel(0x280E3D07, MEM_STTIME3); /* 250ns cycle time */
> au_writel(0x10000000, MEM_STADDR3); /* any PCMCIA select */
>
> /* Get USB Functionality pin state (device vs host drive pins) */
> pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x8000);
> #ifndef CONFIG_AU1X00_USB_DEVICE
> /* 2nd USB port is USB host */
> pin_func |= 0x8000;
> #endif
> au_writel(pin_func, SYS_PINFUNC);
> #endif /* defined (CONFIG_USB_OHCI_HCD) || defined (CONFIG_AU1X00_USB_DEVICE) */
>
> But don't you think is better to put this code into USB driver (file
> ohci-au1xxx.c) during probing stage? In this manner each platforms may
> don't worry about clock initialization...
Seems too board specific since the clocks can be routed differently on
each board.
Pete
prev parent reply other threads:[~2005-05-06 15:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-05 15:54 USB hangs on AU1100 Rodolfo Giometti
2005-05-05 16:42 ` Pete Popov
2005-05-05 17:20 ` Thiemo Seufer
2005-05-05 17:51 ` Maciej W. Rozycki
2005-05-05 18:50 ` Pete Popov
2005-05-05 17:56 ` Ulrich Teichert
2005-05-05 17:56 ` Ulrich Teichert
2005-05-05 19:18 ` Thiemo Seufer
2005-05-06 9:18 ` Rodolfo Giometti
2005-05-06 14:27 ` Rodolfo Giometti
2005-05-06 14:54 ` Dan Malek
2005-05-06 15:51 ` Pete Popov [this message]
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=1115394705.5785.8.camel@localhost.localdomain \
--to=ppopov@embeddedalley.com \
--cc=giometti@linux.it \
--cc=linux-mips@linux-mips.org \
/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