How to use Phytool utility to read/write mdio phy registers in T1040RDB

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to use Phytool utility to read/write mdio phy registers in T1040RDB

6,658 Views
Suraj_Prakash
Contributor II

Hi,

      I am working on T1040RDB and I wanted to access (read/write) management PHY registers which connected on mdio bus. I was able to access the same from Uboot successfully but in Linux I am trying to use  phytool utility (cross-compiled.....downloaded from Github) for the same.

I am facing the following errors while using phytool utility

root@t1040d4rdb:~# ./phytool fm1-gb2/2/1
error: phy_read (-22)
error: phy_read (-22)
error: phy_read (-22)

Please suggest a way to use phytool in Linux compiled from SDK 2.0

Is there any option to compile phytool in SDK 2.0?? If any please suggest

Note: I tried using the same phytool utility in Linux compiled from SDK 2.0 and SDK 3.1. In Linux from SDK 3.1 phytool is functioning properly but giving the above mentioned errors in Linux from SDK 2.0.

 

0 Kudos
1 Reply

6,644 Views
yipingwang
NXP TechSupport
NXP TechSupport

You could refer to the following procedure to add phytool recipe in SDK 2.0

Please create phytool folder in sources/meta-openembedded/meta-networking/recipes-support/ folder, then in phytool folder create recipe file phytool.bb as the following.

SUMMARY = "PHY interface tool for Linux"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"

PV = "1.0.1"
SRCREV = "1a3ea62a218206e9faf3b27fb5d01c85692024c8"
SRC_URI = "git://github.com/wkz/phytool.git"

S = "${WORKDIR}/git"

do_install() {
install -d ${D}${prefix}/bin
oe_runmake 'DESTDIR=${D}' 'PREFIX=${prefix}' install
}

do_qa_configure(){
}

I have verified this version phytool with SDK 2.0 images on T1040D4RDB target board, I also encountered the following error. It seems that PHY drivers in Linux Kernel doesn't support this operation.

root@t1040d4rdb:~# .//phytool fm1-gb2/2/1
error: phy_read (-22)
error: phy_read (-22)
error: phy_read (-22)

It seems that there is no problem with phytool utility, please refer to the following result read from PCIe Ethernet interface.

root@t1040d4rdb:~# .//phytool eth5/2/1
ieee-phy: reg:BMSR(0x01) val:0x796d
capabilities: -100-b4 +100-f +100-h +10-f +10-h -100-t2-f -100-t2-h
flags: +ext-status +aneg-complete -remote-fault +aneg-capable +link -jabber +ext-register
root@t1040d4rdb:~#

0 Kudos