Skip to contentSkip to conversation

More updates to bcm63xx support (resend)

PATCH In review Maxime Bizon 4 participants 25 messages Jun 1, 2009 – Jun 2, 2009

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

[Resend, I forgot to generate an actual patch series and missed one patch doing so, sorry for the noise]

Hi Ralf,

The following patch series (on top of Florian's latest post) are mostly trivial fixes & cleanup requested by subsystem maintainers.

Patch 2 and 4 are actual bugfixes.

Florian has some more patches to send to you, I will wait for them to be folded in the bcm63xx tree and then repost the whole serie.

I only got feedback from USB maintainer, and addressed most of them. Davem has accidentally dropped the patch from its patchwork, so I think just resubmitting will do. Nothing from serial & pcmcia.

The ethernet PHY support patch should be dropped, the only feature we get is IRQ support which after field testing seems to be buggy. Maybe later.

Is it ok for you if I ask for the patches to go through your tree once they get acked ?

Thanks !

#1 lore raw

PATCH 1/10 bcm63xx: remove duplicate init fields.

This patch removes duplicate init fields in resource.

---
 arch/mips/bcm63xx/dev-enet.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
arch/mips/bcm63xx/dev-enet.c +0 -2
index 51c2e5a..188fa66 100644
@@ -42,12 +42,10 @@ static struct resource enet0_res[] = {
 	},
 	{
 		.start		= -1, /* filled at runtime */
-		.start		= IRQ_ENET0_RXDMA,
 		.flags		= IORESOURCE_IRQ,
 	},
 	{
 		.start		= -1, /* filled at runtime */
-		.start		= IRQ_ENET0_TXDMA,
 		.flags		= IORESOURCE_IRQ,
 	},
 };
Signature · 1 line
1.6.0.4
Acked-by on v1 1/10
#2 lore raw

Re: [PATCH 01/10] bcm63xx: remove duplicate init fields.

Le Monday 01 June 2009 19:21:49 Maxime Bizon, vous avez écrit :

Quoted 3 lines

This patch removes duplicate init fields in resource.

Quoted 21 lines
---
 arch/mips/bcm63xx/dev-enet.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
arch/mips/bcm63xx/dev-enet.c +0 -2
index 51c2e5a..188fa66 100644
@@ -42,12 +42,10 @@ static struct resource enet0_res[] = {
 	},
 	{
 		.start		= -1, /* filled at runtime */
-		.start		= IRQ_ENET0_RXDMA,
 		.flags		= IORESOURCE_IRQ,
 	},
 	{
 		.start		= -1, /* filled at runtime */
-		.start		= IRQ_ENET0_TXDMA,
 		.flags		= IORESOURCE_IRQ,
 	},
 };
#3 lore raw

PATCH 2/10 bcm63xx: use napi_complete instead of __napi_complete

In reply to Maxime Bizon

We're not disabling IRQ, so we must call the irq safe flavour of napi_complete.

---
 drivers/net/bcm63xx_enet.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/bcm63xx_enet.c +1 -1
index a91f909..20e08ef 100644
@@ -450,7 +450,7 @@ static int bcm_enet_poll(struct napi_struct *napi, int budget)
 
 	/* no more packet in rx/tx queue, remove device from poll
 	 * queue */
-	__napi_complete(napi);
+	napi_complete(napi);
 
 	/* restore rx/tx interrupt */
 	enet_dma_writel(priv, ENETDMA_IR_PKTDONE_MASK,
Signature · 1 line
1.6.0.4
Tested-by Acked-by on v1 2/10
#4 lore raw

Re: [PATCH 02/10] bcm63xx: use napi_complete instead of __napi_complete

Le Monday 01 June 2009 19:21:50 Maxime Bizon, vous avez écrit :

Quoted 4 lines

We're not disabling IRQ, so we must call the irq safe flavour of napi_complete.

Quoted 18 lines
---
 drivers/net/bcm63xx_enet.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/bcm63xx_enet.c +1 -1
index a91f909..20e08ef 100644
@@ -450,7 +450,7 @@ static int bcm_enet_poll(struct napi_struct *napi, int
 budget)
 
 	/* no more packet in rx/tx queue, remove device from poll
 	 * queue */
-	__napi_complete(napi);
+	napi_complete(napi);
 
 	/* restore rx/tx interrupt */

enet_dma_writel(priv, ENETDMA_IR_PKTDONE_MASK,

#5 lore raw

PATCH 3/10 bcm63xx: convert bcm63xx_enet to netdev ops.

In reply to Maxime Bizon

This patch makes bcm63xx_enet driver use netdevice ops.

---
 drivers/net/bcm63xx_enet.c |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)
drivers/net/bcm63xx_enet.c +14 -10
index 20e08ef..36324b3 100644
@@ -1551,6 +1551,19 @@ static void bcm_enet_hw_preinit(struct bcm_enet_priv *priv)
 	enet_writel(priv, val, ENET_MIBCTL_REG);
 }
 
+static const struct net_device_ops bcm_enet_ops = {
+	.ndo_open		= bcm_enet_open,
+	.ndo_stop		= bcm_enet_stop,
+	.ndo_start_xmit		= bcm_enet_start_xmit,
+	.ndo_get_stats		= bcm_enet_get_stats,
+	.ndo_set_mac_address	= bcm_enet_set_mac_address,
+	.ndo_set_multicast_list = bcm_enet_set_multicast_list,
+	.ndo_do_ioctl		= bcm_enet_ioctl,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	.ndo_poll_controller = bcm_enet_netpoll,
+#endif
+};
+
 /*
  * allocate netdevice, request register memory and register device.
  */
@@ -1716,17 +1729,8 @@ static int __devinit bcm_enet_probe(struct platform_device *pdev)
 		enet_writel(priv, 0, ENET_MIB_REG(i));
 
 	/* register netdevice */
-	dev->open = bcm_enet_open;
-	dev->stop = bcm_enet_stop;
-	dev->hard_start_xmit = bcm_enet_start_xmit;
-	dev->get_stats = bcm_enet_get_stats;
-	dev->set_mac_address = bcm_enet_set_mac_address;
-	dev->set_multicast_list = bcm_enet_set_multicast_list;
+	dev->netdev_ops = &bcm_enet_ops;
 	netif_napi_add(dev, &priv->napi, bcm_enet_poll, 16);
-	dev->do_ioctl = bcm_enet_ioctl;
-#ifdef CONFIG_NET_POLL_CONTROLLER
-	dev->poll_controller = bcm_enet_netpoll;
-#endif
 
 	SET_ETHTOOL_OPS(dev, &bcm_enet_ethtool_ops);
 
Signature · 1 line
1.6.0.4
Acked-by on v1 3/10
#6 lore raw

Re: [PATCH 03/10] bcm63xx: convert bcm63xx_enet to netdev ops.

Le Monday 01 June 2009 19:21:51 Maxime Bizon, vous avez écrit :

Quoted 3 lines

This patch makes bcm63xx_enet driver use netdevice ops.

Quoted 46 lines
---
 drivers/net/bcm63xx_enet.c |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)
drivers/net/bcm63xx_enet.c +14 -10
index 20e08ef..36324b3 100644
@@ -1551,6 +1551,19 @@ static void bcm_enet_hw_preinit(struct bcm_enet_priv
 *priv) enet_writel(priv, val, ENET_MIBCTL_REG);
 }
 
+static const struct net_device_ops bcm_enet_ops = {
+	.ndo_open		= bcm_enet_open,
+	.ndo_stop		= bcm_enet_stop,
+	.ndo_start_xmit		= bcm_enet_start_xmit,
+	.ndo_get_stats		= bcm_enet_get_stats,
+	.ndo_set_mac_address	= bcm_enet_set_mac_address,
+	.ndo_set_multicast_list = bcm_enet_set_multicast_list,
+	.ndo_do_ioctl		= bcm_enet_ioctl,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	.ndo_poll_controller = bcm_enet_netpoll,
+#endif
+};
+
 /*
  * allocate netdevice, request register memory and register device.
  */
@@ -1716,17 +1729,8 @@ static int __devinit bcm_enet_probe(struct
 platform_device *pdev) enet_writel(priv, 0, ENET_MIB_REG(i));
 
 	/* register netdevice */
-	dev->open = bcm_enet_open;
-	dev->stop = bcm_enet_stop;
-	dev->hard_start_xmit = bcm_enet_start_xmit;
-	dev->get_stats = bcm_enet_get_stats;
-	dev->set_mac_address = bcm_enet_set_mac_address;
-	dev->set_multicast_list = bcm_enet_set_multicast_list;
+	dev->netdev_ops = &bcm_enet_ops;
 	netif_napi_add(dev, &priv->napi, bcm_enet_poll, 16);
-	dev->do_ioctl = bcm_enet_ioctl;
-#ifdef CONFIG_NET_POLL_CONTROLLER
-	dev->poll_controller = bcm_enet_netpoll;
-#endif
 
 	SET_ETHTOOL_OPS(dev, &bcm_enet_ethtool_ops);
Signature · 4 lines
Best regards, Florian Fainelli
Email : [email protected]
http://openwrt.org
-------------------------------
#7 lore raw

PATCH 4/10 bcm63xx: limit number of usb port to 1.

In reply to Maxime Bizon

This patch disables the use of more than one USB port. Hardware has two ports, but one may be shared with USB slave port.

Until we have this information in the platform data, don't use the second port.

---
 drivers/usb/host/ohci-bcm63xx.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/usb/host/ohci-bcm63xx.c +2 -0
index 08807d9..74f432f 100644
@@ -20,6 +20,8 @@ static int __devinit ohci_bcm63xx_start(struct usb_hcd *hcd)
 	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
 	int ret;
 
+	ohci->num_ports = 1;
+
 	ret = ohci_init(ohci);
 	if (ret < 0)
 		return ret;
Signature · 1 line
1.6.0.4
Acked-by on v1 4/10
#8 lore raw

Re: [PATCH 04/10] bcm63xx: limit number of usb port to 1.

Le Monday 01 June 2009 19:21:52 Maxime Bizon, vous avez écrit :

Quoted 7 lines

This patch disables the use of more than one USB port. Hardware has two ports, but one may be shared with USB slave port.

Until we have this information in the platform data, don't use the second port.

Quoted 17 lines
---
 drivers/usb/host/ohci-bcm63xx.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/drivers/usb/host/ohci-bcm63xx.c index 08807d9..74f432f 100644

drivers/usb/host/ohci-bcm63xx.c +2 -0
@@ -20,6 +20,8 @@ static int __devinit ohci_bcm63xx_start(struct usb_hcd
 *hcd) struct ohci_hcd *ohci = hcd_to_ohci(hcd);
 	int ret;
 
+	ohci->num_ports = 1;
+
 	ret = ohci_init(ohci);
 	if (ret < 0)
 		return ret;
Signature · 4 lines
Best regards, Florian Fainelli
Email : [email protected]
http://openwrt.org
-------------------------------
#9 lore raw

PATCH 5/10 bcm63xx: use platform_get_irq in ohci-bcm63xx.c

In reply to Maxime Bizon

As requested by USB maintainer, use platform_get_irq instead of platform_get_resource.

---
 drivers/usb/host/ohci-bcm63xx.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
drivers/usb/host/ohci-bcm63xx.c +5 -5
index 74f432f..f0e4639 100644
@@ -58,15 +58,15 @@ static const struct hc_driver ohci_bcm63xx_hc_driver = {
 
 static int __devinit ohci_hcd_bcm63xx_drv_probe(struct platform_device *pdev)
 {
-	struct resource *res_mem, *res_irq;
+	struct resource *res_mem;
 	struct usb_hcd *hcd;
 	struct ohci_hcd *ohci;
 	u32 reg;
-	int ret;
+	int ret, irq;
 
 	res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	if (!res_mem || !res_irq)
+	irq = platform_get_irq(pdev, 0);
+	if (!res_mem || irq < 0)
 		return -ENODEV;
 
 	if (BCMCPU_IS_6348()) {
@@ -114,7 +114,7 @@ static int __devinit ohci_hcd_bcm63xx_drv_probe(struct platform_device *pdev)
 		OHCI_QUIRK_FRAME_NO;
 	ohci_hcd_init(ohci);
 
-	ret = usb_add_hcd(hcd, res_irq->start, IRQF_DISABLED);
+	ret = usb_add_hcd(hcd, irq, IRQF_DISABLED);
 	if (ret)
 		goto out2;
 
Signature · 1 line
1.6.0.4
Acked-by on v1 5/10
#10 lore raw

Re: [PATCH 05/10] bcm63xx: use platform_get_irq in ohci-bcm63xx.c

Le Monday 01 June 2009 19:21:53 Maxime Bizon, vous avez écrit :

Quoted 4 lines

As requested by USB maintainer, use platform_get_irq instead of platform_get_resource.

Quoted 37 lines
---
 drivers/usb/host/ohci-bcm63xx.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
(quoted diff) +0 -0

b/drivers/usb/host/ohci-bcm63xx.c index 74f432f..f0e4639 100644

drivers/usb/host/ohci-bcm63xx.c +4 -4
@@ -58,15 +58,15 @@ static const struct hc_driver ohci_bcm63xx_hc_driver =
 {
 
 static int __devinit ohci_hcd_bcm63xx_drv_probe(struct platform_device
 *pdev) {
-	struct resource *res_mem, *res_irq;
+	struct resource *res_mem;
 	struct usb_hcd *hcd;
 	struct ohci_hcd *ohci;
 	u32 reg;
-	int ret;
+	int ret, irq;
 
 	res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	if (!res_mem || !res_irq)
+	irq = platform_get_irq(pdev, 0);
+	if (!res_mem || irq < 0)
 		return -ENODEV;
 
drivers/usb/host/ohci-bcm63xx.c +1 -1
 	if (BCMCPU_IS_6348()) {
@@ -114,7 +114,7 @@ static int __devinit ohci_hcd_bcm63xx_drv_probe(struct
 platform_device *pdev) OHCI_QUIRK_FRAME_NO;
 	ohci_hcd_init(ohci);
 
-	ret = usb_add_hcd(hcd, res_irq->start, IRQF_DISABLED);
+	ret = usb_add_hcd(hcd, irq, IRQF_DISABLED);
 	if (ret)
 		goto out2;
Signature · 4 lines
Best regards, Florian Fainelli
Email : [email protected]
http://openwrt.org
-------------------------------
#11 lore raw

PATCH 6/10 bcm63xx: don't set bus type in ohci-bcm63xx.c

In reply to Maxime Bizon

The platform code already sets the bus type, so don't do it.

---
 drivers/usb/host/ohci-bcm63xx.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/usb/host/ohci-bcm63xx.c +0 -1
index f0e4639..d48c8ac 100644
@@ -154,7 +154,6 @@ static struct platform_driver ohci_hcd_bcm63xx_driver = {
 	.driver		= {
 		.name	= "bcm63xx_ohci",
 		.owner	= THIS_MODULE,
-		.bus	= &platform_bus_type
 	},
 };
 
Signature · 1 line
1.6.0.4
Acked-by on v1 6/10
#12 lore raw

Re: [PATCH 06/10] bcm63xx: don't set bus type in ohci-bcm63xx.c

Le Monday 01 June 2009 19:21:54 Maxime Bizon, vous avez écrit :

Quoted 3 lines

The platform code already sets the bus type, so don't do it.

Quoted 15 lines
---
 drivers/usb/host/ohci-bcm63xx.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
(quoted diff) +0 -0

b/drivers/usb/host/ohci-bcm63xx.c index f0e4639..d48c8ac 100644

drivers/usb/host/ohci-bcm63xx.c +0 -1
@@ -154,7 +154,6 @@ static struct platform_driver ohci_hcd_bcm63xx_driver =
 { .driver		= {
 		.name	= "bcm63xx_ohci",
 		.owner	= THIS_MODULE,
-		.bus	= &platform_bus_type
 	},
 };
Signature · 4 lines
Best regards, Florian Fainelli
Email : [email protected]
http://openwrt.org
-------------------------------
#13 lore raw

PATCH 7/10 bcm63xx: clarify meaning of the magical value in ohci-bcm63xx.c

In reply to Maxime Bizon

USB maintainer asked for clarification of the magic value used during USB init. Be clear about the source of it.

---
 drivers/usb/host/ohci-bcm63xx.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/usb/host/ohci-bcm63xx.c +3 -1
index d48c8ac..bd66d5a 100644
@@ -85,7 +85,9 @@ static int __devinit ohci_hcd_bcm63xx_drv_probe(struct platform_device *pdev)
 		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);
-		/* don't ask... */
+		/* 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;
Signature · 1 line
1.6.0.4
Acked-by on v1 7/10
#14 lore raw

Re: [PATCH 07/10] bcm63xx: clarify meaning of the magical value in ohci-bcm63xx.c

Le Monday 01 June 2009 19:21:55 Maxime Bizon, vous avez écrit :

Quoted 4 lines

USB maintainer asked for clarification of the magic value used during USB init. Be clear about the source of it.

Quoted 19 lines
---
 drivers/usb/host/ohci-bcm63xx.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
(quoted diff) +0 -0

b/drivers/usb/host/ohci-bcm63xx.c index d48c8ac..bd66d5a 100644

drivers/usb/host/ohci-bcm63xx.c +3 -1
@@ -85,7 +85,9 @@ static int __devinit ohci_hcd_bcm63xx_drv_probe(struct
 platform_device *pdev) 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);
-		/* don't ask... */
+		/* 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;
Signature · 4 lines
Best regards, Florian Fainelli
Email : [email protected]
http://openwrt.org
-------------------------------
#15 lore raw

PATCH 7/10 bcm63xx: clarify meaning of the magical value in ohci-bcm63xx.c

In reply to Maxime Bizon

USB maintainer asked for clarification of the magic value used during USB init. Be clear about the source of it.

---
 drivers/usb/host/ohci-bcm63xx.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
drivers/usb/host/ohci-bcm63xx.c +5 -1
index d48c8ac..668808e 100644
@@ -85,7 +85,11 @@ static int __devinit ohci_hcd_bcm63xx_drv_probe(struct platform_device *pdev)
 		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);
-		/* don't ask... */
+		/*
+		 * 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;
Signature · 1 line
1.6.0.4
#16 lore raw

PATCH 8/10 bcm63xx: use platform_get_irq in ehci-bcm63xx.c

In reply to Maxime Bizon

As requested by USB maintainer, use platform_get_irq instead of platform_get_resource.

---
 drivers/usb/host/ehci-bcm63xx.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
drivers/usb/host/ehci-bcm63xx.c +5 -5
index 2fef571..0aba0f9 100644
@@ -62,15 +62,15 @@ static const struct hc_driver ehci_bcm63xx_hc_driver = {
 
 static int __devinit ehci_hcd_bcm63xx_drv_probe(struct platform_device *pdev)
 {
-	struct resource *res_mem, *res_irq;
+	struct resource *res_mem;
 	struct usb_hcd *hcd;
 	struct ehci_hcd *ehci;
 	u32 reg;
-	int ret;
+	int ret, irq;
 
 	res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	if (!res_mem || !res_irq)
+	irq = platform_get_irq(pdev, 0);;
+	if (!res_mem || irq < 0)
 		return -ENODEV;
 
 	reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_SWAP_REG);
@@ -109,7 +109,7 @@ static int __devinit ehci_hcd_bcm63xx_drv_probe(struct platform_device *pdev)
 	ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
 	ehci->sbrn = 0x20;
 
-	ret = usb_add_hcd(hcd, res_irq->start, IRQF_DISABLED);
+	ret = usb_add_hcd(hcd, irq, IRQF_DISABLED);
 	if (ret)
 		goto out2;
 
Signature · 1 line
1.6.0.4
Acked-by on v1 8/10
#17 lore raw

Re: [PATCH 08/10] bcm63xx: use platform_get_irq in ehci-bcm63xx.c

Le Monday 01 June 2009 19:21:56 Maxime Bizon, vous avez écrit :

Quoted 4 lines

As requested by USB maintainer, use platform_get_irq instead of platform_get_resource.

Quoted 38 lines
---
 drivers/usb/host/ehci-bcm63xx.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
(quoted diff) +0 -0

b/drivers/usb/host/ehci-bcm63xx.c index 2fef571..0aba0f9 100644

drivers/usb/host/ehci-bcm63xx.c +4 -4
@@ -62,15 +62,15 @@ static const struct hc_driver ehci_bcm63xx_hc_driver =
 {
 
 static int __devinit ehci_hcd_bcm63xx_drv_probe(struct platform_device
 *pdev) {
-	struct resource *res_mem, *res_irq;
+	struct resource *res_mem;
 	struct usb_hcd *hcd;
 	struct ehci_hcd *ehci;
 	u32 reg;
-	int ret;
+	int ret, irq;
 
 	res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	if (!res_mem || !res_irq)
+	irq = platform_get_irq(pdev, 0);;
+	if (!res_mem || irq < 0)
 		return -ENODEV;
 
drivers/usb/host/ehci-bcm63xx.c +1 -1
 	reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_SWAP_REG);
@@ -109,7 +109,7 @@ static int __devinit ehci_hcd_bcm63xx_drv_probe(struct
 platform_device *pdev) ehci->hcs_params = ehci_readl(ehci,
 &ehci->caps->hcs_params);
 	ehci->sbrn = 0x20;
 
-	ret = usb_add_hcd(hcd, res_irq->start, IRQF_DISABLED);
+	ret = usb_add_hcd(hcd, irq, IRQF_DISABLED);
 	if (ret)
 		goto out2;
Signature · 4 lines
Best regards, Florian Fainelli
Email : [email protected]
http://openwrt.org
-------------------------------
#18 lore raw

PATCH 9/10 bcm63xx: don't set bus type in ehci-bcm63xx.c

In reply to Maxime Bizon

The platform code already sets the bus type, so don't do it.

---
 drivers/usb/host/ehci-bcm63xx.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/usb/host/ehci-bcm63xx.c +0 -1
index 0aba0f9..8a62c0a 100644
@@ -145,7 +145,6 @@ static struct platform_driver ehci_hcd_bcm63xx_driver = {
 	.driver		= {
 		.name	= "bcm63xx_ehci",
 		.owner	= THIS_MODULE,
-		.bus	= &platform_bus_type
 	},
 };
 
Signature · 1 line
1.6.0.4
Acked-by on v1 9/10
#19 lore raw

Re: [PATCH 09/10] bcm63xx: don't set bus type in ehci-bcm63xx.c

Le Monday 01 June 2009 19:21:57 Maxime Bizon, vous avez écrit :

Quoted 3 lines

The platform code already sets the bus type, so don't do it.

Quoted 15 lines
---
 drivers/usb/host/ehci-bcm63xx.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
(quoted diff) +0 -0

b/drivers/usb/host/ehci-bcm63xx.c index 0aba0f9..8a62c0a 100644

drivers/usb/host/ehci-bcm63xx.c +0 -1
@@ -145,7 +145,6 @@ static struct platform_driver ehci_hcd_bcm63xx_driver =
 { .driver		= {
 		.name	= "bcm63xx_ehci",
 		.owner	= THIS_MODULE,
-		.bus	= &platform_bus_type
 	},
 };
Signature · 4 lines
Best regards, Florian Fainelli
Email : [email protected]
http://openwrt.org
-------------------------------
#20 lore raw

PATCH 10/10 bcm63xx: clarify meaning of the magical value in ehci-bcm63xx.c

In reply to Maxime Bizon

USB maintainer asked for clarification of the magic value used during USB init. Be clear about the source of it.

---
 drivers/usb/host/ehci-bcm63xx.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/usb/host/ehci-bcm63xx.c +3 -1
index 8a62c0a..5a03fdd 100644
@@ -78,7 +78,9 @@ static int __devinit ehci_hcd_bcm63xx_drv_probe(struct platform_device *pdev)
 	reg |= USBH_PRIV_SWAP_EHCI_ENDN_MASK;
 	bcm_rset_writel(RSET_USBH_PRIV, reg, USBH_PRIV_SWAP_REG);
 
-	/* don't ask... */
+	/* 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");
Signature · 1 line
1.6.0.4
#21 lore raw

Re: [PATCH 10/10] bcm63xx: clarify meaning of the magical value in ehci-bcm63xx.c

Hello.

Quoted 13 lines · Maxime Bizon

USB maintainer asked for clarification of the magic value used during USB init. Be clear about the source of it.

---
 drivers/usb/host/ehci-bcm63xx.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/usb/host/ehci-bcm63xx.c +0 -0
index 8a62c0a..5a03fdd 100644

drivers/usb/host/ehci-bcm63xx.c static int __devinit ehci_hcd_bcm63xx_drv_probe(struct platform_device *pdev) · line 86

Quoted 10 lines
drivers/usb/host/ehci-bcm63xx.c +3 -1
@@ -78,7 +78,9 @@ static int __devinit ehci_hcd_bcm63xx_drv_probe(struct platform_device *pdev)
 	reg |= USBH_PRIV_SWAP_EHCI_ENDN_MASK;
 	bcm_rset_writel(RSET_USBH_PRIV, reg, USBH_PRIV_SWAP_REG);
 
-	/* don't ask... */
+	/* 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");

Documentation/CodingStyle, chapter 8:

The preferred style for long (multi-line) comments is:

/*
* This is the preferred style for multi-line
* comments in the Linux kernel source code.
* Please use it consistently.
*
* Description: A column of asterisks on the left side,
* with beginning and ending almost-blank lines. */

WBR, Sergei

#22 lore raw

PATCH 10/10 bcm63xx: clarify meaning of the magical value in ehci-bcm63xx.c

USB maintainer asked for clarification of the magic value used during USB init. Be clear about the source of it.

---
 drivers/usb/host/ehci-bcm63xx.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
drivers/usb/host/ehci-bcm63xx.c +5 -1
index 8a62c0a..c2b3e7f 100644
@@ -78,7 +78,11 @@ static int __devinit ehci_hcd_bcm63xx_drv_probe(struct platform_device *pdev)
 	reg |= USBH_PRIV_SWAP_EHCI_ENDN_MASK;
 	bcm_rset_writel(RSET_USBH_PRIV, reg, USBH_PRIV_SWAP_REG);
 
-	/* don't ask... */
+	/*
+	 * 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");
Signature · 1 line
1.6.0.4
Acked-by on v1 10/10
#23 lore raw

Re: [PATCH 10/10] bcm63xx: clarify meaning of the magical value in ehci-bcm63xx.c

In reply to Maxime Bizon

Le Monday 01 June 2009 19:21:58 Maxime Bizon, vous avez écrit :

Quoted 4 lines

USB maintainer asked for clarification of the magic value used during USB init. Be clear about the source of it.

Quoted 19 lines
---
 drivers/usb/host/ehci-bcm63xx.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
(quoted diff) +0 -0

b/drivers/usb/host/ehci-bcm63xx.c index 8a62c0a..5a03fdd 100644

drivers/usb/host/ehci-bcm63xx.c +3 -1
@@ -78,7 +78,9 @@ static int __devinit ehci_hcd_bcm63xx_drv_probe(struct
 platform_device *pdev) reg |= USBH_PRIV_SWAP_EHCI_ENDN_MASK;
 	bcm_rset_writel(RSET_USBH_PRIV, reg, USBH_PRIV_SWAP_REG);
 
-	/* don't ask... */
+	/* 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");
Signature · 4 lines
Best regards, Florian Fainelli
Email : [email protected]
http://openwrt.org
-------------------------------