09-12-2019 01:05 AM - edited 09-12-2019 01:09 AM
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!
11-12-2019 09:39 PM
@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).
11-13-2019 06:18 AM
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:
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.