phytool下载与使用(详解)

phytool下载地址

https://github.com/wkz/phytool

phytool

Linux MDIO register access

Usage

<0-0xffff> phytool print IFACE/ADDR[/REG]

Clause 22:

ADDR := <0-0x1f> REG  := <0-0x1f>

Clause 45 (not supported by all MDIO drivers):

ADDR := PORT:DEV PORT := <0-0x1f> DEV  := <0-0x1f> REG  := <0-0xffff>

The read and write commands are simple register level accessors. The
print command will pretty-print a register. When using the print
command, the register is optional. If left out, the most common
registers will be shown.

Examples


~ # phytool print eth0/0 ieee-phy: id:0x01410eb1

   ieee-phy: reg:BMCR(0x00) val:0x1140
      flags:          -reset -loopback +aneg-enable -power-down -isolate -aneg-restart -collision-test
      speed:          1000-full

   ieee-phy: reg:BMSR(0x01) val:0x7949
      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

举例说明:

phytool write eth0/0/31 0x0c44   //eth0 为网口; 0为端口,默认为0,不用关注; 31为页寄存器; 0x0c44是要写入的值
phytool read  eth0/0/19          //eth0 为网口; 0为端口,默认为0,不用关注; 19为寄存器
phytool write eth0/0/19 0x5f00     //写入寄存器19, 值为0x5f00
phytool read  eth0/0/19            //读取寄存器19
phytool write eth0/0/31 0x0000        //切换到寄存器0
phytool write eth0/0/0 0x9040         //复位phy芯片

需要注意的是每个寄存器都有一个页地址,如果要写入该寄存器,需要先切换到对应分页,也就是上面例子的
phytool write eth0/0/31 0x0c44 ,意思是切换到0x0c44的页
寄存器19在0x0c44页下面,然后就可以写入值了, phytool write eth0/0/19 0x5f00
上述操作的数值均可以使用16进制表示

  • 2
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

北极……星

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值