cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
1,271 Views
Registered: ‎04-23-2014

Linux doesn't detect PHY but U-Boot does

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.

0 Kudos
11 Replies
Highlighted
Moderator
Moderator
1,249 Views
Registered: ‎12-04-2016

Re: Linux doesn't detect PHY but U-Boot does

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

 

0 Kudos
Highlighted
Adventurer
Adventurer
1,247 Views
Registered: ‎04-23-2014

Re: Linux doesn't detect PHY but U-Boot does

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.

 

 

0 Kudos
Highlighted
Moderator
Moderator
1,240 Views
Registered: ‎12-04-2016

Re: Linux doesn't detect PHY but U-Boot does

Hi

In petalinux-config -c kernel, do you have the PHY option enabled?

 

Best Regards

Shabbir

0 Kudos
Highlighted
Adventurer
Adventurer
1,234 Views
Registered: ‎04-23-2014

Re: Linux doesn't detect PHY but U-Boot does

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

 

0 Kudos
Highlighted
Adventurer
Adventurer
1,201 Views
Registered: ‎04-23-2014

Re: Linux doesn't detect PHY but U-Boot does

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

 

0 Kudos
Highlighted
Contributor
Contributor
1,007 Views
Registered: ‎07-29-2018

Re: Linux doesn't detect PHY but U-Boot does

Hi @cone83  , I am facing same problem with Enclustra Mercury+ XU8 , did you solve the problem ?

 

Thank you

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

Re: Linux doesn't detect PHY but U-Boot does

HI @cone83 @shaikanarek 

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

0 Kudos
Highlighted
Contributor
Contributor
966 Views
Registered: ‎07-29-2018

Re: Linux doesn't detect PHY but U-Boot does

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 .

0 Kudos
Highlighted
Adventurer
Adventurer
958 Views
Registered: ‎04-23-2014

Re: Linux doesn't detect PHY but U-Boot does

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.

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

Re: Linux doesn't detect PHY but U-Boot does

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 

0 Kudos
Highlighted
Adventurer
Adventurer
922 Views
Registered: ‎06-14-2018

Re: Linux doesn't detect PHY but U-Boot does

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.

0 Kudos