USB to MDIO adapter project announcement

Hi OpenWrt community,

I just want to announce that I created a USB to MDIO adapter based on a Raspberry Pi Pico 1. Because it is an open source clone of a Marvell USB to MDIO adapter which has a mainline Linux driver mdio-mvusb it is working out-of-the box in at least Ubuntu. Currently, I didn't see that mdio-mvusb is included OpenWrt.

Project link: https://github.com/AlbrechtL/usb-mdio-adapter

My main use case is to explore Ethernet switch chips.

Examples
Kernel log

[  +3,286310] usb 1-2: new full-speed USB device number 49 using xhci_hcd
[  +0,152680] usb 1-2: New USB device found, idVendor=1286, idProduct=1fa4, bcdDevice= 0.00
[  +0,000017] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  +0,000007] usb 1-2: Product: Marvell USB MDIO Adapter Clone
[  +0,000006] usb 1-2: Manufacturer: Albrecht Lohofener

Get link status

$ mdio mvusb*
DEV      PHY-ID  LINK
0x00  0x001cc852  down
0x01  0x001cc852  down
0x02  0x001cc852  up
0x03  0x001cc852  down
0x04  0x001cc852  down
0x05  0x001cc852  down

Get PHY2 information

$ mdio mvusb* phy 2
BMCR(0x00): 0x3100
flags: -reset -loopback +aneg-enable -power-down -isolate -aneg-restart
      -collision-test
speed: 100-full

BMSR(0x01): 0x786d
capabilities: -100-t4 +100-tx-f +100-tx-h +10-t-f +10-t-h -100-t2-f -100-t2-h
flags:        -ext-status +aneg-complete -remote-fault +aneg-capable +link
             -jabber +ext-register

ID(0x02/0x03): 0x001cc852

I hope you find this tool useful.

5 Likes