Hi,
I have a board with T1024 processor and I want to connect it with a peripheral by MDIO interface. I have booted the linux on the T1024. Now, I want to run a C code on the T1024, in which the peripheral can be configured by the MDIO interface. In other words, I should have a C code, which config the peripheral by MDIO interface.
Is there any C code example that can help me? Is there any library for MDIO interface specifically for T1024 processor? How I can write a C code to config the peripheral by MDIO interface?
thanks
I generate the files, too. Should I install the ethtool on the T1024 board? because, I find install bash script in its package!
I generate the ethtool source code with command bitbake ethtool -c patch -f and find them in build_<platform>/tmp/work/<core>-fsl-linux/ethtool/4.0-r0/ethtool-4.0/.
Also, I get kernel source code with command bitbake virtual/kernel -c patch -f in inbuild_<platform>/tmp/work/<platform>-fsl-linux/linux-qoriq/<version>/git/,
In this directory, source files drivers/net/ethernet/intel/e1000/e1000_ethtool.c, drivers/net/mii.c and drivers/net/mdio.c are related.
However I don't know, how to use this source files to read and write by MDIO interface?
> Is there any C code example that can help me?
It is possible to refer to the U-Boot "mii" commans subsystem.
=> help mii mii - MII utility commands Usage: mii device – list available devices mii device <devname> – set current device mii info <addr> – display MII PHY info mii read <addr> <reg> – read MII PHY <addr> register <reg> mii write <addr> <reg> <data> – write MII PHY <addr> register <reg> mii dump <addr> <reg> – pretty-print <addr> <reg> (0-5 only)Addr and/or reg may be ranges, e.g. 2-7.
The U-Boot source code is provided in the Linux SDK available at:
Linux® SDK for QorIQ Processors|NXP
> Is there any library for MDIO interface specifically for T1024 processor?
No.
Thanks for your reply,
by using help mii command in U-boot, I will get some options in terminal.
This options includes the following:
mdio list
mdio info
mdio read
mdio write
and ... .
This is good, but I want to read or write in MDIO interface by my C code. how I can do it? Which libraries should add to my C project to communicate with MDIO interface?
Is there any method to extract MDIO package from the Yocto project? In other words, can I extract MDIO C source code from Yocto project to include in my C project?
Mohamad.Labbaf@Gmail.Com is also interested in this topic. Please take the higher priority to respond. Thank you