cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
874 Views
Registered: ‎05-10-2019

Ethernet problems under Petalinux on ZynqMP

We are running Petalinux on a custom board with a Xilinx ZynqMP, and have problems getting Ethernet to work under Linux.

We have two Texas DP83867 PHY:s connected to GEM1 respectively GEM2 by SGMII. There is a separate MDIO bus for each PHY. The PHY for GEM1 is configured to have address 0, and that for GEM2 is configured to have address 1 (as the PHYS are on separate MDIO buses it is probably not necessary to have different addresses, but that is how our board is configured).

We have gotten both Ethernet interfaces to work with a bare metal application (LWIP echo server), and with U-boot, and are able to boot Linux on the board through either Ethernet interface.

When the Linux kernel starts, we can see the following messages among the terminal output:

macb ff0c0000.ethernet: Not enabling partial store and forward

libphy: MACB_mii_bus: probed

macb ff0c0000.ethernet eth1: no PHY found.

macb ff0d0000.ethernet: Not enabling partial store and forward

libphy: MACB_mii_bus: probed

macb ff0d0000.ethernet eth1: no PHY found.

It seem that for some reason the Linux Ethernet driver is not able to find the PHY:s. That is strange as Ethernet works fine under U-boot.

Below are our device tree entries for the GEM:s in system-user.dtsi. We have tried different configurations for GEM1 and 2. The more simple one used for GEM2 works fine with U-boot. When Ethernet failed to work under Linux we tried to add a mdio node for GEM1, but it did not make any difference.

&gem1 {

                status = "okay";

                phy-handle = <&phy0>;

                phy-mode = "sgmii";

                is-internal-pcspma;

               

                mdio {

                                #address-cells = <1>;

                                #size-cells = <0>;

                                phy0: phy@0 {

                                                compatible = "ti,dp83867";

                                                device_type = "ethernet-phy";

                                                reg = <0>;

                                };

                };

};

 

&gem2 {

                status = "okay";

                phy-handle = <&phy1>;

                phy-mode = "sgmii";

                is-internal-pcspma;

                phy1: phy@1 {

                   compatible = "ti,dp83867";

                                reg = <1>;

                };

};

Does anybody have an idea what could be wrong?

Regards,
Kaj

0 Kudos
4 Replies
Highlighted
Moderator
Moderator
860 Views
Registered: ‎12-04-2016

Hi Kaj

Try enabling MDIO support in the linux by applying the patch attached in this AR

https://www.xilinx.com/support/answers/69132.html

Highlighted
813 Views
Registered: ‎05-10-2019

Thanks for the advice!

We tried applying the patch, but it did not make things much better. The output at startup was slightly changed, but the Ethernet driver could still not find the PHY:s

As we only have one PHY for each MAC, we decided to go back to the code before the patch, in order to not complicate things more than necessary.

After adding some debug prints to the Linux Ethernet driver code, we were able to figure out what was wrong.

In our device tree, a line “ti,fifo-depth = <1>;” was missing for the PHY-nodes. This did not cause problem with U-boot, but Linux does not work without it.

Below is our current device tree entries for the Ethernet interface, which works fine for both U-boot and Linux:

&gem1 {

                status = "okay";

                phy-handle = <&phy0>;

                phy-mode = "sgmii";

                is-internal-pcspma;

               phy0: phy@0 {

                                reg = <0>;

                                ti,fifo-depth = <1>;

                };

};

&gem2 {

status = "okay";

                phy-handle = <&phy1>;

                phy-mode = "sgmii";

                is-internal-pcspma;

                phy1: phy@1 {

                                reg = <1>;

                                ti,fifo-depth = <1>;

                };

};

Regards,
Kaj

0 Kudos
Highlighted
Moderator
Moderator
805 Views
Registered: ‎12-04-2016

Hi Kaj

Can you also try adding Tx & Rx delays to phy node

ti,rx-internal-delay = <0x8>;

ti,tx-internal-delay = <0xa>;

0 Kudos
Highlighted
799 Views
Registered: ‎05-10-2019

As far as I have understood things, the Tx & Rx delays are not needed in SGMII mode, so in order to keep our device tree as simple as possible, I have not added these. It seems to work fine without them.

Regards,
Kaj

0 Kudos