diff options
author | jogo <jogo@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-07-31 14:27:31 +0000 |
---|---|---|
committer | jogo <jogo@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-07-31 14:27:31 +0000 |
commit | 971ed3b67dd37ecc17f2e352af7ae27f2219a7a5 (patch) | |
tree | 819aa27e4835bbf4bb18d751762caada193f2008 /target/linux | |
parent | f0fe32e09a714146abf2c3cf2be13030c1c577b1 (diff) |
bcm63xx: update enetswitch driver
Update enetswith driver with latest fixes and additions.
Signed-off-by: Jonas Gorski <jonas.gorski+openwrt@gmail.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@32921 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux')
31 files changed, 452 insertions, 44 deletions
diff --git a/target/linux/brcm63xx/patches-3.3/431-bcm63xx_enet-reset-port-link-state-in-bcm_enetsw_ope.patch b/target/linux/brcm63xx/patches-3.3/416-bcm63xx_enet-reset-port-link-state-in-bcm_enetsw_ope.patch index e1e048c09..6d8e5a72d 100644 --- a/target/linux/brcm63xx/patches-3.3/431-bcm63xx_enet-reset-port-link-state-in-bcm_enetsw_ope.patch +++ b/target/linux/brcm63xx/patches-3.3/416-bcm63xx_enet-reset-port-link-state-in-bcm_enetsw_ope.patch @@ -17,7 +17,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -2214,6 +2214,8 @@ static int bcm_enetsw_open(struct net_de +@@ -2213,6 +2213,8 @@ static int bcm_enetsw_open(struct net_de enetsw_writeb(priv, ENETSW_PTCTRL_RXDIS_MASK | ENETSW_PTCTRL_TXDIS_MASK, ENETSW_PTCTRL_REG(i)); diff --git a/target/linux/brcm63xx/patches-3.3/417-bcm63xx_enet-don-t-overwrite-settings-when-setting-d.patch b/target/linux/brcm63xx/patches-3.3/417-bcm63xx_enet-don-t-overwrite-settings-when-setting-d.patch new file mode 100644 index 000000000..407c8169e --- /dev/null +++ b/target/linux/brcm63xx/patches-3.3/417-bcm63xx_enet-don-t-overwrite-settings-when-setting-d.patch @@ -0,0 +1,20 @@ +From e79bc74f76361020d820ed4611d28f70ebd845ca Mon Sep 17 00:00:00 2001 +From: Jonas Gorski <jonas.gorski@gmail.com> +Date: Tue, 10 Jul 2012 10:44:09 +0200 +Subject: [PATCH 34/84] bcm63xx_enet: don't overwrite settings when setting duplex on force + +--- + drivers/net/ethernet/broadcom/bcm63xx_enet.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c +@@ -2333,7 +2333,7 @@ static int bcm_enetsw_open(struct net_de + } + + if (port->force_duplex_full) +- override = ENETSW_IMPOV_FDX_MASK; ++ override |= ENETSW_IMPOV_FDX_MASK; + + + enetsw_writeb(priv, override, ENETSW_PORTOV_REG(i)); diff --git a/target/linux/brcm63xx/patches-3.3/418-bcm63xx_enet-store-the-number-of-ports-instead-of-ha.patch b/target/linux/brcm63xx/patches-3.3/418-bcm63xx_enet-store-the-number-of-ports-instead-of-ha.patch new file mode 100644 index 000000000..232668b7c --- /dev/null +++ b/target/linux/brcm63xx/patches-3.3/418-bcm63xx_enet-store-the-number-of-ports-instead-of-ha.patch @@ -0,0 +1,98 @@ +From efe31ec8fca92162fc21630611971345014a81a0 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski <jonas.gorski@gmail.com> +Date: Tue, 10 Jul 2012 10:39:30 +0200 +Subject: [PATCH 33/84] bcm63xx_enet: store the number of ports instead of hardcoding them + +This will be needed for devices with a different number of ports +--- + arch/mips/bcm63xx/dev-enet.c | 2 ++ + .../include/asm/mach-bcm63xx/bcm63xx_dev_enet.h | 2 ++ + drivers/net/ethernet/broadcom/bcm63xx_enet.c | 9 +++++---- + drivers/net/ethernet/broadcom/bcm63xx_enet.h | 1 + + 4 files changed, 10 insertions(+), 4 deletions(-) + +--- a/arch/mips/bcm63xx/dev-enet.c ++++ b/arch/mips/bcm63xx/dev-enet.c +@@ -239,6 +239,8 @@ bcm63xx_enetsw_register(const struct bcm + + memcpy(bcm63xx_enetsw_device.dev.platform_data, pd, sizeof (*pd)); + ++ enetsw_pd.num_ports = ENETSW_PORTS_6368; ++ + ret = platform_device_register(&bcm63xx_enetsw_device); + if (ret) + return ret; +--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h ++++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h +@@ -43,6 +43,7 @@ struct bcm63xx_enet_platform_data { + * on board ethernet switch platform data + */ + #define ENETSW_MAX_PORT 6 ++#define ENETSW_PORTS_6368 6 /* 4 FE PHY + 2 RGMII */ + + struct bcm63xx_enetsw_port { + int used; +@@ -58,6 +59,7 @@ struct bcm63xx_enetsw_port { + + struct bcm63xx_enetsw_platform_data { + char mac_addr[ETH_ALEN]; ++ int num_ports; + struct bcm63xx_enetsw_port used_ports[ENETSW_MAX_PORT]; + }; + +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c +@@ -2041,7 +2041,7 @@ static void swphy_poll_timer(unsigned lo + struct bcm_enet_priv *priv = (struct bcm_enet_priv *)data; + unsigned int i; + +- for (i = 0; i < ARRAY_SIZE(priv->used_ports); i++) { ++ for (i = 0; i < priv->num_ports; i++) { + struct bcm63xx_enetsw_port *port; + int val, j, up, advertise, lpa, lpa2, speed, duplex, media; + u8 override; +@@ -2207,7 +2207,7 @@ static int bcm_enetsw_open(struct net_de + priv->rx_curr_desc = 0; + + /* disable all ports */ +- for (i = 0; i < 6; i++) { ++ for (i = 0; i < priv->num_ports; i++) { + enetsw_writeb(priv, ENETSW_PORTOV_ENABLE_MASK, + ENETSW_PORTOV_REG(i)); + enetsw_writeb(priv, ENETSW_PTCTRL_RXDIS_MASK | +@@ -2303,7 +2303,7 @@ static int bcm_enetsw_open(struct net_de + /* + * apply override config for bypass_link ports here. + */ +- for (i = 0; i < ARRAY_SIZE(priv->used_ports); i++) { ++ for (i = 0; i < priv->num_ports; i++) { + struct bcm63xx_enetsw_port *port; + u8 override; + port = &priv->used_ports[i]; +@@ -2447,7 +2447,7 @@ static int bcm_enetsw_phy_is_external(st + { + int i; + +- for (i = 0; i < (int)ARRAY_SIZE(priv->used_ports); ++i) { ++ for (i = 0; i < priv->num_ports; ++i) { + if (!priv->used_ports[i].used) + continue; + if (priv->used_ports[i].phy_id == phy_id) +@@ -2735,6 +2735,7 @@ static int __devinit bcm_enetsw_probe(st + memcpy(dev->dev_addr, pd->mac_addr, ETH_ALEN); + memcpy(priv->used_ports, pd->used_ports, + sizeof (pd->used_ports)); ++ priv->num_ports = pd->num_ports; + } + + ret = compute_hw_mtu(priv, dev->mtu); +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.h ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.h +@@ -354,6 +354,7 @@ struct bcm_enet_priv { + unsigned int hw_mtu; + + /* port mapping for switch devices */ ++ int num_ports; + struct bcm63xx_enetsw_port used_ports[ENETSW_MAX_PORT]; + int sw_port_link[ENETSW_MAX_PORT]; + diff --git a/target/linux/brcm63xx/patches-3.3/419-bcm63xx_enet-store-is_sw-in-a-variable-instead-of-ch.patch b/target/linux/brcm63xx/patches-3.3/419-bcm63xx_enet-store-is_sw-in-a-variable-instead-of-ch.patch new file mode 100644 index 000000000..6f73477ab --- /dev/null +++ b/target/linux/brcm63xx/patches-3.3/419-bcm63xx_enet-store-is_sw-in-a-variable-instead-of-ch.patch @@ -0,0 +1,73 @@ +From ef581388c45dbc48f7bbe050e87deb1e3c63a698 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski <jonas.gorski@gmail.com> +Date: Tue, 10 Jul 2012 10:52:02 +0200 +Subject: [PATCH 35/84] bcm63xx_enet: store is_sw in a variable instead of checking the cpuid + +Reduces the number of changes needed for making enetsw work on new +chips. +--- + drivers/net/ethernet/broadcom/bcm63xx_enet.c | 7 +++++-- + drivers/net/ethernet/broadcom/bcm63xx_enet.h | 10 ++-------- + 2 files changed, 7 insertions(+), 10 deletions(-) + +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c +@@ -364,7 +364,7 @@ static int bcm_enet_receive_queue(struct + } + + /* recycle packet if it's marked as bad */ +- if (!bcm_enet_is_sw(priv) && ++ if (!priv->enet_is_sw && + unlikely(len_stat & DMADESC_ERR_MASK)) { + dev->stats.rx_errors++; + +@@ -597,7 +597,7 @@ static int bcm_enet_start_xmit(struct sk + } + + /* pad small packets sent on a switch device */ +- if (bcm_enet_is_sw(priv) && skb->len < 64) { ++ if (priv->enet_is_sw && skb->len < 64) { + int needed = 64 - skb->len; + char *data; + +@@ -1700,6 +1700,8 @@ static int __devinit bcm_enet_probe(stru + return -ENOMEM; + priv = netdev_priv(dev); + ++ priv->enet_is_sw = false; ++ + ret = compute_hw_mtu(priv, dev->mtu); + if (ret) + goto out; +@@ -2725,6 +2727,7 @@ static int __devinit bcm_enetsw_probe(st + memset(priv, 0, sizeof(*priv)); + + /* initialize default and fetch platform data */ ++ priv->enet_is_sw = true; + priv->irq_rx = irq_rx; + priv->irq_tx = irq_tx; + priv->rx_ring_size = BCMENET_DEF_RX_DESC; +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.h ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.h +@@ -353,6 +353,8 @@ struct bcm_enet_priv { + /* maximum hardware transmit/receive size */ + unsigned int hw_mtu; + ++ bool enet_is_sw; ++ + /* port mapping for switch devices */ + int num_ports; + struct bcm63xx_enetsw_port used_ports[ENETSW_MAX_PORT]; +@@ -363,12 +365,4 @@ struct bcm_enet_priv { + spinlock_t enetsw_mdio_lock; + }; + +-static inline int bcm_enet_is_sw(struct bcm_enet_priv *priv) +-{ +- if (BCMCPU_IS_6368()) +- return 1; +- else +- return 0; +-} +- + #endif /* ! BCM63XX_ENET_H_ */ diff --git a/target/linux/brcm63xx/patches-3.3/420-BCM63XX-allow-enetsw-without-tx-irq.patch b/target/linux/brcm63xx/patches-3.3/420-BCM63XX-allow-enetsw-without-tx-irq.patch new file mode 100644 index 000000000..6396b626d --- /dev/null +++ b/target/linux/brcm63xx/patches-3.3/420-BCM63XX-allow-enetsw-without-tx-irq.patch @@ -0,0 +1,69 @@ +From 625894c377ba266c0044675b53f05d65db6355b6 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski <jonas.gorski@gmail.com> +Date: Sun, 8 Jul 2012 13:07:52 +0200 +Subject: [PATCH 38/84] BCM63XX: allow enetsw without tx irq + +--- + arch/mips/bcm63xx/dev-enet.c | 2 ++ + drivers/net/ethernet/broadcom/bcm63xx_enet.c | 18 +++++++++++------- + 2 files changed, 13 insertions(+), 7 deletions(-) + +--- a/arch/mips/bcm63xx/dev-enet.c ++++ b/arch/mips/bcm63xx/dev-enet.c +@@ -236,6 +236,8 @@ bcm63xx_enetsw_register(const struct bcm + enetsw_res[0].end += RSET_ENETSW_SIZE - 1; + enetsw_res[1].start = bcm63xx_get_irq_number(IRQ_ENETSW_RXDMA0); + enetsw_res[2].start = bcm63xx_get_irq_number(IRQ_ENETSW_TXDMA0); ++ if (!enetsw_res[2].start) ++ enetsw_res[2].start = -1; + + memcpy(bcm63xx_enetsw_device.dev.platform_data, pd, sizeof (*pd)); + +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c +@@ -2151,10 +2151,12 @@ static int bcm_enetsw_open(struct net_de + if (ret) + goto out_freeirq; + +- ret = request_irq(priv->irq_tx, bcm_enet_isr_dma, +- IRQF_DISABLED, dev->name, dev); +- if (ret) +- goto out_freeirq_rx; ++ if (priv->irq_tx != -1) { ++ ret = request_irq(priv->irq_tx, bcm_enet_isr_dma, ++ IRQF_DISABLED, dev->name, dev); ++ if (ret) ++ goto out_freeirq_rx; ++ } + + /* allocate rx dma ring */ + size = priv->rx_ring_size * sizeof(struct bcm_enet_desc); +@@ -2376,7 +2378,8 @@ out_free_rx_ring: + priv->rx_desc_cpu, priv->rx_desc_dma); + + out_freeirq_tx: +- free_irq(priv->irq_tx, dev); ++ if (priv->irq_tx != -1) ++ free_irq(priv->irq_tx, dev); + + out_freeirq_rx: + free_irq(priv->irq_rx, dev); +@@ -2433,7 +2436,8 @@ static int bcm_enetsw_stop(struct net_de + priv->rx_desc_cpu, priv->rx_desc_dma); + dma_free_coherent(kdev, priv->tx_desc_alloc_size, + priv->tx_desc_cpu, priv->tx_desc_dma); +- free_irq(priv->irq_tx, dev); ++ if (priv->irq_tx != -1) ++ free_irq(priv->irq_tx, dev); + free_irq(priv->irq_rx, dev); + + return 0; +@@ -2716,7 +2720,7 @@ static int __devinit bcm_enetsw_probe(st + res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); + irq_rx = platform_get_irq(pdev, 0); + irq_tx = platform_get_irq(pdev, 1); +- if (!res_mem || irq_rx < 0 || irq_tx < 0) ++ if (!res_mem || irq_rx < 0) + return -ENODEV; + + ret = 0; diff --git a/target/linux/brcm63xx/patches-3.3/421-BCM63XX-use-port-id-for-deciding-external-phy.patch b/target/linux/brcm63xx/patches-3.3/421-BCM63XX-use-port-id-for-deciding-external-phy.patch new file mode 100644 index 000000000..da7013d8f --- /dev/null +++ b/target/linux/brcm63xx/patches-3.3/421-BCM63XX-use-port-id-for-deciding-external-phy.patch @@ -0,0 +1,87 @@ +From 85e4551e033df7cb043e93042661fc1e58799efa Mon Sep 17 00:00:00 2001 +From: Jonas Gorski <jonas.gorski@gmail.com> +Date: Sun, 8 Jul 2012 15:36:23 +0200 +Subject: [PATCH 52/84] BCM63XX: use port id for deciding external phy + +Ports 0-3 always use the internal phy, while 4+ always need an external +phy to work. +--- + .../include/asm/mach-bcm63xx/bcm63xx_dev_enet.h | 3 ++- + drivers/net/ethernet/broadcom/bcm63xx_enet.c | 15 ++++++++------- + drivers/net/ethernet/broadcom/bcm63xx_enet.h | 5 +++++ + 3 files changed, 15 insertions(+), 8 deletions(-) + +--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h ++++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h +@@ -45,9 +45,10 @@ struct bcm63xx_enet_platform_data { + #define ENETSW_MAX_PORT 6 + #define ENETSW_PORTS_6368 6 /* 4 FE PHY + 2 RGMII */ + ++#define ENETSW_RGMII_PORT0 4 ++ + struct bcm63xx_enetsw_port { + int used; +- int external_phy; + int phy_id; + + int bypass_link; +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c +@@ -2046,6 +2046,7 @@ static void swphy_poll_timer(unsigned lo + for (i = 0; i < priv->num_ports; i++) { + struct bcm63xx_enetsw_port *port; + int val, j, up, advertise, lpa, lpa2, speed, duplex, media; ++ int external_phy = bcm_enet_port_is_rgmii(i); + u8 override; + + port = &priv->used_ports[i]; +@@ -2057,7 +2058,7 @@ static void swphy_poll_timer(unsigned lo + + /* dummy read to clear */ + for (j = 0; j < 2; j++) +- val = bcmenet_sw_mdio_read(priv, port->external_phy, ++ val = bcmenet_sw_mdio_read(priv, external_phy, + port->phy_id, MII_BMSR); + + if (val == 0xffff) +@@ -2081,14 +2082,14 @@ static void swphy_poll_timer(unsigned lo + continue; + } + +- advertise = bcmenet_sw_mdio_read(priv, port->external_phy, ++ advertise = bcmenet_sw_mdio_read(priv, external_phy, + port->phy_id, MII_ADVERTISE); + +- lpa = bcmenet_sw_mdio_read(priv, port->external_phy, +- port->phy_id, MII_LPA); ++ lpa = bcmenet_sw_mdio_read(priv, external_phy, port->phy_id, ++ MII_LPA); + +- lpa2 = bcmenet_sw_mdio_read(priv, port->external_phy, +- port->phy_id, MII_STAT1000); ++ lpa2 = bcmenet_sw_mdio_read(priv, external_phy, port->phy_id, ++ MII_STAT1000); + + /* figure out media and duplex from advertise and LPA values */ + media = mii_nway_result(lpa & advertise); +@@ -2457,7 +2458,7 @@ static int bcm_enetsw_phy_is_external(st + if (!priv->used_ports[i].used) + continue; + if (priv->used_ports[i].phy_id == phy_id) +- return priv->used_ports[i].external_phy; ++ return bcm_enet_port_is_rgmii(i); + } + + printk_once(KERN_WARNING "bcm63xx_enet: could not find a used port " +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.h ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.h +@@ -365,4 +365,9 @@ struct bcm_enet_priv { + spinlock_t enetsw_mdio_lock; + }; + ++static inline int bcm_enet_port_is_rgmii(int portid) ++{ ++ return portid >= ENETSW_RGMII_PORT0; ++} ++ + #endif /* ! BCM63XX_ENET_H_ */ diff --git a/target/linux/brcm63xx/patches-3.3/422-bcm63xx_enet-enable-rgmii-clock-on-external-ports.patch b/target/linux/brcm63xx/patches-3.3/422-bcm63xx_enet-enable-rgmii-clock-on-external-ports.patch new file mode 100644 index 000000000..b71e1dc36 --- /dev/null +++ b/target/linux/brcm63xx/patches-3.3/422-bcm63xx_enet-enable-rgmii-clock-on-external-ports.patch @@ -0,0 +1,53 @@ +From d8237d704fc25eb2fc25ef4403608b78c6a6d4be Mon Sep 17 00:00:00 2001 +From: Jonas Gorski <jonas.gorski@gmail.com> +Date: Sun, 15 Jul 2012 20:08:57 +0200 +Subject: [PATCH 54/81] bcm63xx_enet: enable rgmii clock on external ports + +--- + arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h | 13 +++++++++++++ + drivers/net/ethernet/broadcom/bcm63xx_enet.c | 12 ++++++++++++ + 2 files changed, 25 insertions(+), 0 deletions(-) + +--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h ++++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h +@@ -779,6 +779,19 @@ + #define ENETSW_PORTOV_FDX_MASK (1 << 1) + #define ENETSW_PORTOV_LINKUP_MASK (1 << 0) + ++/* Port RGMII control register */ ++#define ENETSW_RGMII_CTRL_REG(x) (0x60 + (x)) ++#define ENETSW_RGMII_CTRL_GMII_CLK_EN (1 << 7) ++#define ENETSW_RGMII_CTRL_MII_OVERRIDE_EN (1 << 6) ++#define ENETSW_RGMII_CTRL_MII_MODE_MASK (3 << 4) ++#define ENETSW_RGMII_CTRL_RGMII_MODE (0 << 4) ++#define ENETSW_RGMII_CTRL_MII_MODE (1 << 4) ++#define ENETSW_RGMII_CTRL_RVMII_MODE (2 << 4) ++#define ENETSW_RGMII_CTRL_TIMING_SEL_EN (1 << 0) ++ ++/* Port RGMII timing register */ ++#define ENETSW_RGMII_TIMING_REG(x) (0x68 + (x)) ++ + /* MDIO control register */ + #define ENETSW_MDIOC_REG (0xb0) + #define ENETSW_MDIOC_EXT_MASK (1 << 16) +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c +@@ -2222,6 +2222,18 @@ static int bcm_enetsw_open(struct net_de + priv->sw_port_link[i] = 0; + } + ++ /* enable external ports */ ++ for (i = ENETSW_RGMII_PORT0; i < priv->num_ports; i++) { ++ u8 rgmii_ctrl; ++ ++ if (!priv->used_ports[i].used) ++ continue; ++ ++ rgmii_ctrl = enetsw_readb(priv, ENETSW_RGMII_CTRL_REG(i)); ++ rgmii_ctrl |= ENETSW_RGMII_CTRL_GMII_CLK_EN; ++ enetsw_writeb(priv, rgmii_ctrl, ENETSW_RGMII_CTRL_REG(i)); ++ } ++ + /* reset mib */ + val = enetsw_readb(priv, ENETSW_GMCR_REG); + val |= ENETSW_GMCR_RST_MIB_MASK; diff --git a/target/linux/brcm63xx/patches-3.3/416-bcm63xx_enet-fix-lockup-on-BCM6328.patch b/target/linux/brcm63xx/patches-3.3/423-bcm63xx_enet-fix-lockup-on-BCM6328.patch index b0f55e086..4306ce753 100644 --- a/target/linux/brcm63xx/patches-3.3/416-bcm63xx_enet-fix-lockup-on-BCM6328.patch +++ b/target/linux/brcm63xx/patches-3.3/423-bcm63xx_enet-fix-lockup-on-BCM6328.patch @@ -1,16 +1,16 @@ -From 37d151859e09d09a950ad3ae615db1903bcc59d3 Mon Sep 17 00:00:00 2001 +From 382a0b0dc4cbd0e0fbfd6c2d132e972c3d1245b0 Mon Sep 17 00:00:00 2001 From: Jonas Gorski <jonas.gorski@gmail.com> Date: Sun, 13 Nov 2011 14:59:37 +0100 -Subject: [PATCH 43/79] bcm63xx_enet: fix lockup on BCM6328 +Subject: [PATCH 39/84] bcm63xx_enet: fix lockup on BCM6328 BCM6328 locks up on a maxburst size of 16, reduce it to 8 for BCM6328 and BCM6368. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> --- - drivers/net/ethernet/broadcom/bcm63xx_enet.c | 14 ++++++++------ + drivers/net/ethernet/broadcom/bcm63xx_enet.c | 13 +++++++------ drivers/net/ethernet/broadcom/bcm63xx_enet.h | 4 ++++ - 2 files changed, 12 insertions(+), 6 deletions(-) + 2 files changed, 11 insertions(+), 6 deletions(-) --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c @@ -43,16 +43,15 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> return 0; } -@@ -1700,6 +1699,8 @@ static int __devinit bcm_enet_probe(stru - return -ENOMEM; +@@ -1701,6 +1700,7 @@ static int __devinit bcm_enet_probe(stru priv = netdev_priv(dev); -+ priv->dma_maxburst = bcm_enet_is_sw(priv) ? -+ BCMENETSW_DMA_MAXBURST : BCMENET_DMA_MAXBURST; + priv->enet_is_sw = false; ++ priv->dma_maxburst = BCMENET_DMA_MAXBURST; + ret = compute_hw_mtu(priv, dev->mtu); if (ret) - goto out; -@@ -2263,9 +2264,9 @@ static int bcm_enetsw_open(struct net_de +@@ -2282,9 +2282,9 @@ static int bcm_enetsw_open(struct net_de enet_dmas_writel(priv, 0, ENETDMAS_SRAM4_REG(priv->tx_chan)); /* set dma maximum burst len */ @@ -64,7 +63,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> ENETDMAC_MAXBURST_REG(priv->tx_chan)); /* set flow control low/high threshold to 1/3 / 2/3 */ -@@ -2727,6 +2728,7 @@ static int __devinit bcm_enetsw_probe(st +@@ -2749,6 +2749,7 @@ static int __devinit bcm_enetsw_probe(st priv->irq_tx = irq_tx; priv->rx_ring_size = BCMENET_DEF_RX_DESC; priv->tx_ring_size = BCMENET_DEF_TX_DESC; diff --git a/target/linux/brcm63xx/patches-3.3/417-MIPS-BCM63XX-add-support-for-BCM6328-in-bcm_enetsw.patch b/target/linux/brcm63xx/patches-3.3/424-MIPS-BCM63XX-add-support-for-BCM6328-in-bcm_enetsw.patch index cf77679d2..e665249c5 100644 --- a/target/linux/brcm63xx/patches-3.3/417-MIPS-BCM63XX-add-support-for-BCM6328-in-bcm_enetsw.patch +++ b/target/linux/brcm63xx/patches-3.3/424-MIPS-BCM63XX-add-support-for-BCM6328-in-bcm_enetsw.patch @@ -1,14 +1,14 @@ -From 44e21f4c7c556573fff0432f7846086763df3455 Mon Sep 17 00:00:00 2001 +From f1c1bfa89cdac76a215d0e21161da9f8f8373437 Mon Sep 17 00:00:00 2001 From: Jonas Gorski <jonas.gorski@gmail.com> Date: Tue, 14 Jun 2011 21:14:39 +0200 -Subject: [PATCH 44/79] MIPS: BCM63XX: add support for BCM6328 in bcm_enetsw +Subject: [PATCH 40/84] MIPS: BCM63XX: add support for BCM6328 in bcm_enetsw Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> --- - arch/mips/bcm63xx/clk.c | 34 +++++++++++++++++++------- - arch/mips/bcm63xx/dev-enet.c | 4 +-- - drivers/net/ethernet/broadcom/bcm63xx_enet.h | 2 +- - 3 files changed, 28 insertions(+), 12 deletions(-) + arch/mips/bcm63xx/clk.c | 34 ++++++++++++++----- + arch/mips/bcm63xx/dev-enet.c | 9 +++-- + .../include/asm/mach-bcm63xx/bcm63xx_dev_enet.h | 1 + + 3 files changed, 32 insertions(+), 12 deletions(-) --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c @@ -79,14 +79,25 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> return -ENODEV; ret = register_shared(); ---- a/drivers/net/ethernet/broadcom/bcm63xx_enet.h -+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.h -@@ -368,7 +368,7 @@ struct bcm_enet_priv { +@@ -241,7 +241,10 @@ bcm63xx_enetsw_register(const struct bcm - static inline int bcm_enet_is_sw(struct bcm_enet_priv *priv) - { -- if (BCMCPU_IS_6368()) -+ if (BCMCPU_IS_6328() || BCMCPU_IS_6368()) - return 1; - else - return 0; + memcpy(bcm63xx_enetsw_device.dev.platform_data, pd, sizeof (*pd)); + +- enetsw_pd.num_ports = ENETSW_PORTS_6368; ++ if (BCMCPU_IS_6328()) ++ enetsw_pd.num_ports = ENETSW_PORTS_6328; ++ else if (BCMCPU_IS_6368()) ++ enetsw_pd.num_ports = ENETSW_PORTS_6368; + + ret = platform_device_register(&bcm63xx_enetsw_device); + if (ret) +--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h ++++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h +@@ -43,6 +43,7 @@ struct bcm63xx_enet_platform_data { + * on board ethernet switch platform data + */ + #define ENETSW_MAX_PORT 6 ++#define ENETSW_PORTS_6328 5 /* 4 FE PHY + 1 RGMII */ + #define ENETSW_PORTS_6368 6 /* 4 FE PHY + 2 RGMII */ + + #define ENETSW_RGMII_PORT0 4 diff --git a/target/linux/brcm63xx/patches-3.3/418-MIPS-BCM63XX-add-HS-SPI-platform-device-and-register.patch b/target/linux/brcm63xx/patches-3.3/425-MIPS-BCM63XX-add-HS-SPI-platform-device-and-register.patch index 5b2534467..5b2534467 100644 --- a/target/linux/brcm63xx/patches-3.3/418-MIPS-BCM63XX-add-HS-SPI-platform-device-and-register.patch +++ b/target/linux/brcm63xx/patches-3.3/425-MIPS-BCM63XX-add-HS-SPI-platform-device-and-register.patch diff --git a/target/linux/brcm63xx/patches-3.3/419-SPI-MIPS-BCM63XX-Add-HS-SPI-driver.patch b/target/linux/brcm63xx/patches-3.3/426-SPI-MIPS-BCM63XX-Add-HS-SPI-driver.patch index 739c2c60f..739c2c60f 100644 --- a/target/linux/brcm63xx/patches-3.3/419-SPI-MIPS-BCM63XX-Add-HS-SPI-driver.patch +++ b/target/linux/brcm63xx/patches-3.3/426-SPI-MIPS-BCM63XX-Add-HS-SPI-driver.patch diff --git a/target/linux/brcm63xx/patches-3.3/420-MIPS-BCM63XX-Register-SPI-flash-if-present.patch b/target/linux/brcm63xx/patches-3.3/427-MIPS-BCM63XX-Register-SPI-flash-if-present.patch index 49bbdf916..f3bf2cd33 100644 --- a/target/linux/brcm63xx/patches-3.3/420-MIPS-BCM63XX-Register-SPI-flash-if-present.patch +++ b/target/linux/brcm63xx/patches-3.3/427-MIPS-BCM63XX-Register-SPI-flash-if-present.patch @@ -92,7 +92,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> #define STRAPBUS_6368_BOOT_SEL_MASK 0x3 #define STRAPBUS_6368_BOOT_SEL_NAND 0 #define STRAPBUS_6368_BOOT_SEL_SERIAL 1 -@@ -1227,6 +1228,7 @@ +@@ -1240,6 +1241,7 @@ #define SERDES_PCIE_EXD_EN (1 << 15) #define MISC_STRAPBUS_6328_REG 0x240 diff --git a/target/linux/brcm63xx/patches-3.3/421-MIPS-BCM63XX-move-nvram-related-functions-into-their.patch b/target/linux/brcm63xx/patches-3.3/428-MIPS-BCM63XX-move-nvram-related-functions-into-their.patch index ff2a831d8..ff2a831d8 100644 --- a/target/linux/brcm63xx/patches-3.3/421-MIPS-BCM63XX-move-nvram-related-functions-into-their.patch +++ b/target/linux/brcm63xx/patches-3.3/428-MIPS-BCM63XX-move-nvram-related-functions-into-their.patch diff --git a/target/linux/brcm63xx/patches-3.3/422-MIPS-BCM63XX-export-PSI-size-from-nvram.patch b/target/linux/brcm63xx/patches-3.3/429-MIPS-BCM63XX-export-PSI-size-from-nvram.patch index 34966b27f..34966b27f 100644 --- a/target/linux/brcm63xx/patches-3.3/422-MIPS-BCM63XX-export-PSI-size-from-nvram.patch +++ b/target/linux/brcm63xx/patches-3.3/429-MIPS-BCM63XX-export-PSI-size-from-nvram.patch diff --git a/target/linux/brcm63xx/patches-3.3/423-MTD-bcm63xxpart-use-nvram-for-PSI-size.patch b/target/linux/brcm63xx/patches-3.3/430-MTD-bcm63xxpart-use-nvram-for-PSI-size.patch index 5ca6f4797..5ca6f4797 100644 --- a/target/linux/brcm63xx/patches-3.3/423-MTD-bcm63xxpart-use-nvram-for-PSI-size.patch +++ b/target/linux/brcm63xx/patches-3.3/430-MTD-bcm63xxpart-use-nvram-for-PSI-size.patch diff --git a/target/linux/brcm63xx/patches-3.3/424-MTD-physmap-allow-passing-pp_data.patch b/target/linux/brcm63xx/patches-3.3/431-MTD-physmap-allow-passing-pp_data.patch index f869911d5..f869911d5 100644 --- a/target/linux/brcm63xx/patches-3.3/424-MTD-physmap-allow-passing-pp_data.patch +++ b/target/linux/brcm63xx/patches-3.3/431-MTD-physmap-allow-passing-pp_data.patch diff --git a/target/linux/brcm63xx/patches-3.3/425-BCM63XX-allow-providing-fixup-data-in-board-data.patch b/target/linux/brcm63xx/patches-3.3/432-BCM63XX-allow-providing-fixup-data-in-board-data.patch index c79c3fe9a..c79c3fe9a 100644 --- a/target/linux/brcm63xx/patches-3.3/425-BCM63XX-allow-providing-fixup-data-in-board-data.patch +++ b/target/linux/brcm63xx/patches-3.3/432-BCM63XX-allow-providing-fixup-data-in-board-data.patch diff --git a/target/linux/brcm63xx/patches-3.3/426-MTD-m25p80-allow-passing-pp_data.patch b/target/linux/brcm63xx/patches-3.3/433-MTD-m25p80-allow-passing-pp_data.patch index bda48079e..bda48079e 100644 --- a/target/linux/brcm63xx/patches-3.3/426-MTD-m25p80-allow-passing-pp_data.patch +++ b/target/linux/brcm63xx/patches-3.3/433-MTD-m25p80-allow-passing-pp_data.patch diff --git a/target/linux/brcm63xx/patches-3.3/427-MIPS-BCM63XX-store-the-flash-type-in-global-variable.patch b/target/linux/brcm63xx/patches-3.3/434-MIPS-BCM63XX-store-the-flash-type-in-global-variable.patch index 6e5cdbe84..6e5cdbe84 100644 --- a/target/linux/brcm63xx/patches-3.3/427-MIPS-BCM63XX-store-the-flash-type-in-global-variable.patch +++ b/target/linux/brcm63xx/patches-3.3/434-MIPS-BCM63XX-store-the-flash-type-in-global-variable.patch diff --git a/target/linux/brcm63xx/patches-3.3/428-BCM63XX-add-a-fixup-for-ath9k-devices.patch b/target/linux/brcm63xx/patches-3.3/435-BCM63XX-add-a-fixup-for-ath9k-devices.patch index a3b30e444..a3b30e444 100644 --- a/target/linux/brcm63xx/patches-3.3/428-BCM63XX-add-a-fixup-for-ath9k-devices.patch +++ b/target/linux/brcm63xx/patches-3.3/435-BCM63XX-add-a-fixup-for-ath9k-devices.patch diff --git a/target/linux/brcm63xx/patches-3.3/429-MTD-bcm63xxpart-allow-passing-a-caldata-offset.patch b/target/linux/brcm63xx/patches-3.3/436-MTD-bcm63xxpart-allow-passing-a-caldata-offset.patch index 681bab248..681bab248 100644 --- a/target/linux/brcm63xx/patches-3.3/429-MTD-bcm63xxpart-allow-passing-a-caldata-offset.patch +++ b/target/linux/brcm63xx/patches-3.3/436-MTD-bcm63xxpart-allow-passing-a-caldata-offset.patch diff --git a/target/linux/brcm63xx/patches-3.3/430-MIPS-BCM63XX-pass-caldata-info-to-flash.patch b/target/linux/brcm63xx/patches-3.3/437-MIPS-BCM63XX-pass-caldata-info-to-flash.patch index 2c7368477..2c7368477 100644 --- a/target/linux/brcm63xx/patches-3.3/430-MIPS-BCM63XX-pass-caldata-info-to-flash.patch +++ b/target/linux/brcm63xx/patches-3.3/437-MIPS-BCM63XX-pass-caldata-info-to-flash.patch diff --git a/target/linux/brcm63xx/patches-3.3/520-bcm63xx-add-support-for-96368MVWG-board.patch b/target/linux/brcm63xx/patches-3.3/520-bcm63xx-add-support-for-96368MVWG-board.patch index d23861ba3..b2b58a19f 100644 --- a/target/linux/brcm63xx/patches-3.3/520-bcm63xx-add-support-for-96368MVWG-board.patch +++ b/target/linux/brcm63xx/patches-3.3/520-bcm63xx-add-support-for-96368MVWG-board.patch @@ -10,7 +10,7 @@ Subject: [PATCH 32/63] bcm63xx: add support for 96368MVWG board. --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -2015,6 +2015,80 @@ static struct board_info __initdata boar +@@ -2015,6 +2015,78 @@ static struct board_info __initdata boar #endif /* @@ -42,14 +42,12 @@ Subject: [PATCH 32/63] bcm63xx: add support for 96368MVWG board. + [4] = { + .used = 1, + .phy_id = 0x12, -+ .external_phy = 1, + .name = "port0", + }, + + [5] = { + .used = 1, + .phy_id = 0x11, -+ .external_phy = 1, + .name = "port3", + }, + }, @@ -91,7 +89,7 @@ Subject: [PATCH 32/63] bcm63xx: add support for 96368MVWG board. * all boards */ static const struct board_info __initdata *bcm963xx_boards[] = { -@@ -2063,6 +2137,10 @@ static const struct board_info __initdat +@@ -2063,6 +2135,10 @@ static const struct board_info __initdat &board_HW553, &board_spw303v, #endif @@ -102,7 +100,7 @@ Subject: [PATCH 32/63] bcm63xx: add support for 96368MVWG board. }; static void __init nb4_nvram_fixup(void) -@@ -2244,12 +2322,25 @@ void __init board_prom_init(void) +@@ -2244,12 +2320,25 @@ void __init board_prom_init(void) bcm63xx_pci_enabled = 1; if (BCMCPU_IS_6348()) val |= GPIO_MODE_6348_G2_PCI; diff --git a/target/linux/brcm63xx/patches-3.3/521-bcm63xx-add-support-for-96368MVNgr-board.patch b/target/linux/brcm63xx/patches-3.3/521-bcm63xx-add-support-for-96368MVNgr-board.patch index 19002f1fd..62f70aa2d 100644 --- a/target/linux/brcm63xx/patches-3.3/521-bcm63xx-add-support-for-96368MVNgr-board.patch +++ b/target/linux/brcm63xx/patches-3.3/521-bcm63xx-add-support-for-96368MVNgr-board.patch @@ -9,7 +9,7 @@ Subject: [PATCH 33/63] bcm63xx: add support for 96368MVNgr board. --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -2086,6 +2086,72 @@ static struct board_info __initdata boar +@@ -2084,6 +2084,72 @@ static struct board_info __initdata boar .has_ohci0 = 1, .has_ehci0 = 1, }; @@ -82,7 +82,7 @@ Subject: [PATCH 33/63] bcm63xx: add support for 96368MVNgr board. #endif /* -@@ -2140,6 +2206,7 @@ static const struct board_info __initdat +@@ -2138,6 +2204,7 @@ static const struct board_info __initdat #ifdef CONFIG_BCM63XX_CPU_6368 &board_96368mvwg, diff --git a/target/linux/brcm63xx/patches-3.3/522-MIPS-BCM63XX-add-96328avng-reference-board.patch b/target/linux/brcm63xx/patches-3.3/522-MIPS-BCM63XX-add-96328avng-reference-board.patch index 29bbf82af..f75e18891 100644 --- a/target/linux/brcm63xx/patches-3.3/522-MIPS-BCM63XX-add-96328avng-reference-board.patch +++ b/target/linux/brcm63xx/patches-3.3/522-MIPS-BCM63XX-add-96328avng-reference-board.patch @@ -90,7 +90,7 @@ Subject: [PATCH] MIPS: BCM63XX: add 96328avng reference board * known 6338 boards */ #ifdef CONFIG_BCM63XX_CPU_6338 -@@ -2158,6 +2232,9 @@ static struct board_info __initdata boar +@@ -2156,6 +2230,9 @@ static struct board_info __initdata boar * all boards */ static const struct board_info __initdata *bcm963xx_boards[] = { diff --git a/target/linux/brcm63xx/patches-3.3/523-MIPS-BCM63XX-add-963281TAN-reference-board.patch b/target/linux/brcm63xx/patches-3.3/523-MIPS-BCM63XX-add-963281TAN-reference-board.patch index 604515b7d..e2970960f 100644 --- a/target/linux/brcm63xx/patches-3.3/523-MIPS-BCM63XX-add-963281TAN-reference-board.patch +++ b/target/linux/brcm63xx/patches-3.3/523-MIPS-BCM63XX-add-963281TAN-reference-board.patch @@ -86,7 +86,7 @@ Subject: [PATCH] MIPS: BCM63XX: add 963281TAN reference board #endif /* -@@ -2234,6 +2304,7 @@ static struct board_info __initdata boar +@@ -2232,6 +2302,7 @@ static struct board_info __initdata boar static const struct board_info __initdata *bcm963xx_boards[] = { #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, diff --git a/target/linux/brcm63xx/patches-3.3/524-board_dsl_274xb_rev_f.patch b/target/linux/brcm63xx/patches-3.3/524-board_dsl_274xb_rev_f.patch index 52b083207..99fcb0f4c 100644 --- a/target/linux/brcm63xx/patches-3.3/524-board_dsl_274xb_rev_f.patch +++ b/target/linux/brcm63xx/patches-3.3/524-board_dsl_274xb_rev_f.patch @@ -120,7 +120,7 @@ Subject: [PATCH 70/79] MIPS: BCM63XX: Add board definition for D-Link #endif /* -@@ -2305,6 +2408,7 @@ static const struct board_info __initdat +@@ -2303,6 +2406,7 @@ static const struct board_info __initdat #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, &board_963281TAN, diff --git a/target/linux/brcm63xx/patches-3.3/525-board_96348w3.patch b/target/linux/brcm63xx/patches-3.3/525-board_96348w3.patch index ffce6fc14..367ec9782 100644 --- a/target/linux/brcm63xx/patches-3.3/525-board_96348w3.patch +++ b/target/linux/brcm63xx/patches-3.3/525-board_96348w3.patch @@ -58,7 +58,7 @@ #endif /* -@@ -2438,6 +2489,7 @@ static const struct board_info __initdat +@@ -2436,6 +2487,7 @@ static const struct board_info __initdat &board_ct536_ct5621, &board_96348A_122, &board_CPVA502plus, diff --git a/target/linux/brcm63xx/patches-3.3/526-board_CT6373-1.patch b/target/linux/brcm63xx/patches-3.3/526-board_CT6373-1.patch index effd9f6d9..50d8535f5 100644 --- a/target/linux/brcm63xx/patches-3.3/526-board_CT6373-1.patch +++ b/target/linux/brcm63xx/patches-3.3/526-board_CT6373-1.patch @@ -126,7 +126,7 @@ static struct board_info __initdata board_HW553 = { .name = "HW553", .expected_cpu_id = 0x6358, -@@ -2504,6 +2616,7 @@ static const struct board_info __initdat +@@ -2502,6 +2614,7 @@ static const struct board_info __initdat &board_nb4_ser_r2, &board_nb4_fxc_r1, &board_nb4_fxc_r2, diff --git a/target/linux/brcm63xx/patches-3.3/527-board_dva-g3810bn-tl-1.patch b/target/linux/brcm63xx/patches-3.3/527-board_dva-g3810bn-tl-1.patch index 034626c8a..6e764e3f7 100644 --- a/target/linux/brcm63xx/patches-3.3/527-board_dva-g3810bn-tl-1.patch +++ b/target/linux/brcm63xx/patches-3.3/527-board_dva-g3810bn-tl-1.patch @@ -72,7 +72,7 @@ #endif /* -@@ -2619,6 +2684,7 @@ static const struct board_info __initdat +@@ -2617,6 +2682,7 @@ static const struct board_info __initdat &board_ct6373_1, &board_HW553, &board_spw303v, diff --git a/target/linux/brcm63xx/patches-3.3/801-ssb_export_fallback_sprom.patch b/target/linux/brcm63xx/patches-3.3/801-ssb_export_fallback_sprom.patch index 5794fa72e..3802cfce5 100644 --- a/target/linux/brcm63xx/patches-3.3/801-ssb_export_fallback_sprom.patch +++ b/target/linux/brcm63xx/patches-3.3/801-ssb_export_fallback_sprom.patch @@ -8,7 +8,7 @@ #include <linux/spi/spi.h> #include <linux/spi/spi_gpio.h> #include <linux/spi/74x164.h> -@@ -2831,7 +2832,7 @@ static void __init nb4_nvram_fixup(void) +@@ -2829,7 +2830,7 @@ static void __init nb4_nvram_fixup(void) * bcm4318 WLAN work */ #ifdef CONFIG_SSB_PCIHOST @@ -17,7 +17,7 @@ .revision = 0x02, .board_rev = 0x17, .country_code = 0x0, -@@ -2851,6 +2852,7 @@ static struct ssb_sprom bcm63xx_sprom = +@@ -2849,6 +2850,7 @@ static struct ssb_sprom bcm63xx_sprom = .boardflags_lo = 0x2848, .boardflags_hi = 0x0000, }; |