UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor
Contributor
263 Views
Registered: ‎09-20-2017

Use MDIO clause 45 on Zynq

We have a custom FMC card with an Marvell 88Q2112 Single Pair Ethernet Phy, which is configurable via MDIO. Unlike most phy only understands clause 45 MDIO.

I build my Image with Yocto and already tried several Kernels 4.14 and 4.19. Xilinx-Rebase in both cases. I read that MDIO clause 45 has to be supported by the MDIO driver and the mac driver, that's why i tried to apply a patch for supporting Clause 45 in macb driver. (https://lore.kernel.org/patchwork/project/lkml/list/?submitter=25241).

Are there any other points I'll have to check?

The phy is connected to ethernet1 via the gmii2rgmii IP from xilinx. However, I don't even know if this IP is able to handle Clause 45 MDIO communication correctly, because the IP is on the same bus.

I tried several variants of the devicetree, always with the compatible = "ethernet-phy-ieee802.3-c45". I tried to put the phy node directly into the ethernet node and to create a seperate mdio bus, together with the gmii2rgmii IP. 

I'm looking forward for every suggestion!

Best Regards
Franz

0 Kudos
3 Replies
Contributor
Contributor
151 Views
Registered: ‎09-01-2017

Re: Use MDIO clause 45 on Zynq

@franzforstmayr did you ever solve this? We are just starting  a new development with a similar Marvell phy (88x3310) and are having trouble accessing the phy, we observed only clause 22 formatted frames being sent by the ultrascale+ through the pcs/pma IP core and the kernel always registers either a "Generic PHY" or a "Generic 10G PHY" when probing the bus (will report 10G when using the -c45 compatible string in the DT).

 

thanks!

0 Kudos
Highlighted
Contributor
Contributor
133 Views
Registered: ‎09-20-2017

Re: Use MDIO clause 45 on Zynq

Hi,

the phy I was working on is not able to send/receive data yet, but I guess this is another issue. 
However, I got the C45 MDIO working, but I needed a bunch of patches.

First of all I recommend a quite new kernel, I got the first positive results with 5.3, as there were lot's of patches for my application BASE-T1 Ethernet.

One mandatory patch is the following:

https://lkml.org/lkml/2019/7/10/475
This patch enables the c45 support for the macb driver. 

If you want to test some mdio querys within linux userspace I recommend phytool. This tool communicates over ioctl with the kernel, but please consider, that the ioctl support for clause45 MDIO was introduced about Linux 5.1 or 5.2, so this won't work in the last LTS releases.

The -c45 devicetree binding is correct, the device registers as Generic 10G device. If you sniff the mdio bus you'll still see some mdio c22 messages, this is the communication between gmii2rgmii driver and the gmii2rgmii IP. Please have a look at the gmii2rgmii code as well, because the driver will switch to 10M if the Generic 10G driver is used, because the state isn't decoded correctly. 

Contributor
Contributor
126 Views
Registered: ‎09-01-2017

Re: Use MDIO clause 45 on Zynq

Awesome thanks for the info on the direction to head.
0 Kudos