Lantiq etop PHY-less with 88E6161 DSA switch : no network

Hello,

I am trying to get network working on Lantiq Danube based device. The ethernet device uses the etop driver. I had to patch it to avoid the mdio bus unregister when there is no PHY found. The switch device 88E6161 is plugged directly on the mdio bus without PHY.

When the switch was initialized by the proprietary bootloader, and if I have only the etop driver without switch driver, i am able to ping hosts (as the network interface appears as eth0).

If I add the DSA switch driver, it detects and initialize the switch, I have five network PHYs, when I plug an ethernet cable I can see the corresponding network interface coming up, but there is no network traffic.

Here is the DTS part I am using :

&gsw {
        phy-mode = "mii";
        mtd-mac-address = <&boardconfig 0x428>;
        ethport: ethernet-port@0 {
                /* Hardwired to DSA switch */
                fixed-link {
                        speed = <1000>;
                        full-duplex;
                };
        };

        mdio-bus {
                #address-cells = <1>;
                #size-cells = <0>;

                switch: switch@0 {
                        compatible = "marvell,mv88e6085";
                        reg = <0>;
                        #interrupt-cells = <2>;
                        #size-cells = <0>;
                        dsa,member = <0 0>;

                        ports {
                                #address-cells = <1>;
                                #size-cells = <0>;

                                port@0 {
                                        reg = <0>;
                                        label = "lan1";
                                        phy-handle = <&lan1phy>;
                                };

                                port@1 {
                                        reg = <1>;
                                        label = "lan2";
                                        phy-handle = <&lan2phy>;
                                };

                                port@2 {
                                        reg = <2>;
                                        label = "lan3";
                                        phy-handle = <&lan3phy>;
                                };

                                port@3 {
                                        reg = <3>;
                                        label = "lan4";
                                        phy-handle = <&lan4phy>;
                                };

                                port@4 {
                                        reg = <4>;
                                        label = "lan5";
                                        phy-handle = <&lan5phy>;
                                };

                                port@5 {
                                        reg = <5>;
                                       label = "cpu";
                                        ethernet = <&gsw>;
                                };
                        };

                        mdio {
                                #address-cells = <1>;
                                #size-cells = <0>;

                                lan1phy: ethernet-phy@0 {
                                        /* Marvell 88E1121R (port 1) */
                                        compatible = "ethernet-phy-id0141.0cb0",
                                        "ethernet-phy-ieee802.3-c22";
                                        reg = <0>;
                                        marvell,reg-init = <3 16 0 0x1777 3 17 0 0x16>;
                                };
                                lan2phy: ethernet-phy@1 {
                                        /* Marvell 88E1121R (port 1) */
                                        compatible = "ethernet-phy-id0141.0cb0",
                                        "ethernet-phy-ieee802.3-c22";
                                        reg = <1>;
                                        marvell,reg-init = <3 16 0 0x1777 3 17 0 0x15>;
                                };
                               lan3phy: ethernet-phy@2 {
                                        /* Marvell 88E1121R (port 1) */
                                        compatible = "ethernet-phy-id0141.0cb0",
                                        "ethernet-phy-ieee802.3-c22";
                                        reg = <2>;
                                        marvell,reg-init = <3 16 0 0x1777 3 17 0 0x15>;
                                };
                                lan4phy: ethernet-phy@3 {
                                        /* Marvell 88E1121R (port 1) */
                                        compatible = "ethernet-phy-id0141.0cb0",
                                        "ethernet-phy-ieee802.3-c22";
                                        reg = <3>;
                                        marvell,reg-init = <3 16 0 0x1777 3 17 0 0x15>;
                                };
                                lan5phy: ethernet-phy@4 {
                                        /* Marvell 88E1121R (port 1) */
                                        compatible = "ethernet-phy-id0141.0cb0",
                                        "ethernet-phy-ieee802.3-c22";
                                        reg = <4>;
                                        marvell,reg-init = <3 16 0 0x1777 3 17 0 0x15>;
                                };
                        };
                };
        };
};

And here is the boot log :

[    0.731055] libphy: Fixed MDIO Bus: probed
[    0.739845] libphy: ltq_mii: probed
[    0.743774] mv88e6085 1e180000.etop-ffffffff:00: switch 0x1610 detected: Marvell 88E6161, revision 3
[    0.782121] libphy: mdio: probed
[    0.831342] ltq_etop 1e180000.etop eth0 (uninitialized): no PHY found
[    0.840540] wdt 1f8803f0.watchdog: Init done
[    0.854650] NET: Registered protocol family 10
[    0.870004] Segment Routing with IPv6
[    0.873622] NET: Registered protocol family 17
[    0.878889] DSA: debugfs interface created
[    0.882834] 8021q: 802.1Q VLAN Support v1.8
[    0.896855] mv88e6085 1e180000.etop-ffffffff:00: switch 0x1610 detected: Marvell 88E6161, revision 3
[    0.912699] libphy: mdio: probed
[    1.089830] random: fast init done
[    1.213945] mv88e6085 1e180000.etop-ffffffff:00 lan1 (uninitialized): PHY [!fpi@10000000!etop@e180000!mdio-bus!switch@0!mdio:01] driver [Marvell 88E1121R]
[    1.333952] mv88e6085 1e180000.etop-ffffffff:00 lan2 (uninitialized): PHY [!fpi@10000000!etop@e180000!mdio-bus!switch@0!mdio:00] driver [Marvell 88E1121R]
[    1.452324] mv88e6085 1e180000.etop-ffffffff:00 lan3 (uninitialized): PHY [!fpi@10000000!etop@e180000!mdio-bus!switch@0!mdio:02] driver [Marvell 88E1121R]
[    1.572322] mv88e6085 1e180000.etop-ffffffff:00 lan4 (uninitialized): PHY [!fpi@10000000!etop@e180000!mdio-bus!switch@0!mdio:03] driver [Marvell 88E1121R]
[    1.693956] mv88e6085 1e180000.etop-ffffffff:00 lan5 (uninitialized): PHY [!fpi@10000000!etop@e180000!mdio-bus!switch@0!mdio:04] driver [Marvell 88E1121R]
[    1.714288] DSA: tree 0 setup

So when I plus a cable, I can see this :

root@OpenWrt:/# [  509.066027] mv88e6085 1e180000.etop-ffffffff:00 lan1: Link is Up - 1Gbps/Full - flow control rx/tx

Then ethtool reports informations :

root@OpenWrt:/# ethtool lan1
Settings for lan1:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
                                1000baseT/Full 
        Supported pause frame use: Symmetric
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
                                1000baseT/Full 
        Advertised pause frame use: Symmetric
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Link partner advertised link modes:  10baseT/Half 10baseT/Full 
                                             100baseT/Half 100baseT/Full 
                                             1000baseT/Full 
        Link partner advertised pause frame use: Symmetric Receive-only
        Link partner advertised auto-negotiation: Yes
        Link partner advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: d
        Wake-on: d
        Link detected: yes

What can I do to find the root cause of packets drops ?

Thx for reading.

Most likely RX/TX delays.
There are bindings for PHYs to introduce them

Hi,

Yes its the phy-mode binding with modes mii, rgmii, rdmii-id etc

I will try each and keep you updated.

May I add it only on cpu port ?

Thanks.

I tried many settings combinations without success. I will continue and try to make captures with Wireshark / tcpdump.

I will bring an oscilloscope to see if there is anything on busses.

Hello,

I tried every phy-modes without any success.

I finally found a way to get it working, I have to force a 100M fixed link on the CPU port :

port@5 {
                                        reg = <5>;
                                        label = "cpu";
                                        ethernet = <&gsw>;
                                        phy-mode = "sgmii";
                                        fixed-link {
                                                speed = <100>;
                                                full-duplex;
                                        };
                                };

But, I guess I can't obtain gigabit speed with this setting. So I hope it can helps to find the issue.

Any idea ?

1 Like

Hello,

I reply to myself, after reading the PSB50712E Datasheet, it seems the mii-bus can only handle 100M ethernet speed, even if the 88E6161 is a Gbit switch.

So it's normal I can't achieve a Gbit speed on the cpu port :slight_smile:

Regards,

Sebastian.

1 Like

Well that was a excellent design choice

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.