uboot下有一个mii命令。命令帮助信息如下:
mii - MII utility commands
Usage:
mii device - list available devices
mii device - set current device
mii info - display MII PHY info
mii read - read MII PHY register
mii write - write MII PHY register
mii dump - pretty-print (0-5 only)
Addr and/or reg may be ranges, e.g. 2-7.
mii device示例,会输出MDC/MDIO总线设备
uboot>mii device
MII devices: 'FSL_MDIO0' 'FM_TGEC_MDIO'
Current device: 'FSL_MDIO0'
mii info打印输出,PHY后面跟的就是addr
uboot> mii info
PHY 0x00: OUI = 0x5043, Model = 0x1D, Rev = 0x01, 1000baseT, FDX
PHY 0x01: OUI = 0x0000, Model = 0x00, Rev = 0x00, 10baseT, HDX
PHY 0x02: OUI = 0x0000, Model = 0x00, Rev = 0x00, 10baseT, HDX
PHY 0x03: OUI = 0x0000, Model = 0x00, Rev = 0x00, 10baseT, HDX
PHY 0x04: OUI = 0x0000, Model = 0x00, Rev = 0x00, 10baseT, HDX
PHY 0x05: OUI = 0x0000, Model = 0x00, Rev = 0x00, 10baseT, HDX
PHY 0x06: OUI = 0x0000, Model = 0x00, Rev = 0x00, 10baseT, HDX
PHY 0x07: OUI = 0x0000, Model = 0x00, Rev = 0x00, 10baseT, HDX
mii read - read MII PHY register
mii write - write MII PHY register
上述两个命令,需要根据具体的芯片手册寄存器设置来进行配置。以下命令为示例
mii write 0 0 0x8000 向地址为0的phy芯片的0寄存器写入0x8000
mii read 0 0 读取地址为0的phy芯片的寄存器0的值
Tags:
uboot mii PHY MDC MDIO
uboot mii PHY MDC MDIO