Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#3481 - ath79: Ethernet broken on 2-port TPLink CPE510v1 #8353

Closed
openwrt-bot opened this issue Nov 29, 2020 · 5 comments
Closed

FS#3481 - ath79: Ethernet broken on 2-port TPLink CPE510v1 #8353

openwrt-bot opened this issue Nov 29, 2020 · 5 comments
Labels

Comments

@openwrt-bot
Copy link

openwrt-bot commented Nov 29, 2020

Bluse:

//Problem Description://
After flashing a current ath79 image for TPlink CPE510v1, the two Ethernet ports are not working anymore, not packets got received. Wifi at least is working.

Error Message at Bootlog:

[ 0.415265] 2 fixed-partitions partitions found on MTD device firmware
[ 0.421941] Creating 2 MTD partitions on "firmware":
[ 0.427011] 0x000000000000-0x000000200000 : "kernel"
[ 0.433201] 0x000000200000-0x000000780000 : "rootfs"
[ 0.439499] mtd: device 5 (rootfs) set to be root filesystem
[ 0.452457] 1 squashfs-split partitions found on MTD device rootfs
[ 0.458817] 0x000000640000-0x000000780000 : "rootfs_data"
[ 0.465484] 0x0000007c0000-0x0000007f0000 : "config"
[ 0.471823] 0x0000007f0000-0x000000800000 : "art"
[ 0.480303] libphy: Fixed MDIO Bus: probed
[ 0.824003] ag71xx 19000000.eth: Could not connect to PHY device. Deferring probe.
[ 1.148538] ------------[ cut here ]------------
[ 1.153321] WARNING: CPU: 0 PID: 1 at drivers/reset/core.c:556 __reset_control_get_internal+0x15c/0x190
[ 1.162863] Modules linked in:
[ 1.165984] CPU: 0 PID: 1 Comm: swapper Not tainted 5.4.80 #0
[ 1.171825] random: fast init done
[ 1.175284] Stack : 80660000 805fe838 00000000 00000000 805fda08 83c27954 83c282fc 80635ce3
[ 1.183789] 8059eb04 00000001 807932d8 00000001 00000000 00000001 83c27908 c3d7d522
[ 1.192284] 00000000 00000000 807c0000 00000057 00000065 00000000 61737420 696e6974
[ 1.200776] 00000057 503dded4 00000000 00029f31 00000000 00000009 00000000 802e816c
[ 1.209267] 00000009 00000001 00000000 83c7da10 00000001 802ff474 00000000 80790000
[ 1.217759] ...
[ 1.220251] Call Trace:
[ 1.222758] [<80069934>] show_stack+0x30/0x100
[ 1.227290] [<800825e0>] __warn+0xc0/0x10c
[ 1.231465] [<80082688>] warn_slowpath_fmt+0x5c/0xac
[ 1.236530] [<802e816c>] __reset_control_get_internal+0x15c/0x190
[ 1.242731] [<802e82e0>] __of_reset_control_get+0x140/0x1fc
[ 1.248406] [<802e8668>] __devm_reset_control_get+0x70/0x108
[ 1.254191] [<803653c4>] ag71xx_mdio_probe+0xbc/0x208
[ 1.259357] [<80312e6c>] platform_drv_probe+0x40/0x94
[ 1.264503] [<80310fc0>] really_probe+0x104/0x358
[ 1.269297] [<8030f078>] bus_for_each_drv+0x70/0xb0
[ 1.274269] [<80310e78>] __device_attach+0x114/0x150
[ 1.279329] [<8030ffb0>] bus_probe_device+0x9c/0xb8
[ 1.284301] [<8030d384>] device_add+0x3e4/0x608
[ 1.288926] [<8037a860>] of_platform_device_create_pdata+0xa8/0x150
[ 1.295301] [<8037aa48>] of_platform_bus_create+0x134/0x224
[ 1.300977] [<8037acb4>] of_platform_populate+0x78/0xec
[ 1.306309] [<80367a60>] ag71xx_probe+0x844/0xb80
[ 1.311111] [<80312e6c>] platform_drv_probe+0x40/0x94
[ 1.316254] [<80310fc0>] really_probe+0x104/0x358
[ 1.321050] [<80311708>] device_driver_attach+0x70/0x98
[ 1.326374] [<80311790>] __driver_attach+0x60/0x100
[ 1.331346] [<8030efb8>] bus_for_each_dev+0x68/0xa4
[ 1.336317] [<80310324>] bus_add_driver+0x1f0/0x200
[ 1.341291] [<80311dfc>] driver_register+0x84/0x148
[ 1.346271] [<80672c4c>] ag71xx_module_init+0x2c/0x50
[ 1.351418] [<80060a1c>] do_one_initcall+0x7c/0x1dc
[ 1.356395] [<8065ee10>] kernel_init_freeable+0x158/0x23c
[ 1.361906] [<8050f7b8>] kernel_init+0x10/0xf0
[ 1.366435] [<80064d98>] ret_from_kernel_thread+0x14/0x1c
[ 1.371942] ---[ end trace 04b3a00f9b5f3375 ]---
[ 1.377060] libphy: ag71xx_mdio: probed
[ 1.382296] libphy: ar8xxx-mdio: probed
[ 1.394549] switch0: Atheros AR8229 rev. 1 switch registered on mdio.0
[ 1.440715] ag71xx 1a000000.eth: connected to PHY at fixed-0:00 [uid=00000000, driver=Generic PHY]
[ 1.450649] eth0: Atheros AG71xx at 0xba000000, irq 5, mode: gmii

//Hardware Version://
TPLink CPE510 v1

//Software versions of OpenWrt://
-local build of latest trunk OpenWrt SNAPSHOT, r15101
-latest Snapshot image from OpenWrt Download

//Steps to reproduce//
Flash current ath79 image to CPE510v1 and check Ethernet via ifconfig .. no rx packets.

//Workaround//
Roll-back to ar71xx for the time been the Ethernet is broken.

  • Before downgrading from ath79 to ar71xx over-the-air you need to migrate the config by hand before sysupgrade!

  • wifi radio path in /etc/config/wireless needs to be changed from ath79 style: option path 'platform/ahb/18100000.wmac' to ar71xx style: option path 'platform/ar934x_wmac'

//Troubleshooting//

  • use GDB to find the function where the dmesg error points to and the mdio probing brakes reset
(gdb) l *0x803653c4 0x803653c4 is in ag71xx_mdio_probe (./include/linux/of.h:1177). 1172 * Returns true if the property exists false otherwise. 1173 */ 1174 static inline bool of_property_read_bool(const struct device_node *np, 1175 const char *propname) 1176 { 1177 struct property *prop = of_find_property(np, propname, NULL); 1178 1179 return prop ? true : false; 1180 } 1181 (gdb) l *803653c4 Invalid number "803653c4". (gdb) l *0x80367a60 0x80367a60 is in ag71xx_probe (drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c:1714). 1709 * following code checks OF_POPULATED_BUS flag before populating 1710 * to avoid duplicated population. 1711 */ 1712 if (!of_node_check_flag(np, OF_POPULATED_BUS)) { 1713 err = of_platform_populate(np, NULL, NULL, &pdev->dev); 1714 if (err) 1715 return err; 1716 } 1717 1718 err = ag71xx_phy_connect(ag);
  • the function in is ./drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c and there is a comment about loading mdio1 before gmac0 by adding simplke-mdf compatible to gmac mode:
1593 /* 1594 * populate current node to register mdio-bus as a subdevice. 1595 * the mdio bus works independently on ar7241 and later chips 1596 * and we need to load mdio1 before gmac0, which can be done 1597 * by adding a "simple-mfd" compatible to gmac node. The 1598 * following code checks OF_POPULATED_BUS flag before populating 1599 * to avoid duplicated population. 1600 */ 1601 if (!of_node_check_flag(np, OF_POPULATED_BUS)) { 1602 err = of_platform_populate(np, NULL, NULL, &pdev->dev); 1603 if (err) 1604 return err; 1605 }
  • check dst definitions for CPE510v1 and compare to cpe510v2 & v3, as those 1-port devices have a working Ethernet with ath79
  • cpe510v2/v3 use "simple-mfd" in target/linux/ath79/dts/ar9344_tplink_cpe_1port.dtsi:
ð1 { compatible = "syscon", "simple-mfd"; };
  • cpe510v1 uses no "simple-mfd" but a gmac config ... the ethernet dst config seems suspicious
  • as I do not have good dst knowledge yet, I chaned some dts parts and got ethernet back working on both ports but the boot error persists and the eth0 and eth1 are mixed up ... but maybe that is a hint for someone with proper dst knowhow:
iff --git a/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi b/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi ndex 07c3fc052662..572a00bf4628 100644 -- a/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi ++ b/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi @ -103,14 +103,6 @@ mtd-mac-address = <&info 0x8>; };

&eth0 {
status = "okay";

   phy-handle = <&swphy4>;

   mtd-mac-address = <&info 0x8>;

};

&eth1 {
status = "okay";
};
iff --git a/target/linux/ath79/dts/ar9344_tplink_cpe_1port.dtsi b/target/linux/ath79/dts/ar9344_tplink_cpe_1port.dtsi
ndex a1dca810936f..df41270c23af 100644
-- a/target/linux/ath79/dts/ar9344_tplink_cpe_1port.dtsi
++ b/target/linux/ath79/dts/ar9344_tplink_cpe_1port.dtsi
@ -40,6 +40,14 @@
};
};

&eth0 {
status = "okay";

   phy-handle = <&swphy4>;

   mtd-mac-address = <&info 0x8>;

};

&eth1 {
compatible = "syscon", "simple-mfd";
};
iff --git a/target/linux/ath79/dts/ar934x.dtsi b/target/linux/ath79/dts/ar934x.dtsi
ndex b1339ab36a7f..c32d6a3b66fe 100644
-- a/target/linux/ath79/dts/ar934x.dtsi
++ b/target/linux/ath79/dts/ar934x.dtsi
@ -270,7 +270,7 @@
};

&eth1 {
compatible = "qca,ar9340-eth", "syscon";
compatible = "qca,ar9340-eth", "syscon", "simple-mfd";

   resets = <&rst 13>, <&rst 23>;
   reset-names = "mac", "mdio";

Let me know if I can help to fix this problem.

Greetings Thomas

@openwrt-bot
Copy link
Author

openwrt-bot commented Nov 29, 2020

Bluse:

thx to Lynxis for the troubleshooting session last night:

he pointed out, that the ar9344 data sheet know several modes to configure PHYs, current dts configure it as switch only mode.

@openwrt-bot
Copy link
Author

openwrt-bot commented Nov 29, 2020

Bluse:

the code I have pasted in the ticket for testing some dts changes had a c&p prob, the first letter was missing .. here is our testing code which brings ethernet back working but is not yet proper in terms of naming and wanrings:

diff --git a/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi b/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi index 07c3fc052662..572a00bf4628 100644 --- a/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi +++ b/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi @@ -103,14 +103,6 @@ mtd-mac-address = <&info 0x8>; };

-&eth0 {

  •   status = "okay";
    
  •   phy-handle = <&swphy4>;
    
  •   mtd-mac-address = <&info 0x8>;
    

-};

&eth1 {
status = "okay";
};
diff --git a/target/linux/ath79/dts/ar9344_tplink_cpe_1port.dtsi b/target/linux/ath79/dts/ar9344_tplink_cpe_1port.dtsi
index a1dca810936f..df41270c23af 100644
--- a/target/linux/ath79/dts/ar9344_tplink_cpe_1port.dtsi
+++ b/target/linux/ath79/dts/ar9344_tplink_cpe_1port.dtsi
@@ -40,6 +40,14 @@
};
};

+&eth0 {

  •   status = "okay";
    
  •   phy-handle = <&swphy4>;
    
  •   mtd-mac-address = <&info 0x8>;
    

+};
+
&eth1 {
compatible = "syscon", "simple-mfd";
};
diff --git a/target/linux/ath79/dts/ar934x.dtsi b/target/linux/ath79/dts/ar934x.dtsi
index b1339ab36a7f..c32d6a3b66fe 100644
--- a/target/linux/ath79/dts/ar934x.dtsi
+++ b/target/linux/ath79/dts/ar934x.dtsi
@@ -270,7 +270,7 @@
};

&eth1 {

  •   compatible = "qca,ar9340-eth", "syscon";
    
  •   compatible = "qca,ar9340-eth", "syscon", "simple-mfd";
    
      resets = <&rst 13>, <&rst 23>;
      reset-names = "mac", "mdio";
    

@openwrt-bot
Copy link
Author

openwrt-bot commented Nov 29, 2020

Bluse:

The datasheet for the ar9344 shows at page 61 the switchmode and phy connecting options: https://datasheetspdf.com/pdf-file/825113/Atheros/AR9344/1

@openwrt-bot
Copy link
Author

openwrt-bot commented Nov 29, 2020

Bluse:

There is a fix for ethernet on UBNT nanobeam ac with ar9342 .. maybe related for this issue ?

[[https://github.com/openwrt/openwrt/commit/50a76208bcce98977615d8048f7655aa2f49cf38#diff-9563614f2282fc7e7941bfecf262904fbe896ef6be7b715b102058ac81e4ab62|ar9342 fix UBNT]]

@openwrt-bot
Copy link
Author

openwrt-bot commented Dec 1, 2020

Bluse:

Finaly got it working and with my troubleshooting I was on a wrong track assuming Ethernet on CLE510 dual port devices is broken:
The combination of the bootl log error (which is just a warning that blocktrron fixed here https://forum.openwrt.org/t/ath79-tplink-cpe510-v1-ethernet-not-working/80635/3) and the fact that network uci syntax from ar71xx to ath79 changed form swconfig to plain eth0 & eth1 has trigger my wroing assumtion that Ethernet is broken. But that is not the case, with blocktrrons patch pllayed the boot log warning about the reset is gone and Ethernet works with the current UCI syntax for ath79.
I am closing this ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant