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

OpenWrt Bugs openwrt-bugs at lists.openwrt.org
Sun Nov 29 06:29:02 EST 2020


THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

A new Flyspray task has been opened.  Details are below. 

User who did this - Bluse-Blue (Bluse) 

Attached to Project - OpenWrt/LEDE Project
Summary - ath79: Ethernet broken on 2-port TPLink CPE510v1
Task Type - Bug Report
Category - Base system
Status - Unconfirmed
Assigned To - 
Operating System - All
Severity - Low
Priority - Very Low
Reported Version - Trunk
Due in Version - Undecided
Due Date - Undecided
Details - **//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] [] show_stack+0x30/0x100
[    1.227290] [] __warn+0xc0/0x10c
[    1.231465] [] warn_slowpath_fmt+0x5c/0xac
[    1.236530] [] __reset_control_get_internal+0x15c/0x190
[    1.242731] [] __of_reset_control_get+0x140/0x1fc
[    1.248406] [] __devm_reset_control_get+0x70/0x108
[    1.254191] [] ag71xx_mdio_probe+0xbc/0x208
[    1.259357] [] platform_drv_probe+0x40/0x94
[    1.264503] [] really_probe+0x104/0x358
[    1.269297] [] bus_for_each_drv+0x70/0xb0
[    1.274269] [] __device_attach+0x114/0x150
[    1.279329] [] bus_probe_device+0x9c/0xb8
[    1.284301] [] device_add+0x3e4/0x608
[    1.288926] [] of_platform_device_create_pdata+0xa8/0x150
[    1.295301] [] of_platform_bus_create+0x134/0x224
[    1.300977] [] of_platform_populate+0x78/0xec
[    1.306309] [] ag71xx_probe+0x844/0xb80
[    1.311111] [] platform_drv_probe+0x40/0x94
[    1.316254] [] really_probe+0x104/0x358
[    1.321050] [] device_driver_attach+0x70/0x98
[    1.326374] [] __driver_attach+0x60/0x100
[    1.331346] [] bus_for_each_dev+0x68/0xa4
[    1.336317] [] bus_add_driver+0x1f0/0x200
[    1.341291] [] driver_register+0x84/0x148
[    1.346271] [] ag71xx_module_init+0x2c/0x50
[    1.351418] [] do_one_initcall+0x7c/0x1dc
[    1.356395] [] kernel_init_freeable+0x158/0x23c
[    1.361906] [] kernel_init+0x10/0xf0
[    1.366435] [] 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:

&eth1 {
        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 = ;
};

&eth0 {
       status = "okay";

       phy-handle = ;

       mtd-mac-address = ;
};

&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 = ;

       mtd-mac-address = ;
};

&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 = , ;
       reset-names = "mac", "mdio";


 

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

Greetings Thomas

More information can be found at the following URL:
https://bugs.openwrt.org/index.php?do=details&task_id=3481

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.



More information about the openwrt-bugs mailing list