linux-mips
[Top] [All Lists]

Re: [PATCH V6 4/5] USB: Add EHCI bus glue for Loongson1x SoCs

To: Alan Stern <stern@rowland.harvard.edu>
Subject: Re: [PATCH V6 4/5] USB: Add EHCI bus glue for Loongson1x SoCs
From: Kelvin Cheung <keguang.zhang@gmail.com>
Date: Wed, 18 Jan 2012 14:39:30 +0800
Cc: ralf@linux-mips.org, linux-mips@linux-mips.org, linux-usb@vger.kernel.org, gregkh@suse.de, zhzhl555@gmail.com, peppe.cavallaro@st.com, wuzhangjin@gmail.com, linux-kernel@vger.kernel.org
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=h2eI1eMOvIGEfdqrptJLqB/4G96ggOIvmoR9KM0uc4A=; b=BcHkPGwSnbeYX2O2hTM5+kH0sYeskeYvHgjlT9lNCOtqtxelLK7tC1w+JTVNORkGjl vKd6CtzpLkYgL2qDI4XIZZvy+T83vDa/uUoDixfwiRBHVnTZEFNwbxIvXz1i/JeBzrKY 44gcBuTNdaf1RG9vLJfi28Y9GApC0ygCCv9mo=
In-reply-to: <Pine.LNX.4.44L0.1201171021320.1818-100000@iolanthe.rowland.org>
References: <1326777160-9930-5-git-send-email-keguang.zhang@gmail.com> <Pine.LNX.4.44L0.1201171021320.1818-100000@iolanthe.rowland.org>
Sender: linux-mips-bounce@linux-mips.org
Done.

Thanks for review.

2012/1/17 Alan Stern <stern@rowland.harvard.edu>
On Tue, 17 Jan 2012, Kelvin Cheung wrote:

> The Loongson1x SoCs have a built-in EHCI controller.
> This patch adds the necessary glue code to make the generic EHCI
> driver usable for them.

> --- /dev/null
> +++ b/drivers/usb/host/ehci-ls1x.c
> @@ -0,0 +1,170 @@
> +/*
> + *  Bus Glue for Loongson LS1X built-in EHCI controller.
> + *
> + *  Copyright (c) 2012 Zhang, Keguang <keguang.zhang@gmail.com>
> + *
> + *  This program is free software; you can redistribute it and/or modify it
> + *  under the terms of the GNU General Public License version 2 as published
> + *  by the Free Software Foundation.
> + */
> +
> +
> +#include <linux/platform_device.h>
> +
> +static int ehci_ls1x_setup(struct usb_hcd *hcd)
> +{
> +     struct ehci_hcd *ehci = hcd_to_ehci(hcd);
> +     int ret;
> +
> +     ehci->caps = hcd->regs;
> +     ehci->regs = hcd->regs +
> +             HC_LENGTH(ehci, ehci_readl(ehci, &ehci->caps->hc_capbase));
> +     dbg_hcs_params(ehci, "reset");
> +     dbg_hcc_params(ehci, "reset");
> +
> +     /* cache this readonly data; minimize chip reads */
> +     ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
> +     ehci->sbrn = 0x20;
> +
> +     ehci_reset(ehci);
> +
> +     /* data structure init */
> +     ret = ehci_init(hcd);
> +     if (ret)
> +             return ret;
> +
> +     ehci_port_power(ehci, 0);
> +
> +     return 0;
> +}

Most of this routine should be replaced with a call to ehci_setup().

Alan Stern




--
Best Regards!
Kelvin



<Prev in Thread] Current Thread [Next in Thread>