[smscusb] Fetch MAC from device tree for Raspberry Pi Model B+

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2019-07-19 19:15:33 +01:00
parent a046329012
commit f4cc5834ef
4 changed files with 41 additions and 29 deletions
+4
View File
@@ -97,6 +97,10 @@ static int lan78xx_fetch_mac ( struct smscusb_device *smscusb ) {
if ( ( rc = smscusb_otp_fetch_mac ( smscusb, LAN78XX_OTP_BASE ) ) == 0 )
return 0;
/* Read MAC address from device tree, if present */
if ( ( rc = smscusb_fdt_fetch_mac ( smscusb ) ) == 0 )
return 0;
/* Otherwise, generate a random MAC address */
eth_random_addr ( netdev->hw_addr );
DBGC ( smscusb, "LAN78XX %p using random MAC %s\n",