{"id":24609501,"url":"https://github.com/albrechtl/usb-mdio-adapter","last_synced_at":"2025-09-07T02:08:01.144Z","repository":{"id":274017619,"uuid":"921644935","full_name":"AlbrechtL/usb-mdio-adapter","owner":"AlbrechtL","description":"Open source clone of a Marvell USB MDIO adapter which can be used to interface MDIO of Ethernet switch chips and PHYs.","archived":false,"fork":false,"pushed_at":"2025-01-24T13:22:36.000Z","size":83,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T12:27:56.603Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlbrechtL.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-24T10:42:28.000Z","updated_at":"2025-01-24T13:22:39.000Z","dependencies_parsed_at":"2025-01-24T11:39:58.378Z","dependency_job_id":null,"html_url":"https://github.com/AlbrechtL/usb-mdio-adapter","commit_stats":null,"previous_names":["albrechtl/usb-mdio-adapter"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/AlbrechtL/usb-mdio-adapter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlbrechtL%2Fusb-mdio-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlbrechtL%2Fusb-mdio-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlbrechtL%2Fusb-mdio-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlbrechtL%2Fusb-mdio-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlbrechtL","download_url":"https://codeload.github.com/AlbrechtL/usb-mdio-adapter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlbrechtL%2Fusb-mdio-adapter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273986629,"owners_count":25202708,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-24T18:14:55.821Z","updated_at":"2025-09-07T02:08:01.086Z","avatar_url":"https://github.com/AlbrechtL.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Generic USB to MDIO adapter\nThis is an open source clone of a Marvell MDIO USB adapter which can be used to interface MDIO of Ethernet switch chips and PHYs. Mainline Linux kernel is there is as interface hardware a Raspberry Pi Pico 1 is used.\n\n\n## Features\n* Generic interface to MDIO Ethernet switch chips and Ethernet PHYs\n* Mainline Linux kernel support due [mvusb driver](https://elixir.bootlin.com/linux/v6.12.6/source/drivers/net/mdio/mdio-mvusb.c)\n  * Interfacing the Linux MDIO subsystem\n  * Usage of tools like `mdio-tools` (https://github.com/wkz/mdio-tools)\n  * Interfacing Linux [DSA](https://docs.kernel.org/networking/dsa/dsa.html) and [switchdev](https://docs.kernel.org/networking/switchdev.html)\n  * Works out of the box on Ubuntu 24.04\n* Implements a Marvell MDIO USB adapter clone\n* A LED is indicating USB/MDIO traffic\n* Raspberry Pi Pico 1 support (RP2040)\n\n\n## Usage\nWire up the `MDC` and `MDIO` pins to your chip. Please note that the RP2040 uses a 3.3 V voltage level.\n\n![Raspberry Pi Pico 1 pinout](pictures/pico-pinout.svg)\n\n#### MDIO pin connection table\n| Pin      | GPIO    | Function |\n| -------- | ------- | -------- |\n| 18       | -       | Ground   |\n| 19       | GP14    | MDC      |\n| 20       | GP15    | MDIO     |\n\nThe UART ports (8N1, baud. 115200) are just for debugging. The RAW MDIO data is visible there.\n\n#### LED\nThe Raspberry Pi Pico has an built-in LED with the following function.\n\n| State    | Function                        |  \n| -------- | ------------------------------- |\n| on       | USB initialized                 |\n| off      | USB error or device not powered |\n| blinking | USB/MDIO traffic                |\n\n#### Realtek RTL8305CS example with `mdio-tools`\nYou can get `mdio-tools` here https://github.com/wkz/mdio-tools\n\n*Get link status*\n   ```\n$ mdio mvusb*\n DEV      PHY-ID  LINK\n0x00  0x001cc852  down\n0x01  0x001cc852  down\n0x02  0x001cc852  up\n0x03  0x001cc852  down\n0x04  0x001cc852  down\n0x05  0x001cc852  down\n   ```\n\n*Get PHY2 information*\n   ```\n$ mdio mvusb* phy 2\nBMCR(0x00): 0x3100\n  flags: -reset -loopback +aneg-enable -power-down -isolate -aneg-restart\n         -collision-test\n  speed: 100-full\n\nBMSR(0x01): 0x786d\n  capabilities: -100-t4 +100-tx-f +100-tx-h +10-t-f +10-t-h -100-t2-f -100-t2-h\n  flags:        -ext-status +aneg-complete -remote-fault +aneg-capable +link\n                -jabber +ext-register\n\nID(0x02/0x03): 0x001cc852\n   ```\n\n## Installation\nDownload `usb-mdio-adapter.uf2` from the [latest release](https://github.com/AlbrechtL/usb-mdio-adapter/releases).\n\nPush and hold the BOOTSEL button as you plug the debugger device into your computer to mount a volume called \"RPI-RP2\".\n\nCopy the UF2 file `usb-mdio-adapter.uf2` onto the volume. The volume will dismount automatically after the file finishes copying onto the device.\n\nYour device will reboot and now runs the USB to MDIO adapter firmware. \n\nCheck your kernel log (e.g. `dmesg)` you should see\n   ```\n[  +3,286310] usb 1-2: new full-speed USB device number 49 using xhci_hcd\n[  +0,152680] usb 1-2: New USB device found, idVendor=1286, idProduct=1fa4, bcdDevice= 0.00\n[  +0,000017] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0\n[  +0,000007] usb 1-2: Product: Marvell USB MDIO Adapter Clone\n[  +0,000006] usb 1-2: Manufacturer: Albrecht Lohofener\n   ```\n\nIt is now ready.\n\n## Building\nPlease follow the SDK installation instructions for the Raspberry Pi Pico. Checkout this repository open Visual Studio Code and compile it.\n\n## Support\nJust raise up an [issue](https://github.com/AlbrechtL/usb-mdio-adapter/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbrechtl%2Fusb-mdio-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falbrechtl%2Fusb-mdio-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbrechtl%2Fusb-mdio-adapter/lists"}