验证环境
在您开始验证新的以太网驱动设备前,您需要为以下条目定义环境变量。
- U-Boot
- 开发板IP地址(通过设置ipaddr变量)
- 主动式以太网接口(通过设置ethact变量)
- MAC接口地址(通过设置ethaddr变量)
作为单过程操作系统,Linux一次只能操作一个以太网驱动程序(接口)。因此您需要在上述参数中指定,以便在使用之前通知U-Boot哪个接口是活动的。
以下代码为一个示例:
===>print baudrate=115200 boottargs=console=ttySO,115200 debug rootwait earlycon=sbi bootcmd=run load_vf2_env;run importbootenv;run boot2;run distro_bootcmd bootcmd_mmc0=devnum=0; run mmc_boot bootde|ay=2 bootdir=/boot eth0addr=6c:cf:39:7c:4e:22 ethladdr=6c:cf:39:7c:3e:53 ethact=ethernet@16030000 ethaddr=6c:cf:39:7c:4e:22 ipaddr=192.168.120.230 netmask=255.255.255.0 stderr=serial@10000000 stdin=serial@10000000 stdout=serial@10000000
