Skip to contentSkip to conversation

More updates to bcm63xx support.

PATCH New Maxime Bizon 1 participant 10 messages Jun 1, 2009

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

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/1 bcm63xx: limit number of usb port to 1.

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
#2 lore raw

PATCH 1/1 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
#3 lore raw

PATCH 1/1 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
#4 lore raw

PATCH 1/1 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
#5 lore raw

PATCH 1/1 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
#6 lore raw

PATCH 1/1 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
#7 lore raw

PATCH 1/1 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
#8 lore raw

PATCH 1/1 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
#9 lore raw

PATCH 1/1 bcm63xx: remove duplicate init fields.

In reply to Maxime Bizon

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