# mdio-proxy-module **Repository Path**: float996/mdio-proxy-module ## Basic Information - **Project Name**: mdio-proxy-module - **Description**: for s32g2 yocto linux compile. - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: integration - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-07-28 - **Last Updated**: 2023-07-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README
A very simple solution for accessing any MDIO bus from user-space.
The kernel module and userspace application communicate via netlink.
Current code stands as a proof-of-concept and it's subject for further development, requiring several improvements and enhancements.
git clone and compile your kernel
setup tool-chain
export CROSS_COMPILE=aarch64-linux-gnu-
export ARCH=arm64
compile
make KBUILD_DIR=<path to kernel>
load kernel module using insmod
NXP MDIO proxy module loaded
use the mdio-app tool to read/write phy registers
root@localhost:~# ./mdio-app
Usage:
./mdio-app <bus> <addr> c22 <reg> [data]
./mdio-app <bus> <addr> c45 <devad> <reg> [data]
Example reading PHYID from an AQR113c ethernet phy.
root@localhost:~# ./mdio-app 1afd000 0 c45 1e 3
Got back: data=0x1c12
root@localhost:~# ./mdio-app 1afd000 0 c45 1e 2
Got back: data=0x31c3
Florin Chiculita <florinlaurentiu.chiculita@nxp.com> <your name here>
Clean-up code
Improve userspace application usage
U-Boot mdio syntax
Allow range of registers
Enumerating all mdio busses and phys
Kernel API mdio_find_bus() is available only on newer kernels but can be backported with ease.