All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] rpi: set ethaddr as well
@ 2016-02-03 15:08 Lubomir Rintel
  2016-02-06  4:06 ` [U-Boot] " Stephen Warren
  2016-02-08 20:49 ` Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Lubomir Rintel @ 2016-02-03 15:08 UTC (permalink / raw)
  To: u-boot

Let's set "ethaddr" when we get the ethernet address too, so that
fdt_fixup_ethernet() sets the address in the device tree and the Linux
driver can pick it up.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
---
The related Linux kernel change submitted here:
http://lists.infradead.org/pipermail/linux-rpi-kernel/2016-February/003207.html

 board/raspberrypi/rpi/rpi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index b344362..d7ad79d 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -254,6 +254,9 @@ static void set_usbethaddr(void)
 
 	eth_setenv_enetaddr("usbethaddr", msg->get_mac_address.body.resp.mac);
 
+	if (!getenv("ethaddr"))
+		setenv("ethaddr", getenv("usbethaddr"));
+
 	return;
 }
 
-- 
2.5.0

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

* [U-Boot] rpi: set ethaddr as well
  2016-02-03 15:08 [U-Boot] [PATCH] rpi: set ethaddr as well Lubomir Rintel
@ 2016-02-06  4:06 ` Stephen Warren
  2016-02-08 20:49 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Warren @ 2016-02-06  4:06 UTC (permalink / raw)
  To: u-boot

On 02/03/2016 08:08 AM, Lubomir Rintel wrote:
> Let's set "ethaddr" when we get the ethernet address too, so that
> fdt_fixup_ethernet() sets the address in the device tree and the Linux
> driver can pick it up.

You need to Cc the maintainer who will apply this (Tom Rini).

This seems OK, but ...

> diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
> index b344362..d7ad79d 100644
> --- a/board/raspberrypi/rpi/rpi.c
> +++ b/board/raspberrypi/rpi/rpi.c
> @@ -254,6 +254,9 @@ static void set_usbethaddr(void)
>  
>  	eth_setenv_enetaddr("usbethaddr", msg->get_mac_address.body.resp.mac);
>  
> +	if (!getenv("ethaddr"))
> +		setenv("ethaddr", getenv("usbethaddr"));

Rather than setting duplicate environment variables, wouldn't it be
better to modify the code that copies ethaddr into the DT so that it
used the correct environment variable for the platform? Perhaps that's
not worth it though.

Why use setenv() directly rather than just calling eth_setenv_enetaddr()
in both places? In the current code, I wonder what happens if
eth_setenv_enetaddr() fails, so presumably getenv() returns NULL or
whatever random value usbethaddr had since it wasn't over-written?

Tested-by: Stephen Warren <swarren@wwwdotorg.org>

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

* [U-Boot] rpi: set ethaddr as well
  2016-02-03 15:08 [U-Boot] [PATCH] rpi: set ethaddr as well Lubomir Rintel
  2016-02-06  4:06 ` [U-Boot] " Stephen Warren
@ 2016-02-08 20:49 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2016-02-08 20:49 UTC (permalink / raw)
  To: u-boot

On Wed, Feb 03, 2016 at 04:08:09PM +0100, Lubomir Rintel wrote:

> Let's set "ethaddr" when we get the ethernet address too, so that
> fdt_fixup_ethernet() sets the address in the device tree and the Linux
> driver can pick it up.
> 
> Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
> Tested-by: Stephen Warren <swarren@wwwdotorg.org>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160208/3db0d244/attachment.sig>

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

end of thread, other threads:[~2016-02-08 20:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-03 15:08 [U-Boot] [PATCH] rpi: set ethaddr as well Lubomir Rintel
2016-02-06  4:06 ` [U-Boot] " Stephen Warren
2016-02-08 20:49 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.