public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] omap2: set the ethaddr as well as the usbethaddr env var to ensure static MAC
@ 2017-11-23 13:14 Peter Robinson
  2017-12-04 18:35 ` [U-Boot] " Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Robinson @ 2017-11-23 13:14 UTC (permalink / raw)
  To: u-boot

The kernel gets the ethernet MAC from the ethaddr variable, the omap boards for
devices with USB based eth adapters just set the usbethaddr which doesn't appear
to get passed to the kernel. The same Raspberry Pi code sets both ethaddr and
usbethaddr so lets do that so linux (tested 4.13 and 4.14) get a static rather
than a random MAC address, while not regressing users of usbethaddr.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
 arch/arm/mach-omap2/utils.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-omap2/utils.c b/arch/arm/mach-omap2/utils.c
index 2e8778043b..d11670c0ee 100644
--- a/arch/arm/mach-omap2/utils.c
+++ b/arch/arm/mach-omap2/utils.c
@@ -215,6 +215,9 @@ void omap_die_id_usbethaddr(void)
 		mac[5] = (die_id[0] >> 8) & 0xff;
 
 		eth_env_set_enetaddr("usbethaddr", mac);
+
+		if (!env_get("ethaddr"))
+			eth_env_set_enetaddr("ethaddr", mac);
 	}
 }
 
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] omap2: set the ethaddr as well as the usbethaddr env var to ensure static MAC
  2017-11-23 13:14 [U-Boot] [PATCH] omap2: set the ethaddr as well as the usbethaddr env var to ensure static MAC Peter Robinson
@ 2017-12-04 18:35 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2017-12-04 18:35 UTC (permalink / raw)
  To: u-boot

On Thu, Nov 23, 2017 at 01:14:17PM +0000, Peter Robinson wrote:

> The kernel gets the ethernet MAC from the ethaddr variable, the omap boards for
> devices with USB based eth adapters just set the usbethaddr which doesn't appear
> to get passed to the kernel. The same Raspberry Pi code sets both ethaddr and
> usbethaddr so lets do that so linux (tested 4.13 and 4.14) get a static rather
> than a random MAC address, while not regressing users of usbethaddr.
> 
> Signed-off-by: Peter Robinson <pbrobinson@gmail.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171204/0290fe84/attachment.sig>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-12-04 18:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-23 13:14 [U-Boot] [PATCH] omap2: set the ethaddr as well as the usbethaddr env var to ensure static MAC Peter Robinson
2017-12-04 18:35 ` [U-Boot] " Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox