public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH] mips: When booting Linux images, add 'ethaddr' and 'eth1addr' to the environment
@ 2008-06-09  3:56 Jason McMullan
  2008-07-06  5:59 ` Shinya Kuribayashi
  0 siblings, 1 reply; 4+ messages in thread
From: Jason McMullan @ 2008-06-09  3:56 UTC (permalink / raw)
  To: u-boot

Add 'ethaddr' and 'eth1addr' to the Linux kernel environment if
they are set in the U-Boot environment.

Signed-off-by: Jason McMullan <mcmullan@netapp.com>
---
 lib_mips/bootm.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/lib_mips/bootm.c b/lib_mips/bootm.c
index f813fc5..8fe3782 100644
--- a/lib_mips/bootm.c
+++ b/lib_mips/bootm.c
@@ -54,6 +54,7 @@ void do_bootm_linux (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[],
 	char	*commandline = getenv ("bootargs");
 	char	env_buf[12];
 	int	ret;
+	const char *cp;
 
 	/* find kernel entry point */
 	if (images->legacy_hdr_valid) {
@@ -113,6 +114,16 @@ void do_bootm_linux (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[],
 	sprintf (env_buf, "0x%X", (uint) (gd->bd->bi_flashsize));
 	linux_env_set ("flash_size", env_buf);
 
+	cp = getenv("ethaddr");
+	if (cp != NULL) {
+		linux_env_set("ethaddr", cp);
+	}
+
+	cp = getenv("eth1addr");
+	if (cp != NULL) {
+		linux_env_set("eth1addr", cp);
+	}
+
 	if (!images->autostart)
 		return ;
 
-- 
1.5.4.3

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

* [U-Boot-Users] [PATCH] mips: When booting Linux images, add 'ethaddr' and 'eth1addr' to the environment
  2008-06-09  3:56 [U-Boot-Users] [PATCH] mips: When booting Linux images, add 'ethaddr' and 'eth1addr' to the environment Jason McMullan
@ 2008-07-06  5:59 ` Shinya Kuribayashi
  2008-07-07 13:46   ` [U-Boot-Users] [PATCH] mips: When booting Linux images, add'ethaddr' " McMullan, Jason
  0 siblings, 1 reply; 4+ messages in thread
From: Shinya Kuribayashi @ 2008-07-06  5:59 UTC (permalink / raw)
  To: u-boot

Jason McMullan wrote:
> Add 'ethaddr' and 'eth1addr' to the Linux kernel environment if
> they are set in the U-Boot environment.

I missed this mail, sorry for my late reply.

Patch itself looks correct, but let me confirm.

Looking closely into linux/arch/*, I found that mips is the only
architecture which supports the 'ethaddr' kernel parameter.  Is this
right?  What I want to make sure is whether 'ethaddr' is an unusual
kernel parameter or not.

I think it's possible to probe MAC address(es) on kernel side, and it's
common practice IMO. [ if not so, Linux couldn't work without suitable
bootldrs which can pass the 'ethaddr' parameter. It's inconvenient, at
least for me. ]

However, I don't have strong opinions on this matter.  If you still have
troubles without this change, or can't probe MAC addresses by Kernel due
to some reason, I'll apply the patch.

Comments?


  Shinya

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

* [U-Boot-Users] [PATCH] mips: When booting Linux images, add'ethaddr' and 'eth1addr' to the environment
  2008-07-06  5:59 ` Shinya Kuribayashi
@ 2008-07-07 13:46   ` McMullan, Jason
  2008-07-08 13:55     ` Shinya Kuribayashi
  0 siblings, 1 reply; 4+ messages in thread
From: McMullan, Jason @ 2008-07-07 13:46 UTC (permalink / raw)
  To: u-boot

On Sun, 2008-07-06 at 14:59 +0900, Shinya Kuribayashi wrote:
> Jason McMullan wrote:
> > Add 'ethaddr' and 'eth1addr' to the Linux kernel environment if
> > they are set in the U-Boot environment.
>
> Looking closely into linux/arch/*, I found that mips is the only
> architecture which supports the 'ethaddr' kernel parameter.  Is this
> right?  What I want to make sure is whether 'ethaddr' is an unusual
> kernel parameter or not.

On our devices, the U-Boot environment is the only place the ethernet
MAC address is stored.

Since the infrastructure for passing environment variables up to the
MIPS Linux kernel existed anyways, I decided that it would be a better
plan to use that machanism than to have the kernel dig through the
duplicate U-Boot environments.

I don't consider this patch a "must have" for upstream. I try to make
sure all the changes that are needed for our product are sent to the
u-boot list, even if they don't end up being accepted for DENX's U-Boot.

On a completely unrelated topic, I really like the MIPS 'environment'
method of passing information to the kernel instead of the old 'bd_t'
method. It's a lot more flexible.

Jason McMullan
MTS SW
System Firmware

NetApp
724.741.5011    Fax
724.741.5166    Direct
412.656.3519    Mobile
jason.mcmullan at netapp.com
www.netapp.com


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.denx.de/pipermail/u-boot/attachments/20080707/5b77ccfe/attachment.pgp 

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

* [U-Boot-Users] [PATCH] mips: When booting Linux images, add'ethaddr' and 'eth1addr' to the environment
  2008-07-07 13:46   ` [U-Boot-Users] [PATCH] mips: When booting Linux images, add'ethaddr' " McMullan, Jason
@ 2008-07-08 13:55     ` Shinya Kuribayashi
  0 siblings, 0 replies; 4+ messages in thread
From: Shinya Kuribayashi @ 2008-07-08 13:55 UTC (permalink / raw)
  To: u-boot

McMullan, Jason wrote:
> On Sun, 2008-07-06 at 14:59 +0900, Shinya Kuribayashi wrote:
>> Jason McMullan wrote:
>>> Add 'ethaddr' and 'eth1addr' to the Linux kernel environment if
>>> they are set in the U-Boot environment.
>> Looking closely into linux/arch/*, I found that mips is the only
>> architecture which supports the 'ethaddr' kernel parameter.  Is this
>> right?  What I want to make sure is whether 'ethaddr' is an unusual
>> kernel parameter or not.
> 
> On our devices, the U-Boot environment is the only place the ethernet
> MAC address is stored.
> 
> Since the infrastructure for passing environment variables up to the
> MIPS Linux kernel existed anyways, I decided that it would be a better
> plan to use that machanism than to have the kernel dig through the
> duplicate U-Boot environments.

Thanks for the explanations.  As Linux/MIPS kernel supports this
parameter anyway, it's good for U-Boot to support that, too.

Applied, will send to Wolfgang asap.


  Shinya

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

end of thread, other threads:[~2008-07-08 13:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-09  3:56 [U-Boot-Users] [PATCH] mips: When booting Linux images, add 'ethaddr' and 'eth1addr' to the environment Jason McMullan
2008-07-06  5:59 ` Shinya Kuribayashi
2008-07-07 13:46   ` [U-Boot-Users] [PATCH] mips: When booting Linux images, add'ethaddr' " McMullan, Jason
2008-07-08 13:55     ` Shinya Kuribayashi

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