This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[FAQ] [参考译文] [常见问题解答]如何使用 Linux 终端读取和写入以太网 PHY 寄存器?

Guru**** 651100 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/interface-group/interface/f/interface-forum/1164499/faq-how-to-read-and-write-ethernet-phy-registers-using-a-linux-terminal

Linux 环境中提供了多种不同的工具来读取和写入 TI PHY 上的寄存器。  下面列出了其中的几个选项。  

MII 读为:
这是唯一可以且必须在 U-boot 中使用的命令。 按此处所示停止自动引导过程、然后键入以下命令:  

“MII 读取{PHY ID}{register address}”
“MII 写入{PHY ID}{register address}{value}”

寄存器0x0-0x5也可与 MII 转储命令一起使用、以查看每个位的功能。 使用以下语法:“MII 转储{PHY ID}{register address (0-5)}”

PHY 工具:
此工具用于引导后。 此工具已集成到 TI SDK 中,但可以通过键入以下"sudo apt-get install -y net-tools"进行下载。 要使用该工具,请键入以下命令:

phytool 读取{Interface}/{PHY ID}/{register address}
phytool 写入{Interface}/{PHY ID}/{register address}{value}

要打印所有寄存器0x0-0x1f 的转储,可以使用以下命令:“x=0;while [$x -le 31];do printf “Register 0x%02x =”$x;phytool read eth0/0/$x $(( x++));Done”

MDIO 工具:
要安装 MDIO-tool,请使用以下命令:  

Git 克隆 https://github.com/Yannik25/mdio-tool
CD MDIO 工具
Cmake
制造
进行安装  

要使用该工具、请执行以下操作: