On Wed, Mar 01, 2006 at 02:13:25PM +0100, Lennert Buytenhek wrote:
> (please CC, I'm not on the list.)
>
> Hi!
>
> The ep93xx is an arm920t based embedded CPU from Cirrus which has,
> amongst other things, an AHB OHCI USB host interface. This CPU isn't
> supported in linux yet, but I will be submitting the core ARM support
> code for 2.6.17, and in the meanwhile, I would love to get some
> feedback on the ep93xx OHCI glue bits that are attached below.
>
> If the patch looks okay, I'll submit a new patch against 2.6.16 (when
> that comes out) -- assuming that everything is okay, would it be possible
> to get this into 2.6.17?
>
>
> thanks,
> Lennert
>
> --- CUT HERE ---
> This patch adds OHCI glue bits for the USB host interface in the
> Cirrus ep93xx (arm920t) CPU.
>
> Signed-off-by: Lennert Buytenhek <[EMAIL PROTECTED]>
>
> diff -urN linux-2.6.15.orig/drivers/usb/host/ohci-ep93xx.c
> linux-2.6.15/drivers/usb/host/ohci-ep93xx.c
> --- linux-2.6.15.orig/drivers/usb/host/ohci-ep93xx.c 1970-01-01
> 01:00:00.000000000 +0100
> +++ linux-2.6.15/drivers/usb/host/ohci-ep93xx.c 2006-02-28
> 14:44:39.000000000 +0100
> @@ -0,0 +1,169 @@
> +/*
> + * OHCI HCD (Host Controller Driver) for USB.
> + *
> + * (C) Copyright 1999 Roman Weissgaerber <[EMAIL PROTECTED]>
> + * (C) Copyright 2000-2002 David Brownell <[EMAIL PROTECTED]>
> + * (C) Copyright 2002 Hewlett-Packard Company
> + *
> + * Bus Glue for ep93xx.
> + *
> + * Written by Christopher Hoover <[EMAIL PROTECTED]>
> + * Based on fragments of previous driver by Russell King et al.
> + *
> + * Modified for LH7A404 from ohci-sa1111.c
> + * by Durgesh Pattamatta <[EMAIL PROTECTED]>
> + *
> + * Modified for pxa27x from ohci-lh7a404.c
> + * by Nick Bane <[EMAIL PROTECTED]> 26-8-2004
> + *
> + * Modified for ep93xx from ohci-pxa27x.c
> + * by Lennert Buytenhek <[EMAIL PROTECTED]> 28-2-2006
> + * Based on an earlier driver by Ray Lehtiniemi
> + *
> + * This file is licenced under the GPL.
> + */
> +
> +#include <linux/device.h>
> +#include <linux/signal.h>
> +#include <linux/platform_device.h>
> +
> +#include <asm/mach-types.h>
> +#include <asm/hardware.h>
> +
> +static void ep93xx_start_hc(struct platform_device *dev)
> +{
> + unsigned int clock_control;
> +
> + clock_control = __raw_readl(EP93XX_SYSCON_CLOCK_CONTROL);
> + clock_control |= EP93XX_SYSCON_CLOCK_USH_EN;
> + __raw_writel(clock_control, EP93XX_SYSCON_CLOCK_CONTROL);
> +}
> +
> +static void ep93xx_stop_hc(struct platform_device *dev)
> +{
> + unsigned int clock_control;
> +
> + clock_control = __raw_readl(EP93XX_SYSCON_CLOCK_CONTROL);
> + clock_control &= ~EP93XX_SYSCON_CLOCK_USH_EN;
> + __raw_writel(clock_control, EP93XX_SYSCON_CLOCK_CONTROL);
> +}
We have a clock architecture defined in include/linux/clock.h for
items like this, please use it (and there is no protection against
two threads accesing the same register...)
> +int usb_hcd_ep93xx_probe(const struct hc_driver *driver,
> + struct platform_device *dev)
> +{
> + int retval;
> + struct usb_hcd *hcd;
> +
> + hcd = usb_create_hcd(driver, &dev->dev, "ep93xx");
> + if (hcd == NULL)
> + return -ENOMEM;
> +
> + hcd->rsrc_start = dev->resource[0].start;
> + hcd->rsrc_len = dev->resource[0].end - dev->resource[0].start + 1;
> + if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
> + usb_put_hcd(hcd);
> + retval = -EBUSY;
> + goto err1;
> + }
> +
> + hcd->regs = (void __iomem *)dev->resource[0].start;
platform resource as a virtual address? should be physical addresses
(especially as you are using request_mem_region() on it)
[snip]
--
Ben ([EMAIL PROTECTED], http://www.fluff.org/)
'a smiley only costs 4 bytes'
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel