Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff6e7228 authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by David S. Miller
Browse files

sh_eth: use random MAC address if no valid one supplied



On Renesas R-Car based development boards, although a MAC address is printed on
all the Ethernet port labels, U-Boot  doesn't write a valid MAC address  to the
Ether MAHR/MALR registers (there's no storage provided for the Ether MAC address
either), so we have to resort to using a random MAC address...

Signed-off-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: default avatarSimon Horman <horms+renesas@verge.net.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3b54912f
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2735,6 +2735,11 @@ static int sh_eth_drv_probe(struct platform_device *pdev)

	/* read and set MAC address */
	read_mac_address(ndev, pd->mac_addr);
	if (!is_valid_ether_addr(ndev->dev_addr)) {
		dev_warn(&pdev->dev,
			 "no valid MAC address supplied, using a random one.\n");
		eth_hw_addr_random(ndev);
	}

	/* ioremap the TSU registers */
	if (mdp->cd->tsu) {