执行ifconfig -a/ifconfig eth0/ifconfig eth0 up
命令,找不到eth0设备,有如下类似打印:
root@TinaLinux:/# ifconfig -a
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:6480 errors:0 dropped:0 overruns:0 frame:0
TX packets:6480 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:505440 (493.5 KiB) TX bytes:505440 (493.5 KiB)
root@TinaLinux:/#
root@TinaLinux:/# ifconfig eth0
ifconfig: eth0: error fetching interface information: Device not found
root@TinaLinux:/#
root@TinaLinux:/# ifconfig eth0 up
ifconfig: SIOCGIFFLAGS: No such device
以太网模块配置未生效或存在GPIO冲突
sun50iw10p1-pinctrl pio: pin PH0 already requested by twi0; cannot claim for gmac0
sun50iw10p1-pinctrl pio: pin-224 (gmac0) status -22
sun50iw10p1-pinctrl pio: could not request pin 224 (PH0) from group PH0 on device pio
sunxi-gmac gmac0: Error applying setting, reverse things back
sunxi-gmac: probe of gmac0 failed with error -22
4.1 GPIO冲突 (1) 首先,结合内核启动log定位与哪个模块存在GPIO冲突,有如下类似打印:
sun50iw10p1-pinctrl pio: pin PH0 already requested by twi0; cannot claim for gmac0
(2) 然后,确认该模块GPIO配置是否有误或者是否可以关闭该模块。
4.2 以太网配置未生效 (1) 首先,确认内核menuconfig以太网模块配置是否打开,路径及截图如下:
menuconfig -> Device Drivers -> Network device support -> Ethernet driver support
(2) 然后,确认board.dts/sys_config.fex中GMAC模块是否打开,board.dts配置示例如下:
gmac0: eth@05020000{
phy-mode = "rgmii";
use_ephy25m = <1>;
tx-delay = <7>;
rx-delay = <0>;
status = "okay";
};
注: