From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Warren Date: Thu, 22 Oct 2009 10:10:34 -0700 Subject: [U-Boot] [PATCH v2] Fix DM9000 MAC address handling In-Reply-To: <0554BEF07D437848AF01B9C9B5F0BC5D936D8CA5@dlee01.ent.ti.com> References: <1256187408-30549-1-git-send-email-biggerbadderben@gmail.com> <0554BEF07D437848AF01B9C9B5F0BC5D936D8CA5@dlee01.ent.ti.com> Message-ID: <4AE0920A.5030908@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Sandeep, Paulraj, Sandeep wrote: > >> Proper behavior is to pull MAC address from NVRAM in the initialization() >> an >> stuff it in dev->address, then program the device from dev->address in >> the init() function. >> >> Signed-off-by: Ben Warren >> --- >> > Ben I tested and here is the result. > > 1) dhcp still does not work > 2) I have to set a static ipaddr for the bootcmd to work > > Your patch solved the issue where issuing the bootcmd "tftp; bootm" > would complain about ethaddr not being set. > > But i do notice that ethaddr does not get saved in the environment. > > Saving the address to the environment is the user's job. Nothing should write it automatically. A few drivers do, but they should be changed. Please look in net/eth.c::eth_initialize() to see how this works. The order of precedence is this: 1. If environment variable is not set, it's up to the driver to find its own MAC address. 2. If the environment variable is set, and is non-zero, it is used. If if conflicts with the value in NVRAM, a warning is issued, but the environment value is still used. I don't know why DHCP doesn't work, but if I were you I'd check that the address printed from line 344 in dm9000x.c shows a valid unicast MAC address. regards, Ben