Verify Ethernet Driver in U-Boot
This section provides procedures for verifying that MAC-PHY data path is functional in U-Boot.
Set up Network Environment Variables
Before testing Ethernet functionality in U-Boot, configure the required environment variables. U-Boot operates a single Ethernet interface at a time, so you must specify which interface and address to use.
- ipaddr: Board IP address on the local network
- ethact: Active Ethernet interface
- ethaddr: MAC address of the active interface
For example:
setenv ipaddr 192.168.120.230
setenv ethact ethernet@16030000
setenv ethaddr 6c:cf:39:7c:4e:22To verify the current environment
settings:
printenv ipaddr ethact ethaddrBoot Log Verification
After adding or modifying the Ethernet driver, power cycle the board and examine the boot log for the second U-Boot access (the first boot initializes hardware).
For example, in the following log, the highlighted information indicates that
Verify PHY Access with MDIO
Verify PHY connectivity using MDIO commands. This examines whether the PHY is ready
for data communication.
mdio list
mdio read <phy_addr> <reg>
mdio write <phy_addr> <reg> <value>For example, to read PHY ID from address
0:
mdio read 0 2
mdio read 0 3Test Digital Loopback
Perform a loopback test to verify TX and RX
functionality:
setenv ipaddr 192.168.1.100
ping $ipaddr