平台:IMX6Q
系统:Linux V3.14.28
异常日志信息如下:
Configuring network interfaces... [ 7.228356] fec eth0: no PHY, assuming direct connection to switch
[ 7.236055] libphy: PHY fixed-0:00 not found
[ 7.240334] fec eth0: could not attach to PHY
ifconfig: SIOCSIFFLAGS: No such device
[ 7.261377] fec eth0: no PHY, assuming direct connection to switch
[ 7.269110] libphy: PHY fixed-0:00 not found
[ 7.273390] fec eth0: could not attach to PHY
ifconfig: SIOCSIFFLAGS: No such device
route: SIOCADDRT: Network is unreachable
这个总是说找不到phy,但是我ifconfig -a 有能找到eth0
root@M6708-T:~# ifconfig -a
can0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
NOARP MTU:16 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:142
can1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
NOARP MTU:16 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:143
eth0 Link encap:Ethernet HWaddr 00:14:97:1A:2A:28
inet addr:192.168.1.136 Bcast:192.168.1.255 Mask:255.255.255.0
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:10 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:700 (700.0 B) TX bytes:700 (700.0 B)
sit0 Link encap:IPv6-in-IPv4
NOARP MTU:1480 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
解决办法:
网卡分为两个层次:MAC+PHY一般说来,MAC就是网络控制器,如果该驱动OK,就能看到ifconfig信息;PHY是物理层,负责发送和传输的底层,如果PHY发生问题,ifconfig同样有信息,只有up时才会连接PHY。MAC和PHY通过MII接口传输以太网数据,通过MDIO接口访问PHY的配置寄存器。PHY连不上第一可能是硬件问题,拿给做硬件的,检查一下PHY结果所有信号都很正常。。。。
待更新。