Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH 0/2] USB: add support for Broadcom 63xx OHCI & EHCI.
@ 2010-01-30 17:54 Maxime Bizon
  2010-01-30 17:54 ` [PATCH 1/2] USB: add Broadcom 63xx integrated OHCI controller support Maxime Bizon
  2010-01-30 17:54 ` [PATCH 2/2] USB: add Broadcom 63xx integrated EHCI " Maxime Bizon
  0 siblings, 2 replies; 7+ messages in thread
From: Maxime Bizon @ 2010-01-30 17:54 UTC (permalink / raw)
  To: David Brownell, linux-usb; +Cc: Ralf Baechle, linux-mips, Maxime Bizon

Hi David,

These patches add support for Broadcom 63xx integrated USB OHCI & EHCI
controller. The platform code (device registration) has been sent in a
separate patch to Ralf.

They were already posted a long time ago, and all your comments have
now been addressed.


Maxime Bizon (2):
  USB: add Broadcom 63xx integrated OHCI controller support.
  USB: add Broadcom 63xx integrated EHCI controller support.

 drivers/usb/host/ehci-bcm63xx.c |  154 ++++++++++++++++++++++++++++++++++++
 drivers/usb/host/ehci-hcd.c     |    5 +
 drivers/usb/host/ohci-bcm63xx.c |  166 +++++++++++++++++++++++++++++++++++++++
 drivers/usb/host/ohci-hcd.c     |    5 +
 drivers/usb/host/ohci.h         |    2 +-
 5 files changed, 331 insertions(+), 1 deletions(-)
 create mode 100644 drivers/usb/host/ehci-bcm63xx.c
 create mode 100644 drivers/usb/host/ohci-bcm63xx.c

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] USB: add Broadcom 63xx integrated OHCI controller support.
  2010-01-30 17:54 [PATCH 0/2] USB: add support for Broadcom 63xx OHCI & EHCI Maxime Bizon
@ 2010-01-30 17:54 ` Maxime Bizon
  2010-01-30 17:54 ` [PATCH 2/2] USB: add Broadcom 63xx integrated EHCI " Maxime Bizon
  1 sibling, 0 replies; 7+ messages in thread
From: Maxime Bizon @ 2010-01-30 17:54 UTC (permalink / raw)
  To: David Brownell, linux-usb; +Cc: Ralf Baechle, linux-mips, Maxime Bizon

Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
---
 drivers/usb/host/ohci-bcm63xx.c |  166 +++++++++++++++++++++++++++++++++++++++
 drivers/usb/host/ohci-hcd.c     |    5 +
 drivers/usb/host/ohci.h         |    2 +-
 3 files changed, 172 insertions(+), 1 deletions(-)
 create mode 100644 drivers/usb/host/ohci-bcm63xx.c

diff --git a/drivers/usb/host/ohci-bcm63xx.c b/drivers/usb/host/ohci-bcm63xx.c
new file mode 100644
index 0000000..c9bccec
--- /dev/null
+++ b/drivers/usb/host/ohci-bcm63xx.c
@@ -0,0 +1,166 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2010 Maxime Bizon <mbizon@freebox.fr>
+ */
+
+#include <linux/init.h>
+#include <linux/clk.h>
+#include <linux/platform_device.h>
+#include <bcm63xx_cpu.h>
+#include <bcm63xx_regs.h>
+#include <bcm63xx_io.h>
+
+static struct clk *usb_host_clock;
+
+static int __devinit ohci_bcm63xx_start(struct usb_hcd *hcd)
+{
+	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
+	int ret;
+
+        /*
+         * port 2 can be shared with USB slave, but all boards seem to
+         * have only one host port populated, so we can hardcode it
+         */
+	ohci->num_ports = 1;
+
+	ret = ohci_init(ohci);
+	if (ret < 0)
+		return ret;
+
+	ret = ohci_run(ohci);
+	if (ret < 0) {
+		err("can't start %s", hcd->self.bus_name);
+		ohci_stop(hcd);
+		return ret;
+	}
+	return 0;
+}
+
+static const struct hc_driver ohci_bcm63xx_hc_driver = {
+	.description =		hcd_name,
+	.product_desc =		"BCM63XX integrated OHCI controller",
+	.hcd_priv_size =	sizeof(struct ohci_hcd),
+
+	.irq =			ohci_irq,
+	.flags =		HCD_USB11 | HCD_MEMORY,
+	.start =		ohci_bcm63xx_start,
+	.stop =			ohci_stop,
+	.shutdown =		ohci_shutdown,
+	.urb_enqueue =		ohci_urb_enqueue,
+	.urb_dequeue =		ohci_urb_dequeue,
+	.endpoint_disable =	ohci_endpoint_disable,
+	.get_frame_number =	ohci_get_frame,
+	.hub_status_data =	ohci_hub_status_data,
+	.hub_control =		ohci_hub_control,
+	.start_port_reset =	ohci_start_port_reset,
+};
+
+static int __devinit ohci_hcd_bcm63xx_drv_probe(struct platform_device *pdev)
+{
+	struct resource *res_mem;
+	struct usb_hcd *hcd;
+	struct ohci_hcd *ohci;
+	u32 reg;
+	int ret, irq;
+
+	res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	irq = platform_get_irq(pdev, 0);
+	if (!res_mem || irq < 0)
+		return -ENODEV;
+
+	if (BCMCPU_IS_6348()) {
+		struct clk *clk;
+		/* enable USB host clock */
+		clk = clk_get(&pdev->dev, "usbh");
+		if (IS_ERR(clk))
+			return -ENODEV;
+
+		clk_enable(clk);
+		usb_host_clock = clk;
+		bcm_rset_writel(RSET_OHCI_PRIV, 0, OHCI_PRIV_REG);
+
+	} else if (BCMCPU_IS_6358()) {
+		reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_SWAP_REG);
+		reg &= ~USBH_PRIV_SWAP_OHCI_ENDN_MASK;
+		reg |= USBH_PRIV_SWAP_OHCI_DATA_MASK;
+		bcm_rset_writel(RSET_USBH_PRIV, reg, USBH_PRIV_SWAP_REG);
+		/*
+		 * The magic value comes for the original vendor BSP
+		 * and is needed for USB to work. Datasheet does not
+		 * help, so the magic value is used as-is.
+		 */
+		bcm_rset_writel(RSET_USBH_PRIV, 0x1c0020, USBH_PRIV_TEST_REG);
+	} else
+		return 0;
+
+	hcd = usb_create_hcd(&ohci_bcm63xx_hc_driver, &pdev->dev, "bcm63xx");
+	if (!hcd)
+		return -ENOMEM;
+	hcd->rsrc_start = res_mem->start;
+	hcd->rsrc_len = res_mem->end - res_mem->start + 1;
+
+	if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
+		pr_debug("request_mem_region failed\n");
+		ret = -EBUSY;
+		goto out;
+	}
+
+	hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
+	if (!hcd->regs) {
+		pr_debug("ioremap failed\n");
+		ret = -EIO;
+		goto out1;
+	}
+
+	ohci = hcd_to_ohci(hcd);
+	ohci->flags |= OHCI_QUIRK_BE_MMIO | OHCI_QUIRK_BE_DESC |
+		OHCI_QUIRK_FRAME_NO;
+	ohci_hcd_init(ohci);
+
+	ret = usb_add_hcd(hcd, irq, IRQF_DISABLED);
+	if (ret)
+		goto out2;
+
+	platform_set_drvdata(pdev, hcd);
+	return 0;
+
+out2:
+	iounmap(hcd->regs);
+out1:
+	release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
+out:
+	usb_put_hcd(hcd);
+	return ret;
+}
+
+static int __devexit ohci_hcd_bcm63xx_drv_remove(struct platform_device *pdev)
+{
+	struct usb_hcd *hcd;
+
+	hcd = platform_get_drvdata(pdev);
+	usb_remove_hcd(hcd);
+	iounmap(hcd->regs);
+	usb_put_hcd(hcd);
+	release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
+	if (usb_host_clock) {
+		clk_disable(usb_host_clock);
+		clk_put(usb_host_clock);
+	}
+	platform_set_drvdata(pdev, NULL);
+	return 0;
+}
+
+static struct platform_driver ohci_hcd_bcm63xx_driver = {
+	.probe		= ohci_hcd_bcm63xx_drv_probe,
+	.remove		= __devexit_p(ohci_hcd_bcm63xx_drv_remove),
+	.shutdown	= usb_hcd_platform_shutdown,
+	.driver		= {
+		.name	= "bcm63xx_ohci",
+		.owner	= THIS_MODULE,
+	},
+};
+
+MODULE_ALIAS("platform:bcm63xx_ohci");
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 24eb747..1c82a60 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -1051,6 +1051,11 @@ MODULE_LICENSE ("GPL");
 #define PLATFORM_DRIVER		usb_hcd_pnx4008_driver
 #endif
 
+#ifdef CONFIG_BCM63XX
+#include "ohci-bcm63xx.c"
+#define PLATFORM_DRIVER		ohci_hcd_bcm63xx_driver
+#endif
+
 #if defined(CONFIG_CPU_SUBTYPE_SH7720) || \
     defined(CONFIG_CPU_SUBTYPE_SH7721) || \
     defined(CONFIG_CPU_SUBTYPE_SH7763) || \
diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h
index 5bf15fe..3c54d3e 100644
--- a/drivers/usb/host/ohci.h
+++ b/drivers/usb/host/ohci.h
@@ -655,7 +655,7 @@ static inline u32 hc32_to_cpup (const struct ohci_hcd *ohci, const __hc32 *x)
  * some big-endian SOC implementations.  Same thing happens with PSW access.
  */
 
-#ifdef CONFIG_PPC_MPC52xx
+#if defined(CONFIG_PPC_MPC52xx) || defined(CONFIG_BCM63XX)
 #define big_endian_frame_no_quirk(ohci)	(ohci->flags & OHCI_QUIRK_FRAME_NO)
 #else
 #define big_endian_frame_no_quirk(ohci)	0
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] USB: add Broadcom 63xx integrated EHCI controller support.
  2010-01-30 17:54 [PATCH 0/2] USB: add support for Broadcom 63xx OHCI & EHCI Maxime Bizon
  2010-01-30 17:54 ` [PATCH 1/2] USB: add Broadcom 63xx integrated OHCI controller support Maxime Bizon
@ 2010-01-30 17:54 ` Maxime Bizon
  2010-01-31  2:11   ` Alan Stern
  1 sibling, 1 reply; 7+ messages in thread
From: Maxime Bizon @ 2010-01-30 17:54 UTC (permalink / raw)
  To: David Brownell, linux-usb; +Cc: Ralf Baechle, linux-mips, Maxime Bizon

Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
---
 drivers/usb/host/ehci-bcm63xx.c |  154 +++++++++++++++++++++++++++++++++++++++
 drivers/usb/host/ehci-hcd.c     |    5 +
 2 files changed, 159 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/host/ehci-bcm63xx.c

diff --git a/drivers/usb/host/ehci-bcm63xx.c b/drivers/usb/host/ehci-bcm63xx.c
new file mode 100644
index 0000000..50638f7
--- /dev/null
+++ b/drivers/usb/host/ehci-bcm63xx.c
@@ -0,0 +1,154 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2008 Maxime Bizon <mbizon@freebox.fr>
+ */
+
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <bcm63xx_cpu.h>
+#include <bcm63xx_regs.h>
+#include <bcm63xx_io.h>
+
+static int ehci_bcm63xx_setup(struct usb_hcd *hcd)
+{
+	struct ehci_hcd *ehci = hcd_to_ehci(hcd);
+	int retval;
+
+	retval = ehci_halt(ehci);
+	if (retval)
+		return retval;
+
+	retval = ehci_init(hcd);
+	if (retval)
+		return retval;
+
+	ehci_reset(ehci);
+	ehci_port_power(ehci, 0);
+
+	return retval;
+}
+
+
+static const struct hc_driver ehci_bcm63xx_hc_driver = {
+	.description =		hcd_name,
+	.product_desc =		"BCM63XX integrated EHCI controller",
+	.hcd_priv_size =	sizeof(struct ehci_hcd),
+
+	.irq =			ehci_irq,
+	.flags =		HCD_MEMORY | HCD_USB2,
+
+	.reset =		ehci_bcm63xx_setup,
+	.start =		ehci_run,
+	.stop =			ehci_stop,
+	.shutdown =		ehci_shutdown,
+
+	.urb_enqueue =		ehci_urb_enqueue,
+	.urb_dequeue =		ehci_urb_dequeue,
+	.endpoint_disable =	ehci_endpoint_disable,
+
+	.get_frame_number =	ehci_get_frame,
+
+	.hub_status_data =	ehci_hub_status_data,
+	.hub_control =		ehci_hub_control,
+	.bus_suspend =		ehci_bus_suspend,
+	.bus_resume =		ehci_bus_resume,
+	.relinquish_port =	ehci_relinquish_port,
+	.port_handed_over =	ehci_port_handed_over,
+};
+
+static int __devinit ehci_hcd_bcm63xx_drv_probe(struct platform_device *pdev)
+{
+	struct resource *res_mem;
+	struct usb_hcd *hcd;
+	struct ehci_hcd *ehci;
+	u32 reg;
+	int ret, irq;
+
+	res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	irq = platform_get_irq(pdev, 0);;
+	if (!res_mem || irq < 0)
+		return -ENODEV;
+
+	reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_SWAP_REG);
+	reg &= ~USBH_PRIV_SWAP_EHCI_DATA_MASK;
+	reg |= USBH_PRIV_SWAP_EHCI_ENDN_MASK;
+	bcm_rset_writel(RSET_USBH_PRIV, reg, USBH_PRIV_SWAP_REG);
+
+	/*
+	 * The magic value comes for the original vendor BSP and is
+	 * needed for USB to work. Datasheet does not help, so the
+	 * magic value is used as-is.
+	 */
+	bcm_rset_writel(RSET_USBH_PRIV, 0x1c0020, USBH_PRIV_TEST_REG);
+
+	hcd = usb_create_hcd(&ehci_bcm63xx_hc_driver, &pdev->dev, "bcm63xx");
+	if (!hcd)
+		return -ENOMEM;
+	hcd->rsrc_start = res_mem->start;
+	hcd->rsrc_len = res_mem->end - res_mem->start + 1;
+
+	if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
+		pr_debug("request_mem_region failed\n");
+		ret = -EBUSY;
+		goto out;
+	}
+
+	hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
+	if (!hcd->regs) {
+		pr_debug("ioremap failed\n");
+		ret = -EIO;
+		goto out1;
+	}
+
+	ehci = hcd_to_ehci(hcd);
+	ehci->big_endian_mmio = 1;
+	ehci->big_endian_desc = 0;
+	ehci->caps = hcd->regs;
+	ehci->regs = hcd->regs +
+		HC_LENGTH(ehci_readl(ehci, &ehci->caps->hc_capbase));
+	ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
+	ehci->sbrn = 0x20;
+
+	ret = usb_add_hcd(hcd, irq, IRQF_DISABLED);
+	if (ret)
+		goto out2;
+
+	platform_set_drvdata(pdev, hcd);
+	return 0;
+
+out2:
+	iounmap(hcd->regs);
+out1:
+	release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
+out:
+	usb_put_hcd(hcd);
+	return ret;
+}
+
+static int __devexit ehci_hcd_bcm63xx_drv_remove(struct platform_device *pdev)
+{
+	struct usb_hcd *hcd;
+
+	hcd = platform_get_drvdata(pdev);
+	usb_remove_hcd(hcd);
+	iounmap(hcd->regs);
+	usb_put_hcd(hcd);
+	release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
+	platform_set_drvdata(pdev, NULL);
+	return 0;
+}
+
+static struct platform_driver ehci_hcd_bcm63xx_driver = {
+	.probe		= ehci_hcd_bcm63xx_drv_probe,
+	.remove		= __devexit_p(ehci_hcd_bcm63xx_drv_remove),
+	.shutdown	= usb_hcd_platform_shutdown,
+	.driver		= {
+		.name	= "bcm63xx_ehci",
+		.owner	= THIS_MODULE,
+	},
+};
+
+MODULE_ALIAS("platform:bcm63xx_ehci");
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 1ec3857..8e7c61e 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1158,6 +1158,11 @@ MODULE_LICENSE ("GPL");
 #define	PLATFORM_DRIVER		ehci_atmel_driver
 #endif
 
+#ifdef CONFIG_BCM63XX
+#include "ehci-bcm63xx.c"
+#define	PLATFORM_DRIVER		ehci_hcd_bcm63xx_driver
+#endif
+
 #if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) && \
     !defined(PS3_SYSTEM_BUS_DRIVER) && !defined(OF_PLATFORM_DRIVER)
 #error "missing bus glue for ehci-hcd"
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] USB: add Broadcom 63xx integrated EHCI controller support.
  2010-01-30 17:54 ` [PATCH 2/2] USB: add Broadcom 63xx integrated EHCI " Maxime Bizon
@ 2010-01-31  2:11   ` Alan Stern
  2010-01-31  2:11     ` Alan Stern
  2010-02-01  6:39     ` Andreas Mohr
  0 siblings, 2 replies; 7+ messages in thread
From: Alan Stern @ 2010-01-31  2:11 UTC (permalink / raw)
  To: Maxime Bizon; +Cc: David Brownell, linux-usb, Ralf Baechle, linux-mips

On Sat, 30 Jan 2010, Maxime Bizon wrote:

> Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
> ---
>  drivers/usb/host/ehci-bcm63xx.c |  154 +++++++++++++++++++++++++++++++++++++++
>  drivers/usb/host/ehci-hcd.c     |    5 +
>  2 files changed, 159 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/usb/host/ehci-bcm63xx.c
> 
> diff --git a/drivers/usb/host/ehci-bcm63xx.c b/drivers/usb/host/ehci-bcm63xx.c
> new file mode 100644
> index 0000000..50638f7
> --- /dev/null
> +++ b/drivers/usb/host/ehci-bcm63xx.c

> +static const struct hc_driver ehci_bcm63xx_hc_driver = {
> +	.description =		hcd_name,
> +	.product_desc =		"BCM63XX integrated EHCI controller",
> +	.hcd_priv_size =	sizeof(struct ehci_hcd),
> +
> +	.irq =			ehci_irq,
> +	.flags =		HCD_MEMORY | HCD_USB2,
> +
> +	.reset =		ehci_bcm63xx_setup,
> +	.start =		ehci_run,
> +	.stop =			ehci_stop,
> +	.shutdown =		ehci_shutdown,
> +
> +	.urb_enqueue =		ehci_urb_enqueue,
> +	.urb_dequeue =		ehci_urb_dequeue,
> +	.endpoint_disable =	ehci_endpoint_disable,
> +
> +	.get_frame_number =	ehci_get_frame,
> +
> +	.hub_status_data =	ehci_hub_status_data,
> +	.hub_control =		ehci_hub_control,
> +	.bus_suspend =		ehci_bus_suspend,
> +	.bus_resume =		ehci_bus_resume,
> +	.relinquish_port =	ehci_relinquish_port,
> +	.port_handed_over =	ehci_port_handed_over,
> +};

You'll run into trouble if you don't include the standard 
endpoint_reset method pointer.

Alan Stern

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] USB: add Broadcom 63xx integrated EHCI controller support.
  2010-01-31  2:11   ` Alan Stern
@ 2010-01-31  2:11     ` Alan Stern
  2010-02-01  6:39     ` Andreas Mohr
  1 sibling, 0 replies; 7+ messages in thread
From: Alan Stern @ 2010-01-31  2:11 UTC (permalink / raw)
  To: Maxime Bizon; +Cc: David Brownell, linux-usb, Ralf Baechle, linux-mips

On Sat, 30 Jan 2010, Maxime Bizon wrote:

> Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
> ---
>  drivers/usb/host/ehci-bcm63xx.c |  154 +++++++++++++++++++++++++++++++++++++++
>  drivers/usb/host/ehci-hcd.c     |    5 +
>  2 files changed, 159 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/usb/host/ehci-bcm63xx.c
> 
> diff --git a/drivers/usb/host/ehci-bcm63xx.c b/drivers/usb/host/ehci-bcm63xx.c
> new file mode 100644
> index 0000000..50638f7
> --- /dev/null
> +++ b/drivers/usb/host/ehci-bcm63xx.c

> +static const struct hc_driver ehci_bcm63xx_hc_driver = {
> +	.description =		hcd_name,
> +	.product_desc =		"BCM63XX integrated EHCI controller",
> +	.hcd_priv_size =	sizeof(struct ehci_hcd),
> +
> +	.irq =			ehci_irq,
> +	.flags =		HCD_MEMORY | HCD_USB2,
> +
> +	.reset =		ehci_bcm63xx_setup,
> +	.start =		ehci_run,
> +	.stop =			ehci_stop,
> +	.shutdown =		ehci_shutdown,
> +
> +	.urb_enqueue =		ehci_urb_enqueue,
> +	.urb_dequeue =		ehci_urb_dequeue,
> +	.endpoint_disable =	ehci_endpoint_disable,
> +
> +	.get_frame_number =	ehci_get_frame,
> +
> +	.hub_status_data =	ehci_hub_status_data,
> +	.hub_control =		ehci_hub_control,
> +	.bus_suspend =		ehci_bus_suspend,
> +	.bus_resume =		ehci_bus_resume,
> +	.relinquish_port =	ehci_relinquish_port,
> +	.port_handed_over =	ehci_port_handed_over,
> +};

You'll run into trouble if you don't include the standard 
endpoint_reset method pointer.

Alan Stern

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] USB: add Broadcom 63xx integrated EHCI controller support.
  2010-01-31  2:11   ` Alan Stern
  2010-01-31  2:11     ` Alan Stern
@ 2010-02-01  6:39     ` Andreas Mohr
  2010-02-02  9:29       ` Florian Fainelli
  1 sibling, 1 reply; 7+ messages in thread
From: Andreas Mohr @ 2010-02-01  6:39 UTC (permalink / raw)
  To: Alan Stern
  Cc: Maxime Bizon, David Brownell, linux-usb, Ralf Baechle, linux-mips

On Sat, Jan 30, 2010 at 09:11:45PM -0500, Alan Stern wrote:
> On Sat, 30 Jan 2010, Maxime Bizon wrote:
> > +static const struct hc_driver ehci_bcm63xx_hc_driver = {
> > +	.description =		hcd_name,
> > +	.product_desc =		"BCM63XX integrated EHCI controller",
> > +	.hcd_priv_size =	sizeof(struct ehci_hcd),
> > +
> > +	.irq =			ehci_irq,
> > +	.flags =		HCD_MEMORY | HCD_USB2,
> > +
> > +	.reset =		ehci_bcm63xx_setup,
> > +	.start =		ehci_run,
> > +	.stop =			ehci_stop,
> > +	.shutdown =		ehci_shutdown,
> > +
> > +	.urb_enqueue =		ehci_urb_enqueue,
> > +	.urb_dequeue =		ehci_urb_dequeue,
> > +	.endpoint_disable =	ehci_endpoint_disable,
> > +
> > +	.get_frame_number =	ehci_get_frame,
> > +
> > +	.hub_status_data =	ehci_hub_status_data,
> > +	.hub_control =		ehci_hub_control,
> > +	.bus_suspend =		ehci_bus_suspend,
> > +	.bus_resume =		ehci_bus_resume,
> > +	.relinquish_port =	ehci_relinquish_port,
> > +	.port_handed_over =	ehci_port_handed_over,
> > +};
> 
> You'll run into trouble if you don't include the standard 
> endpoint_reset method pointer.
> 
> Alan Stern

And one will run into even more trouble (as did I! hung ports galore...)
if one doesn't include the .clear_tt_buffer_complete callback either,
due to using an outdated non-mainline-synchronized host driver
(that was Broadcom as well, ehci-ssb.c).
The best thing to do is a full review of all _diffs_ in _all_
usb host kernel files in even moderately recent times (say 2.6.23 - 2.6.33)
and add every missing required item to these bcm63xx host files, too.

Is your code coming from OpenWrt too by chance? :-P


Kudos to Alan for catching this problem during review
(probably he was still alerted by my miserable luck)

HTH,

Andreas Mohr

P.S.: yup I should get ehci-ssb.c cleaned up and submitted soon.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] USB: add Broadcom 63xx integrated EHCI controller support.
  2010-02-01  6:39     ` Andreas Mohr
@ 2010-02-02  9:29       ` Florian Fainelli
  0 siblings, 0 replies; 7+ messages in thread
From: Florian Fainelli @ 2010-02-02  9:29 UTC (permalink / raw)
  To: Andreas Mohr
  Cc: Alan Stern, Maxime Bizon, David Brownell, linux-usb, Ralf Baechle,
	linux-mips

Hi,

On Monday 01 February 2010 07:39:35 Andreas Mohr wrote:
> On Sat, Jan 30, 2010 at 09:11:45PM -0500, Alan Stern wrote:
> > On Sat, 30 Jan 2010, Maxime Bizon wrote:
> > > +static const struct hc_driver ehci_bcm63xx_hc_driver = {
> > > +	.description =		hcd_name,
> > > +	.product_desc =		"BCM63XX integrated EHCI controller",
> > > +	.hcd_priv_size =	sizeof(struct ehci_hcd),
> > > +
> > > +	.irq =			ehci_irq,
> > > +	.flags =		HCD_MEMORY | HCD_USB2,
> > > +
> > > +	.reset =		ehci_bcm63xx_setup,
> > > +	.start =		ehci_run,
> > > +	.stop =			ehci_stop,
> > > +	.shutdown =		ehci_shutdown,
> > > +
> > > +	.urb_enqueue =		ehci_urb_enqueue,
> > > +	.urb_dequeue =		ehci_urb_dequeue,
> > > +	.endpoint_disable =	ehci_endpoint_disable,
> > > +
> > > +	.get_frame_number =	ehci_get_frame,
> > > +
> > > +	.hub_status_data =	ehci_hub_status_data,
> > > +	.hub_control =		ehci_hub_control,
> > > +	.bus_suspend =		ehci_bus_suspend,
> > > +	.bus_resume =		ehci_bus_resume,
> > > +	.relinquish_port =	ehci_relinquish_port,
> > > +	.port_handed_over =	ehci_port_handed_over,
> > > +};
> >
> > You'll run into trouble if you don't include the standard
> > endpoint_reset method pointer.
> >
> > Alan Stern
> 
> And one will run into even more trouble (as did I! hung ports galore...)
> if one doesn't include the .clear_tt_buffer_complete callback either,
> due to using an outdated non-mainline-synchronized host driver
> (that was Broadcom as well, ehci-ssb.c).
> The best thing to do is a full review of all _diffs_ in _all_
> usb host kernel files in even moderately recent times (say 2.6.23 - 2.6.33)
> and add every missing required item to these bcm63xx host files, too.
> 
> Is your code coming from OpenWrt too by chance? :-P

It is not, Maxime wrote it from scratch, I integrated it as part of the 
brcm63xx port.
-- 
Regards, Florian

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-02-02  9:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-30 17:54 [PATCH 0/2] USB: add support for Broadcom 63xx OHCI & EHCI Maxime Bizon
2010-01-30 17:54 ` [PATCH 1/2] USB: add Broadcom 63xx integrated OHCI controller support Maxime Bizon
2010-01-30 17:54 ` [PATCH 2/2] USB: add Broadcom 63xx integrated EHCI " Maxime Bizon
2010-01-31  2:11   ` Alan Stern
2010-01-31  2:11     ` Alan Stern
2010-02-01  6:39     ` Andreas Mohr
2010-02-02  9:29       ` Florian Fainelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox