From: Mike Frysinger Date: Tue, 23 Aug 2011 13:21:04 -0400 Subject: [U-Boot] =?iso-8859-1?q?=5BPATCH_1/3=5D_net=3A_Adds_Fast_Ethernet?= =?iso-8859-1?q?_Controller_driver=09for_Armada100?= In-Reply-To: <20051.51102.404246.81248@morden.metzler> References: <1570238601.123783.1314104389736.JavaMail.root@ahm.einfochips.com> <20110823133404.81B81201520@gemini.denx.de> <20051.51102.404246.81248@morden.metzler> Message-ID: <201108231321.05284.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tuesday, August 23, 2011 11:30:38 Ralph Metzler wrote: > Wolfgang Denk writes: > > > ok I just wanted to clear myself.. I do not have a dedicated hardware > > > storage in my ethernet controller so I will just look into environment > > > variable ethaddr, if its set I will just copy it to driver layer and > > > if it is not set, I let the user set it. He/She may use the tools > > > provided with U-Boot to generate a random MAC or by any mean get a > > > MAC and store it in env which is gonna be one time unless env gets > > > corrupt or cleared by user. Which means no MAC generation in code... > > > > > > Please correct me if my understanding wrong... > > > > This is correct, except for the nitpick that nobody should ever use a > > truly random MAC address - if no valid MAC address is available, one > > should at least make sure to pick one of the locally administered > > Ethernet address pool (2nd LSB in the most significant byte of the > > address must be set). > > It is even more annoying that the Linux network driver for > Armada 100 (pxa168_eth.c) does the same thing (random MAC) which made > it impossible to properly assign IPs or even have the same in u-boot > and Linux. > > Since the pxa168 ethernet seems to (correct me if I am wrong) > store all MACs, including its own, in a buffer allocated in main memory, > it is not possible to set it in u-boot and then read it out in Linux. > So, I introduced "pxa168_mac" as Linux command line argument to pass > ethaddr to pxa168_eth. Or does anybody have a better solution? the latest u-boot tree should call write_hwaddr when there is a valid mac available (i.e. "ethaddr" is in the env). then linux should be able to say "hey, the mac is already set to a valid one" and leave it be. if linux always blows it away, you can certainly use the tried & true method: read the u-boot env from userspace (fw_printenv) and then manually set it yourself with `ifconfig hw class `. -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. Url : http://lists.denx.de/pipermail/u-boot/attachments/20110823/ee717637/attachment.pgp