02-12-2019 03:03 AM
I'm trying to bring up a basic PetaLinux on the Enclustra Mercury+ XU1 board and I can't get Linux to detect the PHY. The board has two Micrel KSZ9031RN PHYs connected to the same MDIO line. I've only enabled one ethernet port at a time to make sure that problems don't result from the shared MDIO.
U-Boot does detect the PHY correctly and it sends out DHCP discover messages on the link (verified with Wireshark). Here's the U-Boot output:
n: serial@ff000000 Out: serial@ff000000 Err: serial@ff000000 Board: Xilinx ZynqMP Bootmode: SD_MODE1 Net: ZYNQ GEM: ff0b0000, phyaddr 3, interface rgmii-id eth0: ethernet@ff0b0000 U-BOOT for petalinux ethernet@ff0b0000 Waiting for PHY auto negotiation to complete............. done BOOTP broadcast 1 BOOTP broadcast 2 BOOTP broadcast 3 ...
Linux, however, seems to not detect the PHY. Here are the important logs:
root@petalinux:~# dmesg | grep -i mac [ 0.000000] Machine model: xlnx,zynqmp [ 2.510220] macb ff0b0000.ethernet: Not enabling partial store and forward [ 2.516893] libphy: MACB_mii_bus: probed
root@petalinux:~# ifconfig -a
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1%4882584/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
sit0 Link encap:IPv6-in-IPv4
NOARP MTU:1480 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
This is the device tree I used:
&gem0 { status = "okay"; phy-handle = <&phy3>; mdio { #address-cells = <1>; #size-cells = <0>; phy3: phy3@3 { device_type = "ethernet-phy"; reg = <3>; }; }; };
I have tried out so many different configurations but none of them have shown any effect. The result is the same for both, gem0 and gem3.
What could be the cause? I am very much at the end of my wits with this.
02-12-2019 04:57 AM
Hi
It seems to that compatible string is missing in the device tree.
As a reference, check this related forum thread
https://forums.xilinx.com/t5/Embedded-Linux/Ethernet-PHY-KSZ9031RNX/td-p/819201
Best Regards
Shabbir
02-12-2019 05:01 AM
I have also came across that post. Apparently that compatiple string posted there is wrong and it should be left out as discussed here:
https://forums.xilinx.com/t5/Embedded-Linux/Micrel-PHY-ksz9031-not-working/m-p/633430
I have also tried it with this and other compatible strings and couldn't get it running.
02-12-2019 05:05 AM
Hi
In petalinux-config -c kernel, do you have the PHY option enabled?
Best Regards
Shabbir
02-12-2019 05:10 AM
The driver is also there:
| Symbol: MICREL_PHY [=y] │ │ Type : tristate │ │ Prompt: Micrel PHYs │ │ Location: │ │ -> Device Drivers │ │ -> Network device support (NETDEVICES [=y]) │ │ (2) -> PHY Device support and infrastructure (PHYLIB [=y]) │ │ Defined at drivers/net/phy/Kconfig:339 │ │ Depends on: NETDEVICES [=y] && PHYLIB [=y]
Also:
root@petalinux:~# zcat /proc/config.gz | grep CONFIG_MICREL_PHY CONFIG_MICREL_PHY=y
02-12-2019 11:18 AM
I think this is probably the same problem as this one, which is yet unsolved:
https://forums.xilinx.com/t5/Embedded-Linux/2018-3-OSL-update/m-p/937572#M31710
06-30-2019 04:47 AM
Hi @cone83 , I am facing same problem with Enclustra Mercury+ XU8 , did you solve the problem ?
Thank you
06-30-2019 10:06 PM
In case of marvel PHY atleast (I have never tried with micrel PHY), we will only keep the phy node with reg = <num> parameter without compatible and ethernet-phy parameters. Could you please try this way once and confirm if that helps in makes any progress
07-01-2019 12:41 AM
Hi
I got only 1 phy to work at address 3 with dtsi as :
&gem0 {
status = "okay";
phy-handle = <&phy3>;
phy3: ethernet-phy@3 {
device_type = "ethernet-phy";
reg = <3>;
} ;
};
second phy @ 7 is held at reset .
07-01-2019 02:14 AM
I believe the issue was that the default Xilinx kernel (at least for 2018.3) cannot handle multiple PHYs on the same MDIO, like it is the case for the Mercury+ SOM. Our solution was to disable one ethernet port. Enclustra is using a different kernel in their linux version which supports this feature.
07-01-2019 02:36 AM
Hi @shaikanarek
As suggested, do not use device_type = "ethernet-phy"; or phy compatible string and use only reg = <> property in phy node.
Since the other ethernet is not coming up, could you please try to bring up independently (one GEM-PHY at a time) and then switch to common MDIO to narrow down board issues if any.
Normally if the PHY is held in reset, try to see if you can fix anything in your HW or PHY driver through some reset pin.
Best Regards
Shabbir
07-02-2019 01:49 AM
Hi,
I think I met the similar case. I use Mercury XU1, Xilinx kernel 2018.3, GEM3 connects to PHY7, GEM0 connect to PL axienet. At the first I can't make PHY up.
Then I found the patch file here https://www.xilinx.com/support/answers/69132.html , this patch file resolved my problem.
Maybe you can give it a try, hope it helps.
11-24-2020 01:10 AM
Hi,
I know this is an old thread but I'm facing the same problem and need some guidance.
I'm also working on a Mercury Boad (XU5) with petalinux 2018.3, I would like to use the ethernet phy which is a KSZ9031RN. From what I read from the schematic, the phy address should be 3. And the operating mode is rgmii-id
Now, just like you guys, I've enabled the Xilinx drivers and Micrel drivers in the kernel config verified with the command :
zcat /proc/config.gz | grep CONFIG_MICREL_PHY
I also applied the patch from xilinx for 2018.3 which helped a little but phy is not detected in linux.
I do have a regnition during the u-boot stage :
ethernet@ff0b0000 Waiting for PHY auto negotiation to complete....... done |
During the driver probe the kernel prompts :
[ 2.308115] macb ff0b0000.ethernet: Not enabling partial store and forward [ 2.314764] macb ff0b0000.ethernet eth0: Cadence GEM rev 0x50070106 at 0xff0b0000 irq 30 (00:0a:35:00) |
Which sounds like to me that the driver tried to probe the first time and failed and retried and succeed.
But, during the configuration phase the kernel prompts :
Configuring network interfaces... [ 4.110859] macb ff0b0000.ethernet eth0: no PHY found |
And finally the eth0 is present when I use the ifconfig -a command but of course, I cannot set any configuration
I'm having doubts on my device tree, I tried to follow the example in the AR69132 :
#include "system-conf.dtsi" mdio {
&gem0 { /* SD1 with level shifter */ |
Any thoughts on that one ?
Regards,
LB
11-24-2020 04:52 AM
Can you try adding these properties in the PHY node of your device tree and see if that helps:
ethernet_phy3: ethernet-phy@3 {
compatible = "micrel,ksz9031";
device_type = "ethernet-phy";
reg = <0x3>;
};
11-24-2020 05:33 AM
HI shabbirk thank you for your response,
I modified the device tree as suggested but it had no effect
I have this thought that maybe there's incompatible network drivers. Maybe I should disable drivers I don't use in the kernel (like intel, marvell and so on)
any suggestion ?
Regards