Skip to content

Kernel module and user-space application for accessing any MDIO device

License

Notifications You must be signed in to change notification settings

nxp-qoriq/mdio-proxy-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

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.

Compiling the code

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>

Usage

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

Contributors

Florin Chiculita <florinlaurentiu.chiculita@nxp.com>
<your name here>

Future work

Clean-up code
Improve userspace application usage
U-Boot mdio syntax
Allow range of registers
Enumerating all mdio busses and phys

Notes

Kernel API mdio_find_bus() is available only on newer kernels but can be backported with ease.

About

Kernel module and user-space application for accessing any MDIO device

Resources

License

Stars

Watchers

Forks

Packages

No packages published