From: Kevin Hickey <khickey@rmicorp.com>
To: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: ralf@linux-mips.org, linux-mips@linux-mips.org
Subject: Re: [PATCH 06/10] Alchemy: Au1300 USB support
Date: Sat, 07 Mar 2009 13:11:28 -0600 [thread overview]
Message-ID: <1236453088.9848.7.camel@kh-d820> (raw)
In-Reply-To: <49B245F1.2090200@ru.mvista.com>
On Sat, 2009-03-07 at 13:01 +0300, Sergei Shtylyov wrote:
> Hello.
>
> Kevin Hickey wrote:
>
> > Adds support for USB 2.0 on the Au1300 SOC.
> >
> > Signed-off-by: Kevin Hickey <khickey@rmicorp.com>
> >
> [...]
> > diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
> > index 83babb0..a50d053 100644
> > --- a/drivers/usb/Kconfig
> > +++ b/drivers/usb/Kconfig
> > @@ -55,6 +55,7 @@ config USB_ARCH_HAS_EHCI
> > boolean
> > default y if PPC_83xx
> > default y if SOC_AU1200
> > + default y if SOC_AU13XX
> >
>
> Why not:
>
> default y if SOC_AU1200 || SOC_AU13XX
>
I was just following the pattern... there were already two other
explicit "default y if" lines.
>
> > diff --git a/drivers/usb/host/ehci-au13xx.c b/drivers/usb/host/ehci-au13xx.c
> > new file mode 100644
> > index 0000000..fe03667
> > --- /dev/null
> > +++ b/drivers/usb/host/ehci-au13xx.c
> > @@ -0,0 +1,213 @@
> > +/*
> > + * Copyright 2008 RMI Corporation
> > + * Author: Kevin Hickey <khickey@rmicorp.com>
> > + *
> > + * This program is free software; you can redistribute it and/or modify it
> > + * under the terms of the GNU General Public License as published by the
> > + * Free Software Foundation; either version 2 of the License, or (at your
> > + * option) any later version.
> > + *
> > + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
> > + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
> > + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
> > + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
> > + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
> > + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
> > + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
> > + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
> > + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> > + *
> > + * You should have received a copy of the GNU General Public License along
> > + * with this program; if not, write to the Free Software Foundation, Inc.,
> > + * 675 Mass Ave, Cambridge, MA 02139, USA.
> > + *
> > + * Based on ehci-au1xxx.c.
> > + */
> > +
> > +#include <linux/platform_device.h>
> > +#include <asm/mach-au1x00/au1000.h>
> > +
> > +
> > +extern int usb_disabled(void);
> > +
> > +static void au13xx_start_ehc(void)
> > +{
> > + AU13XX_USB* au13xx_usb = (AU13XX_USB*)(KSEG1 | USB_BASE_PHYS_ADDR);
> >
>
> Your coding style is not acceptable -- run your patched thru
> scruipts/checkpatch.pl please.
Sorry about that.
>
> > + /*
> > + * Enable clocks.
> > + */
> > + AU_SET_BITS_32(USB_DWC_CTRL3_EHC_CLKEN, &au13xx_usb->dwc_ctrl3);
> > +
> > + /*
> > + * Take the host controller block out of reset
> > + */
> > + AU_SET_BITS_32(USB_DWC_CTRL1_HSTRS, &au13xx_usb->dwc_ctrl1);
> > +
> > + /*
> > + * Enable all of the PHYs
> > + */
> > + AU_SET_BITS_32(USB_DWC_CTRL2_PHYRS | USB_DWC_CTRL2_PHY0RS | USB_DWC_CTRL2_PH1RS,
> > + &au13xx_usb->dwc_ctrl2);
> > +
> > + /*
> > + * Enable interrupts
> > + */
> > + AU_SET_BITS_32(USB_INTR_EHCI, &au13xx_usb->intr_enable);
> > +
> > + /*
> > + * This bit enables coherent DMA.
> > + */
> > + AU_SET_BITS_32(USB_SBUS_CTRL_SBCA, &au13xx_usb->sbus_ctrl);
> > + asm("sync");
> >
>
> Don't we have au_sync()?
Yes, and I should have used it here :)
>
> > +static int ehci_hcd_au13xx_drv_probe(struct platform_device *pdev)
> > +{
> >
> [...]
> > + au13xx_start_ehc();
> > +
> > + ehci = hcd_to_ehci(hcd);
> > + ehci->caps = hcd->regs;
> > + ehci->regs = hcd->regs + HC_LENGTH(readl(&ehci->caps->hc_capbase));
> > + printk("ehci->regs = %p\n", ehci->regs);
> >
>
> printk() should have KERN_* facility.
Agreed. In fact this is probably just leftover bringup/debug code that
should be eliminated.
>
> > +static struct platform_driver ehci_hcd_au13xx_driver = {
> > + .probe = ehci_hcd_au13xx_drv_probe,
> > + .remove = ehci_hcd_au13xx_drv_remove,
> > + .shutdown = usb_hcd_platform_shutdown,
> > + .suspend = NULL,
> > + .resume = NULL,
> >
>
> No dire need to explicitly initializer these two...
Copy-paste laziness strikes again...
>
> WBR, Sergei
>
>
--
Kevin Hickey
Alchemy Solutions
RMI Corporation
khickey@rmicorp.com
P: 512.691.8044
next prev parent reply other threads:[~2009-03-07 19:11 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-06 16:19 Alchemy: Support for RMI Alchemy Au1300 and DBAu1300 Kevin Hickey
2009-03-06 16:20 ` [PATCH 01/10] Initial Au1300 and DBAu1300 support Kevin Hickey
2009-03-06 16:20 ` [PATCH 02/10] Alchemy: Au1300 new interrupt controller Kevin Hickey
2009-03-07 9:49 ` Manuel Lauss
2009-03-07 9:49 ` Manuel Lauss
2009-03-07 19:20 ` Kevin Hickey
2009-03-08 8:49 ` Manuel Lauss
2009-03-06 16:20 ` [PATCH 03/10] Alchemy: Au1300/DB1300 UART support Kevin Hickey
2009-03-06 16:20 ` [PATCH 04/10] Alchemy: Au1300/DB1300 peripheral resource declarations Kevin Hickey
2009-03-06 16:20 ` [PATCH 05/10] Alchemy: Au1300/DB1300 MMC support Kevin Hickey
2009-03-06 16:20 ` [PATCH 06/10] Alchemy: Au1300 USB support Kevin Hickey
2009-03-07 10:01 ` Sergei Shtylyov
2009-03-07 19:11 ` Kevin Hickey [this message]
2009-03-06 16:20 ` [PATCH 07/10] Alchemy: SMSC 9210 Ethernet support Kevin Hickey
2009-03-07 9:35 ` Manuel Lauss
2009-03-07 9:35 ` Manuel Lauss
2009-03-07 19:06 ` Kevin Hickey
2009-03-06 16:20 ` [PATCH 08/10] Alchemy: DB1300 blink leds on timer tick Kevin Hickey
2009-03-07 9:37 ` Manuel Lauss
2009-03-07 9:37 ` Manuel Lauss
2009-03-07 19:04 ` Kevin Hickey
2009-03-08 8:37 ` Manuel Lauss
2009-03-08 8:54 ` Manuel Lauss
2009-03-06 16:20 ` [PATCH 09/10] Alchemy: Au1300: Add LCD framebuffer support Kevin Hickey
2009-03-06 16:20 ` [PATCH 10/10] Alchemy: DB1300 defconfig Kevin Hickey
2009-03-09 13:40 ` [PATCH 01/10] Initial Au1300 and DBAu1300 support Ralf Baechle
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=1236453088.9848.7.camel@kh-d820 \
--to=khickey@rmicorp.com \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
--cc=sshtylyov@ru.mvista.com \
/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