kernel: use upstream fixes for bgmac and BCM4709(4)
authorRafał Miłecki <zajec5@gmail.com>
Fri, 15 Apr 2016 10:11:31 +0000 (10:11 +0000)
committerRafał Miłecki <zajec5@gmail.com>
Fri, 15 Apr 2016 10:11:31 +0000 (10:11 +0000)
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
SVN-Revision: 49167

target/linux/generic/patches-3.18/077-13-bgmac-fix-MAC-soft-reset-bit-for-corerev-4.patch [deleted file]
target/linux/generic/patches-3.18/077-14-bgmac-reset-all-4-GMAC-cores-on-init.patch [deleted file]
target/linux/generic/patches-3.18/078-bgmac-reset-enable-Ethernet-core-before-using-it.patch [new file with mode: 0644]
target/linux/generic/patches-3.18/079-bgmac-fix-MAC-soft-reset-bit-for-corerev-4.patch [new file with mode: 0644]
target/linux/generic/patches-4.4/072-13-bgmac-fix-MAC-soft-reset-bit-for-corerev-4.patch [deleted file]
target/linux/generic/patches-4.4/072-14-bgmac-reset-all-4-GMAC-cores-on-init.patch [deleted file]
target/linux/generic/patches-4.4/072-bgmac-reset-enable-Ethernet-core-before-using-it.patch [new file with mode: 0644]
target/linux/generic/patches-4.4/073-bgmac-fix-MAC-soft-reset-bit-for-corerev-4.patch [new file with mode: 0644]

diff --git a/target/linux/generic/patches-3.18/077-13-bgmac-fix-MAC-soft-reset-bit-for-corerev-4.patch b/target/linux/generic/patches-3.18/077-13-bgmac-fix-MAC-soft-reset-bit-for-corerev-4.patch
deleted file mode 100644 (file)
index a3d9fd6..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-From: Felix Fietkau <nbd@openwrt.org>
-Date: Mon, 13 Apr 2015 15:54:04 +0200
-Subject: [PATCH] bgmac: fix MAC soft-reset bit for corerev > 4
-
-Only core revisions older than 4 use BGMAC_CMDCFG_SR_REV0
-
-Signed-off-by: Felix Fietkau <nbd@openwrt.org>
----
-
---- a/drivers/net/ethernet/broadcom/bgmac.h
-+++ b/drivers/net/ethernet/broadcom/bgmac.h
-@@ -198,9 +198,9 @@
- #define  BGMAC_CMDCFG_TAI                     0x00000200
- #define  BGMAC_CMDCFG_HD                      0x00000400      /* Set if in half duplex mode */
- #define  BGMAC_CMDCFG_HD_SHIFT                        10
--#define  BGMAC_CMDCFG_SR_REV0                 0x00000800      /* Set to reset mode, for other revs */
--#define  BGMAC_CMDCFG_SR_REV4                 0x00002000      /* Set to reset mode, only for core rev 4 */
--#define  BGMAC_CMDCFG_SR(rev)  ((rev == 4) ? BGMAC_CMDCFG_SR_REV4 : BGMAC_CMDCFG_SR_REV0)
-+#define  BGMAC_CMDCFG_SR_REV0                 0x00000800      /* Set to reset mode, for core rev 0-3 */
-+#define  BGMAC_CMDCFG_SR_REV4                 0x00002000      /* Set to reset mode, for core rev >= 4 */
-+#define  BGMAC_CMDCFG_SR(rev)  ((rev >= 4) ? BGMAC_CMDCFG_SR_REV4 : BGMAC_CMDCFG_SR_REV0)
- #define  BGMAC_CMDCFG_ML                      0x00008000      /* Set to activate mac loopback mode */
- #define  BGMAC_CMDCFG_AE                      0x00400000
- #define  BGMAC_CMDCFG_CFE                     0x00800000
diff --git a/target/linux/generic/patches-3.18/077-14-bgmac-reset-all-4-GMAC-cores-on-init.patch b/target/linux/generic/patches-3.18/077-14-bgmac-reset-all-4-GMAC-cores-on-init.patch
deleted file mode 100644 (file)
index 2a913a6..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-From: Felix Fietkau <nbd@openwrt.org>
-Date: Mon, 13 Apr 2015 15:56:26 +0200
-Subject: [PATCH] bgmac: reset all 4 GMAC cores on init
-
-On a BCM4709 based device, I found that GMAC cores may be enabled at
-probe time, but only become usable after a full reset.
-Disable cores before re-enabling them to ensure that they are properly
-reset.
-
-Signed-off-by: Felix Fietkau <nbd@openwrt.org>
----
-
---- a/drivers/net/ethernet/broadcom/bgmac.c
-+++ b/drivers/net/ethernet/broadcom/bgmac.c
-@@ -1623,8 +1623,11 @@ static int bgmac_probe(struct bcma_devic
-                       ns_core = bcma_find_core_unit(core->bus,
-                                                     BCMA_CORE_MAC_GBIT,
-                                                     ns_gmac);
--                      if (ns_core && !bcma_core_is_enabled(ns_core))
--                              bcma_core_enable(ns_core, 0);
-+                      if (!ns_core)
-+                              continue;
-+
-+                      bcma_core_disable(ns_core, 0);
-+                      bcma_core_enable(ns_core, 0);
-               }
-       }
diff --git a/target/linux/generic/patches-3.18/078-bgmac-reset-enable-Ethernet-core-before-using-it.patch b/target/linux/generic/patches-3.18/078-bgmac-reset-enable-Ethernet-core-before-using-it.patch
new file mode 100644 (file)
index 0000000..4626502
--- /dev/null
@@ -0,0 +1,31 @@
+From b4dfd8e92956b396d3438212bc9a0be6267b8b34 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
+Date: Tue, 12 Apr 2016 13:30:45 +0200
+Subject: [PATCH] bgmac: reset & enable Ethernet core before using it
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This fixes Ethernet on D-Link DIR-885L with BCM47094 SoC. Felix reported
+similar fix was needed for his BCM4709 device (Buffalo WXR-1900DHP?).
+I tested this for regressions on BCM4706, BCM4708A0 and BCM47081A0.
+
+Cc: Felix Fietkau <nbd@openwrt.org>
+Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+
+--- a/drivers/net/ethernet/broadcom/bgmac.c
++++ b/drivers/net/ethernet/broadcom/bgmac.c
+@@ -1564,6 +1564,11 @@ static int bgmac_probe(struct bcma_devic
+               dev_warn(&core->dev, "Using random MAC: %pM\n", mac);
+       }
++      /* This (reset &) enable is not preset in specs or reference driver but
++       * Broadcom does it in arch PCI code when enabling fake PCI device.
++       */
++      bcma_core_enable(core, 0);
++
+       /* Allocation and references */
+       net_dev = alloc_etherdev(sizeof(*bgmac));
+       if (!net_dev)
diff --git a/target/linux/generic/patches-3.18/079-bgmac-fix-MAC-soft-reset-bit-for-corerev-4.patch b/target/linux/generic/patches-3.18/079-bgmac-fix-MAC-soft-reset-bit-for-corerev-4.patch
new file mode 100644 (file)
index 0000000..6fa4eb0
--- /dev/null
@@ -0,0 +1,34 @@
+From c02bc350f9dbce7d637c394a6e1c4d29dc5b28b2 Mon Sep 17 00:00:00 2001
+From: Felix Fietkau <nbd@openwrt.org>
+Date: Tue, 12 Apr 2016 18:27:29 +0200
+Subject: [PATCH] bgmac: fix MAC soft-reset bit for corerev > 4
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Only core revisions older than 4 use BGMAC_CMDCFG_SR_REV0. This mainly
+fixes support for BCM4708A0KF SoCs with Ethernet core rev 5 (it means
+only some devices as most of BCM4708A0KF-s got core rev 4).
+This was tested for regressions on BCM47094 which doesn't seem to care
+which bit gets used.
+
+Signed-off-by: Felix Fietkau <nbd@openwrt.org>
+Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+
+--- a/drivers/net/ethernet/broadcom/bgmac.h
++++ b/drivers/net/ethernet/broadcom/bgmac.h
+@@ -198,9 +198,9 @@
+ #define  BGMAC_CMDCFG_TAI                     0x00000200
+ #define  BGMAC_CMDCFG_HD                      0x00000400      /* Set if in half duplex mode */
+ #define  BGMAC_CMDCFG_HD_SHIFT                        10
+-#define  BGMAC_CMDCFG_SR_REV0                 0x00000800      /* Set to reset mode, for other revs */
+-#define  BGMAC_CMDCFG_SR_REV4                 0x00002000      /* Set to reset mode, only for core rev 4 */
+-#define  BGMAC_CMDCFG_SR(rev)  ((rev == 4) ? BGMAC_CMDCFG_SR_REV4 : BGMAC_CMDCFG_SR_REV0)
++#define  BGMAC_CMDCFG_SR_REV0                 0x00000800      /* Set to reset mode, for core rev 0-3 */
++#define  BGMAC_CMDCFG_SR_REV4                 0x00002000      /* Set to reset mode, for core rev >= 4 */
++#define  BGMAC_CMDCFG_SR(rev)  ((rev >= 4) ? BGMAC_CMDCFG_SR_REV4 : BGMAC_CMDCFG_SR_REV0)
+ #define  BGMAC_CMDCFG_ML                      0x00008000      /* Set to activate mac loopback mode */
+ #define  BGMAC_CMDCFG_AE                      0x00400000
+ #define  BGMAC_CMDCFG_CFE                     0x00800000
diff --git a/target/linux/generic/patches-4.4/072-13-bgmac-fix-MAC-soft-reset-bit-for-corerev-4.patch b/target/linux/generic/patches-4.4/072-13-bgmac-fix-MAC-soft-reset-bit-for-corerev-4.patch
deleted file mode 100644 (file)
index 82cf6de..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-From: Felix Fietkau <nbd@openwrt.org>
-Date: Mon, 13 Apr 2015 15:54:04 +0200
-Subject: [PATCH] bgmac: fix MAC soft-reset bit for corerev > 4
-
-Only core revisions older than 4 use BGMAC_CMDCFG_SR_REV0
-
-Signed-off-by: Felix Fietkau <nbd@openwrt.org>
----
-
---- a/drivers/net/ethernet/broadcom/bgmac.h
-+++ b/drivers/net/ethernet/broadcom/bgmac.h
-@@ -199,9 +199,9 @@
- #define  BGMAC_CMDCFG_TAI                     0x00000200
- #define  BGMAC_CMDCFG_HD                      0x00000400      /* Set if in half duplex mode */
- #define  BGMAC_CMDCFG_HD_SHIFT                        10
--#define  BGMAC_CMDCFG_SR_REV0                 0x00000800      /* Set to reset mode, for other revs */
--#define  BGMAC_CMDCFG_SR_REV4                 0x00002000      /* Set to reset mode, only for core rev 4 */
--#define  BGMAC_CMDCFG_SR(rev)  ((rev == 4) ? BGMAC_CMDCFG_SR_REV4 : BGMAC_CMDCFG_SR_REV0)
-+#define  BGMAC_CMDCFG_SR_REV0                 0x00000800      /* Set to reset mode, for core rev 0-3 */
-+#define  BGMAC_CMDCFG_SR_REV4                 0x00002000      /* Set to reset mode, for core rev >= 4 */
-+#define  BGMAC_CMDCFG_SR(rev)  ((rev >= 4) ? BGMAC_CMDCFG_SR_REV4 : BGMAC_CMDCFG_SR_REV0)
- #define  BGMAC_CMDCFG_ML                      0x00008000      /* Set to activate mac loopback mode */
- #define  BGMAC_CMDCFG_AE                      0x00400000
- #define  BGMAC_CMDCFG_CFE                     0x00800000
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
deleted file mode 100644 (file)
index 2dcd6c4..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-From: Felix Fietkau <nbd@openwrt.org>
-Date: Mon, 13 Apr 2015 15:56:26 +0200
-Subject: [PATCH] bgmac: reset all 4 GMAC cores on init
-
-On a BCM4709 based device, I found that GMAC cores may be enabled at
-probe time, but only become usable after a full reset.
-Disable cores before re-enabling them to ensure that they are properly
-reset.
-
-Signed-off-by: Felix Fietkau <nbd@openwrt.org>
----
-
---- a/drivers/net/ethernet/broadcom/bgmac.c
-+++ b/drivers/net/ethernet/broadcom/bgmac.c
-@@ -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);
--                      if (ns_core && !bcma_core_is_enabled(ns_core))
--                              bcma_core_enable(ns_core, 0);
-+                      if (!ns_core)
-+                              continue;
-+
-+                      bcma_core_disable(ns_core, 0);
-+                      bcma_core_enable(ns_core, 0);
-               }
-       }
diff --git a/target/linux/generic/patches-4.4/072-bgmac-reset-enable-Ethernet-core-before-using-it.patch b/target/linux/generic/patches-4.4/072-bgmac-reset-enable-Ethernet-core-before-using-it.patch
new file mode 100644 (file)
index 0000000..d643b18
--- /dev/null
@@ -0,0 +1,31 @@
+From b4dfd8e92956b396d3438212bc9a0be6267b8b34 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
+Date: Tue, 12 Apr 2016 13:30:45 +0200
+Subject: [PATCH] bgmac: reset & enable Ethernet core before using it
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This fixes Ethernet on D-Link DIR-885L with BCM47094 SoC. Felix reported
+similar fix was needed for his BCM4709 device (Buffalo WXR-1900DHP?).
+I tested this for regressions on BCM4706, BCM4708A0 and BCM47081A0.
+
+Cc: Felix Fietkau <nbd@openwrt.org>
+Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+
+--- a/drivers/net/ethernet/broadcom/bgmac.c
++++ b/drivers/net/ethernet/broadcom/bgmac.c
+@@ -1578,6 +1578,11 @@ static int bgmac_probe(struct bcma_devic
+               dev_warn(&core->dev, "Using random MAC: %pM\n", mac);
+       }
++      /* This (reset &) enable is not preset in specs or reference driver but
++       * Broadcom does it in arch PCI code when enabling fake PCI device.
++       */
++      bcma_core_enable(core, 0);
++
+       /* Allocation and references */
+       net_dev = alloc_etherdev(sizeof(*bgmac));
+       if (!net_dev)
diff --git a/target/linux/generic/patches-4.4/073-bgmac-fix-MAC-soft-reset-bit-for-corerev-4.patch b/target/linux/generic/patches-4.4/073-bgmac-fix-MAC-soft-reset-bit-for-corerev-4.patch
new file mode 100644 (file)
index 0000000..0dd1a3d
--- /dev/null
@@ -0,0 +1,34 @@
+From c02bc350f9dbce7d637c394a6e1c4d29dc5b28b2 Mon Sep 17 00:00:00 2001
+From: Felix Fietkau <nbd@openwrt.org>
+Date: Tue, 12 Apr 2016 18:27:29 +0200
+Subject: [PATCH] bgmac: fix MAC soft-reset bit for corerev > 4
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Only core revisions older than 4 use BGMAC_CMDCFG_SR_REV0. This mainly
+fixes support for BCM4708A0KF SoCs with Ethernet core rev 5 (it means
+only some devices as most of BCM4708A0KF-s got core rev 4).
+This was tested for regressions on BCM47094 which doesn't seem to care
+which bit gets used.
+
+Signed-off-by: Felix Fietkau <nbd@openwrt.org>
+Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+
+--- a/drivers/net/ethernet/broadcom/bgmac.h
++++ b/drivers/net/ethernet/broadcom/bgmac.h
+@@ -199,9 +199,9 @@
+ #define  BGMAC_CMDCFG_TAI                     0x00000200
+ #define  BGMAC_CMDCFG_HD                      0x00000400      /* Set if in half duplex mode */
+ #define  BGMAC_CMDCFG_HD_SHIFT                        10
+-#define  BGMAC_CMDCFG_SR_REV0                 0x00000800      /* Set to reset mode, for other revs */
+-#define  BGMAC_CMDCFG_SR_REV4                 0x00002000      /* Set to reset mode, only for core rev 4 */
+-#define  BGMAC_CMDCFG_SR(rev)  ((rev == 4) ? BGMAC_CMDCFG_SR_REV4 : BGMAC_CMDCFG_SR_REV0)
++#define  BGMAC_CMDCFG_SR_REV0                 0x00000800      /* Set to reset mode, for core rev 0-3 */
++#define  BGMAC_CMDCFG_SR_REV4                 0x00002000      /* Set to reset mode, for core rev >= 4 */
++#define  BGMAC_CMDCFG_SR(rev)  ((rev >= 4) ? BGMAC_CMDCFG_SR_REV4 : BGMAC_CMDCFG_SR_REV0)
+ #define  BGMAC_CMDCFG_ML                      0x00008000      /* Set to activate mac loopback mode */
+ #define  BGMAC_CMDCFG_AE                      0x00400000
+ #define  BGMAC_CMDCFG_CFE                     0x00800000