cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
franzforstmayr
Contributor
Contributor
1,813 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
4 Replies
bhig
Contributor
Contributor
1,701 Views
Registered: ‎09-01-2017

@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
franzforstmayr
Contributor
Contributor
1,683 Views
Registered: ‎09-20-2017

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. 

bhig
Contributor
Contributor
1,676 Views
Registered: ‎09-01-2017

Awesome thanks for the info on the direction to head.
0 Kudos
shriya
Visitor
Visitor
668 Views
Registered: ‎11-10-2020

Hi,

We are using Marvel 88Q2112 on our custom ultra zynq mp device. 

so the c45 device tree bindings which u mentioned could you help and post example about the same as to how to mention C45  in device tree wrt GEM0 ?

Regards,

Shriya 

0 Kudos