aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@gmail.com>2018-09-22 00:38:41 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2018-09-29 17:23:11 +0200
commit64756a9a30d556e3d949123bde099c66a5d627f8 (patch)
tree8081369e3853608d2e34fdffd29afe567bcc61d9 /target
parent641dc50164d30d4962499e1974fafde9b337faaf (diff)
downloadupstream-64756a9a30d556e3d949123bde099c66a5d627f8.tar.gz
upstream-64756a9a30d556e3d949123bde099c66a5d627f8.tar.bz2
upstream-64756a9a30d556e3d949123bde099c66a5d627f8.zip
apm821xx: net: emac: fix fixed-link setup for the RTL8363SB switch
On the Netgear WNDAP620, the emac ethernet isn't receiving nor xmitting any frames from/to the RTL8363SB (identifies itself as a RTL8367RB). This is caused by hardware not knowing the right forced link settings (speed, duplex, pause, etc.) settings. Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Diffstat (limited to 'target')
-rw-r--r--target/linux/apm821xx/patches-4.14/050-net-emac-fix-fixed-link-setup-for-the-RTL8363SB-swit.patch48
-rw-r--r--target/linux/apm821xx/patches-4.14/701-powerpc_ibm_apm82181_phyclk_fix.patch2
2 files changed, 49 insertions, 1 deletions
diff --git a/target/linux/apm821xx/patches-4.14/050-net-emac-fix-fixed-link-setup-for-the-RTL8363SB-swit.patch b/target/linux/apm821xx/patches-4.14/050-net-emac-fix-fixed-link-setup-for-the-RTL8363SB-swit.patch
new file mode 100644
index 0000000000..05e29f963e
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/050-net-emac-fix-fixed-link-setup-for-the-RTL8363SB-swit.patch
@@ -0,0 +1,48 @@
+From 08e39982ef64f800fd1f9b9b92968d14d5fafa82 Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey@gmail.com>
+Date: Mon, 17 Sep 2018 17:22:40 +0200
+Subject: net: emac: fix fixed-link setup for the RTL8363SB switch
+
+On the Netgear WNDAP620, the emac ethernet isn't receiving nor
+xmitting any frames from/to the RTL8363SB (identifies itself
+as a RTL8367RB).
+
+This is caused by the emac hardware not knowing the forced link
+parameters for speed, duplex, pause, etc.
+
+This begs the question, how this was working on the original
+driver code, when it was necessary to set the phy_address and
+phy_map to 0xffffffff. But I guess without access to the old
+PPC405/440/460 hardware, it's not possible to know.
+
+Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/ethernet/ibm/emac/core.c | 15 ++++++++++-----
+ 1 file changed, 10 insertions(+), 5 deletions(-)
+
+--- a/drivers/net/ethernet/ibm/emac/core.c
++++ b/drivers/net/ethernet/ibm/emac/core.c
+@@ -2671,12 +2671,17 @@ static int emac_init_phy(struct emac_ins
+ if (of_phy_is_fixed_link(np)) {
+ int res = emac_dt_mdio_probe(dev);
+
+- if (!res) {
+- res = of_phy_register_fixed_link(np);
+- if (res)
+- mdiobus_unregister(dev->mii_bus);
++ if (res)
++ return res;
++
++ res = of_phy_register_fixed_link(np);
++ dev->phy_dev = of_phy_find_device(np);
++ if (res || !dev->phy_dev) {
++ mdiobus_unregister(dev->mii_bus);
++ return res ? res : -EINVAL;
+ }
+- return res;
++ emac_adjust_link(dev->ndev);
++ put_device(&dev->phy_dev->mdio.dev);
+ }
+ return 0;
+ }
diff --git a/target/linux/apm821xx/patches-4.14/701-powerpc_ibm_apm82181_phyclk_fix.patch b/target/linux/apm821xx/patches-4.14/701-powerpc_ibm_apm82181_phyclk_fix.patch
index 7f630a3c2a..ced284ee3b 100644
--- a/target/linux/apm821xx/patches-4.14/701-powerpc_ibm_apm82181_phyclk_fix.patch
+++ b/target/linux/apm821xx/patches-4.14/701-powerpc_ibm_apm82181_phyclk_fix.patch
@@ -30,7 +30,7 @@
#endif
}
-@@ -2879,6 +2888,7 @@ static int emac_init_config(struct emac_
+@@ -2884,6 +2893,7 @@ static int emac_init_config(struct emac_
if (of_device_is_compatible(np, "ibm,emac-apm821xx")) {
dev->features |= (EMAC_APM821XX_REQ_JUMBO_FRAME_SIZE |
EMAC_FTR_APM821XX_NO_HALF_DUPLEX |