summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2016-02-24 22:43:43 +0000
committerRafał Miłecki <zajec5@gmail.com>2016-02-24 22:43:43 +0000
commit9e9617a864c2dcb886ca8cd1b1e009e8841c8e8b (patch)
treeacbbc2867a734a77bb6ffcc30ba2cf542c47ab18
parent319863f60e7fdd170bcd15720a5bc2d18dbe2cbc (diff)
downloadmtk-20170518-9e9617a864c2dcb886ca8cd1b1e009e8841c8e8b.zip
mtk-20170518-9e9617a864c2dcb886ca8cd1b1e009e8841c8e8b.tar.gz
mtk-20170518-9e9617a864c2dcb886ca8cd1b1e009e8841c8e8b.tar.bz2
kernel: replace bgmac patches for BCM47094 with final ones
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 48756
-rw-r--r--target/linux/generic/patches-4.4/070-bgmac-add-helper-checking-for-BCM4707-BCM53018-chip-.patch (renamed from target/linux/generic/patches-4.4/770-bgmac-add-helper-checking-for-BCM4707-BCM53018-chip-.patch)21
-rw-r--r--target/linux/generic/patches-4.4/071-bgmac-support-Ethernet-device-on-BCM47094-SoC.patch39
-rw-r--r--target/linux/generic/patches-4.4/072-14-bgmac-reset-all-4-GMAC-cores-on-init.patch2
-rw-r--r--target/linux/generic/patches-4.4/771-bgmac-support-Ethernet-device-on-BCM47094-SoC.patch30
-rw-r--r--target/linux/generic/patches-4.4/773-bgmac-add-srab-switch.patch6
5 files changed, 57 insertions, 41 deletions
diff --git a/target/linux/generic/patches-4.4/770-bgmac-add-helper-checking-for-BCM4707-BCM53018-chip-.patch b/target/linux/generic/patches-4.4/070-bgmac-add-helper-checking-for-BCM4707-BCM53018-chip-.patch
index e5d439e..63010c1 100644
--- a/target/linux/generic/patches-4.4/770-bgmac-add-helper-checking-for-BCM4707-BCM53018-chip-.patch
+++ b/target/linux/generic/patches-4.4/070-bgmac-add-helper-checking-for-BCM4707-BCM53018-chip-.patch
@@ -1,6 +1,6 @@
-From 1b49522dc7154751401512977d07ad01e5182c47 Mon Sep 17 00:00:00 2001
+From 387b75f8b31437792e8334390fdf5cf060d1e3da Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
-Date: Sat, 30 Jan 2016 00:35:37 +0100
+Date: Tue, 2 Feb 2016 07:47:14 +0100
Subject: [PATCH] bgmac: add helper checking for BCM4707 / BCM53018 chip id
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@@ -11,9 +11,10 @@ places in the code. It's likely there will be more IDs to check in the
future. To simplify it add this trivial helper.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
---
- drivers/net/ethernet/broadcom/bgmac.c | 29 ++++++++++++++++-------------
- 1 file changed, 16 insertions(+), 13 deletions(-)
+ drivers/net/ethernet/broadcom/bgmac.c | 30 ++++++++++++++++--------------
+ 1 file changed, 16 insertions(+), 14 deletions(-)
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -69,7 +70,13 @@ Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
rxq_ctl = bgmac_read(bgmac, BGMAC_RXQ_CTL);
rxq_ctl &= ~BGMAC_RXQ_CTL_MDP_MASK;
bp_clk = bcma_pmu_get_bus_clock(&bgmac->core->bus->drv_cc) /
-@@ -1473,8 +1479,7 @@ static int bgmac_mii_register(struct bgm
+@@ -1467,14 +1473,12 @@ static int bgmac_fixed_phy_register(stru
+
+ static int bgmac_mii_register(struct bgmac *bgmac)
+ {
+- struct bcma_chipinfo *ci = &bgmac->core->bus->chipinfo;
+ struct mii_bus *mii_bus;
+ struct phy_device *phy_dev;
char bus_id[MII_BUS_ID_SIZE + 3];
int i, err = 0;
@@ -79,7 +86,7 @@ Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
return bgmac_fixed_phy_register(bgmac);
mii_bus = mdiobus_alloc();
-@@ -1545,7 +1550,6 @@ static void bgmac_mii_unregister(struct
+@@ -1545,7 +1549,6 @@ static void bgmac_mii_unregister(struct
/* http://bcm-v4.sipsolutions.net/mac-gbit/gmac/chipattach */
static int bgmac_probe(struct bcma_device *core)
{
@@ -87,7 +94,7 @@ Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
struct net_device *net_dev;
struct bgmac *bgmac;
struct ssb_sprom *sprom = &core->bus->sprom;
-@@ -1626,8 +1630,7 @@ static int bgmac_probe(struct bcma_devic
+@@ -1626,8 +1629,7 @@ static int bgmac_probe(struct bcma_devic
bgmac_chip_reset(bgmac);
/* For Northstar, we have to take all GMAC core out of reset */
diff --git a/target/linux/generic/patches-4.4/071-bgmac-support-Ethernet-device-on-BCM47094-SoC.patch b/target/linux/generic/patches-4.4/071-bgmac-support-Ethernet-device-on-BCM47094-SoC.patch
new file mode 100644
index 0000000..88db7b2
--- /dev/null
+++ b/target/linux/generic/patches-4.4/071-bgmac-support-Ethernet-device-on-BCM47094-SoC.patch
@@ -0,0 +1,39 @@
+From 9e4e6206c67ae11d68fc96882256f37c237087d4 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
+Date: Mon, 22 Feb 2016 22:51:13 +0100
+Subject: [PATCH] bgmac: support Ethernet device on BCM47094 SoC
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It needs very similar workarounds to the one on BCM4707. It was tested
+on D-Link DIR-885L home router.
+
+Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/ethernet/broadcom/bgmac.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/ethernet/broadcom/bgmac.c
++++ b/drivers/net/ethernet/broadcom/bgmac.c
+@@ -30,6 +30,7 @@ static inline bool bgmac_is_bcm4707_fami
+ {
+ switch (bgmac->core->bus->chipinfo.id) {
+ case BCMA_CHIP_ID_BCM4707:
++ case BCMA_CHIP_ID_BCM47094:
+ case BCMA_CHIP_ID_BCM53018:
+ return true;
+ default:
+@@ -1047,8 +1048,9 @@ static void bgmac_chip_reset(struct bgma
+ (ci->id == BCMA_CHIP_ID_BCM53572 && ci->pkg == BCMA_PKG_ID_BCM47188))
+ iost &= ~BGMAC_BCMA_IOST_ATTACHED;
+
+- /* 3GMAC: for BCM4707, only do core reset at bgmac_probe() */
+- if (ci->id != BCMA_CHIP_ID_BCM4707) {
++ /* 3GMAC: for BCM4707 & BCM47094, only do core reset at bgmac_probe() */
++ if (ci->id != BCMA_CHIP_ID_BCM4707 &&
++ ci->id != BCMA_CHIP_ID_BCM47094) {
+ flags = 0;
+ if (iost & BGMAC_BCMA_IOST_ATTACHED) {
+ flags = BGMAC_BCMA_IOCTL_SW_CLKEN;
diff --git a/target/linux/generic/patches-4.4/072-14-bgmac-reset-all-4-GMAC-cores-on-init.patch b/target/linux/generic/patches-4.4/072-14-bgmac-reset-all-4-GMAC-cores-on-init.patch
index 4d6981e..2dcd6c4 100644
--- a/target/linux/generic/patches-4.4/072-14-bgmac-reset-all-4-GMAC-cores-on-init.patch
+++ b/target/linux/generic/patches-4.4/072-14-bgmac-reset-all-4-GMAC-cores-on-init.patch
@@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau <nbd@openwrt.org>
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
-@@ -1641,8 +1641,11 @@ static int bgmac_probe(struct bcma_devic
+@@ -1645,8 +1645,11 @@ static int bgmac_probe(struct bcma_devic
ns_core = bcma_find_core_unit(core->bus,
BCMA_CORE_MAC_GBIT,
ns_gmac);
diff --git a/target/linux/generic/patches-4.4/771-bgmac-support-Ethernet-device-on-BCM47094-SoC.patch b/target/linux/generic/patches-4.4/771-bgmac-support-Ethernet-device-on-BCM47094-SoC.patch
deleted file mode 100644
index f359220..0000000
--- a/target/linux/generic/patches-4.4/771-bgmac-support-Ethernet-device-on-BCM47094-SoC.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 64a1905f49391e41e660dd5d079e2c61d5344920 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
-Date: Sat, 30 Jan 2016 14:05:37 +0100
-Subject: [PATCH] bgmac: support Ethernet device on BCM47094 SoC
-
-It needs very similar workarounds to the one on BCM4707.
----
- drivers/net/ethernet/broadcom/bgmac.c | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
---- a/drivers/net/ethernet/broadcom/bgmac.c
-+++ b/drivers/net/ethernet/broadcom/bgmac.c
-@@ -30,6 +30,7 @@ static inline bool bgmac_is_bcm4707_fami
- {
- switch (bgmac->core->bus->chipinfo.id) {
- case BCMA_CHIP_ID_BCM4707:
-+ case BCMA_CHIP_ID_BCM47094:
- case BCMA_CHIP_ID_BCM53018:
- return true;
- default:
-@@ -1048,7 +1049,8 @@ static void bgmac_chip_reset(struct bgma
- iost &= ~BGMAC_BCMA_IOST_ATTACHED;
-
- /* 3GMAC: for BCM4707, only do core reset at bgmac_probe() */
-- if (ci->id != BCMA_CHIP_ID_BCM4707) {
-+ if (ci->id != BCMA_CHIP_ID_BCM4707 &&
-+ ci->id != BCMA_CHIP_ID_BCM47094) {
- flags = 0;
- if (iost & BGMAC_BCMA_IOST_ATTACHED) {
- flags = BGMAC_BCMA_IOCTL_SW_CLKEN;
diff --git a/target/linux/generic/patches-4.4/773-bgmac-add-srab-switch.patch b/target/linux/generic/patches-4.4/773-bgmac-add-srab-switch.patch
index 29bbf1a..46f01d0 100644
--- a/target/linux/generic/patches-4.4/773-bgmac-add-srab-switch.patch
+++ b/target/linux/generic/patches-4.4/773-bgmac-add-srab-switch.patch
@@ -12,7 +12,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
#include <linux/bcm47xx_nvram.h>
static const struct bcma_device_id bgmac_bcma_tbl[] = {
-@@ -1545,6 +1546,17 @@ static void bgmac_mii_unregister(struct
+@@ -1544,6 +1545,17 @@ static void bgmac_mii_unregister(struct
mdiobus_free(mii_bus);
}
@@ -30,7 +30,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
/**************************************************
* BCMA bus ops
**************************************************/
-@@ -1687,6 +1699,14 @@ static int bgmac_probe(struct bcma_devic
+@@ -1686,6 +1698,14 @@ static int bgmac_probe(struct bcma_devic
net_dev->hw_features = net_dev->features;
net_dev->vlan_features = net_dev->features;
@@ -45,7 +45,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
err = register_netdev(bgmac->net_dev);
if (err) {
bgmac_err(bgmac, "Cannot register net device\n");
-@@ -1713,6 +1733,10 @@ static void bgmac_remove(struct bcma_dev
+@@ -1712,6 +1732,10 @@ static void bgmac_remove(struct bcma_dev
{
struct bgmac *bgmac = bcma_get_drvdata(core);