cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
cone83
Explorer
Explorer
2,467 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
14 Replies
shabbirk
Moderator
Moderator
2,445 Views
Registered: ‎12-04-2016

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
cone83
Explorer
Explorer
2,443 Views
Registered: ‎04-23-2014

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
shabbirk
Moderator
Moderator
2,436 Views
Registered: ‎12-04-2016

Hi

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

 

Best Regards

Shabbir

0 Kudos
cone83
Explorer
Explorer
2,430 Views
Registered: ‎04-23-2014

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
cone83
Explorer
Explorer
2,397 Views
Registered: ‎04-23-2014

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
shaikanarek
Contributor
Contributor
2,203 Views
Registered: ‎07-29-2018

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

 

Thank you

0 Kudos
shabbirk
Moderator
Moderator
2,178 Views
Registered: ‎12-04-2016

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
shaikanarek
Contributor
Contributor
2,162 Views
Registered: ‎07-29-2018

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
cone83
Explorer
Explorer
2,154 Views
Registered: ‎04-23-2014

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
shabbirk
Moderator
Moderator
2,147 Views
Registered: ‎12-04-2016

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
nvl1109
Adventurer
Adventurer
2,118 Views
Registered: ‎06-14-2018

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
843 Views
Registered: ‎10-19-2019

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

 

ethernet_phy.png

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 :


In: 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 MEXU_OS

ethernet@ff0b0000 Waiting for PHY auto negotiation to complete....... done
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5
BOOTP broadcast 6
BOOTP broadcast 7
BOOTP broadcast 8
BOOTP broadcast 9
BOOTP broadcast 10
BOOTP broadcast 11
BOOTP broadcast 12
BOOTP broadcast 13
BOOTP broadcast 14
BOOTP broadcast 15
BOOTP broadcast 16
BOOTP broadcast 17

 

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 {
   compatible = "cdns,macb-mdio";
   reg = <0x0 0xff0b0000 0x0 0x1000>;
   clocks = <&clk 31>, <&clk 104>, <&clk 45>;
   clock-names = "pclk", "hclk", "tx_clk";
   ethernet_phy3: ethernet-phy@3 {
       reg = <0x3>;
   };
};


};

&gem0 {
status = "okay";
   phy-handle = <&ethernet_phy3>;
};

/* SD1 with level shifter */
&sdhci1 {
no-1-8-v; /* for 1.0 silicon */
};

 

 Any thoughts on that one ?

 

Regards,

 

LB

0 Kudos
shabbirk
Moderator
Moderator
825 Views
Registered: ‎12-04-2016

Hi boutigny.laurent@gmail.com 

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>;
   };

0 Kudos
813 Views
Registered: ‎10-19-2019

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

 

0 Kudos