public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] MAC address question...
@ 2004-08-26 17:25 Robin Getz
  2004-08-26 19:17 ` Ladislav Michl
  2004-08-26 19:38 ` Wolfgang Denk
  0 siblings, 2 replies; 17+ messages in thread
From: Robin Getz @ 2004-08-26 17:25 UTC (permalink / raw)
  To: u-boot

Sorry - maybe I need to explain myself a little better.

The board that I am designing is a hardware/software prototyping validation 
board for various open source projects. It includes processor (Blackfin), 
Ethernet (SMC91111), Flash (4Meg) and SDRAM (128Meg), and expansion 
connectors for ADC, DAC, Audio Codecs, video encoder/decoders, ISM radios, etc.

Since this will eventually sold at Digikey & Farnell, it will be used by a 
variety of people at different skill levels (from pros to beginners), I 
want to ensure that if someone erases the entire Flash, it will still have 
a valid MAC address. Therefore, it will ship to people with valid MAC 
addresses (purchased from the IEEE) in the EEPROM connected to the 
SMC91111, and no environment variable (ethaddr) set.

If someone wants to change the MAC address, they add the environment 
variable (ethaddr), and this will be used. (but it will print warning 
messages that the MACs do not match).

I have had a few beta users who had to change the MAC address, (to get DHCP 
working on their networks), but then started calling for help when they get 
these warning messages. I normally tell them to RTFM - but I was thinking 
that a better solution might be necessary.

The "solution" was add some functionality somewhere, to change the MAC 
address in the SROM. I thought U-boot might be the best bet - because that 
is where MAC addresses should be managed - in the boot loader. I know that 
this should be programmed during manufacturing (and it is), but there is no 
way to re-program the SROM MAC. (unless I am missing something?)

>Defining memory locations of the processor as flash? ?? ???
>
>What exactly are you talking about????

Today on my board, I have 4 Meg of Flash - If I define things as 4Meg + 6 
bytes, in the board/specific/flash.c in write_buff() - I can trap these +6 
bytes, and actually program the MAC in the SROM. This is bad form because I 
know I should not be accessing a device outside the /driver/smc9111.c file.

The other option I had was make a similar patch to what Ladis did (thanks 
by the way) - but I expected Wolfgang to have a similar reaction to what he 
did.

I would like to come up with an acceptable solution, but maybe I am just 
worrying about something that I should not be - and just document things 
better.

As always - opinions or thoughts appreciated.

-Robin  

^ permalink raw reply	[flat|nested] 17+ messages in thread
* [U-Boot-Users] MAC address question...
@ 2004-08-26 20:26 Robin Getz
  2004-08-26 21:42 ` Wolfgang Denk
  0 siblings, 1 reply; 17+ messages in thread
From: Robin Getz @ 2004-08-26 20:26 UTC (permalink / raw)
  To: u-boot

At Thursday, August 26, 2004 12:38 PM Wolfgang Denk wrote:
[snip]
> > I have had a few beta users who had to change the MAC address, (to get
> > DHCP working on their networks)
>
>Why do you need to change a MAC address  to  get  DHCP  working???  I 
>never  heard  such  a  thing before - of course I assume that you are 
>distributing your boxes with valid MAC addresses only!?

The MAC addresses that I ship are valid MAC addresses - it was that their 
DHCP server, only gave IP addresses to "valid" machines on their network 
(valid = machines that the net admin knew about and wanted on the network). 
Since they were hacking on this they did the best thing they could - they 
unplugged the Windows machine, and stole it's MAC address, so their DHCP 
server would give them an IP number that their routers liked.

>Such functionality has been added  before,  but  not  as  (statically
>linked)  part  of  U-Boot.  Please  see  examples/82559_eeprom.c  and 
>examples/eepro100_eeprom.c for examples.

OK - I guess that is what I was looking for. If I made a smc91111_eeprom.c, 
would you accept that back into the examples, and if someone wanted to 
change it, they could do it from there?

I guess I really didn't look in the examples dir. In the README, it says 
there are two simple examples - it didn't mention that there were complex 
ones to :)

>I will not allow such dirty hacks in the public U-Boot source tree.

This is the reason I asked before I started coding -
My five favorite words "architect, design, implement, test, ship".

Thanks for the pointers - I will see what I can get from the examples dir.

-Robin 

^ permalink raw reply	[flat|nested] 17+ messages in thread
* [U-Boot-Users] MAC address question...
@ 2004-08-26  8:30 Getz, Robin
  2004-08-26  9:17 ` Ladislav Michl
  2004-08-26 15:03 ` Wolfgang Denk
  0 siblings, 2 replies; 17+ messages in thread
From: Getz, Robin @ 2004-08-26  8:30 UTC (permalink / raw)
  To: u-boot

I have a board with a SMC91111 on it, with an EEPROM connected to it, to 
store the MAC address. This allows users of the board to re-flash the main 
flash with U-boot as many times as they want without worrying about 
managing the MAC address in the main flash.

However, changing the EEPROM MAC address is troublesome, because the 
/drivers/smc91111.c doesn't seem to support programming the attached 
EEPROM. (you can get_rom_mac, but not set_rom_mac).

Before I started adding things, does anyone else have the same issue?

What I was thinking of doing was defining some reserved memory locations of 
the processor as FLASH, and handle this in /board/specific/flash.c - a 
flash write to 6 memory locations will actually set the MAC address in the 
EEPROM attached to the LAN91111.

This solution is OK - it only effects my board, the downside is that if 
this is a problem other face, it doesn't help anyone else.

Thoughts?

Thanks
-Robin

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

end of thread, other threads:[~2004-08-26 22:40 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-26 17:25 [U-Boot-Users] MAC address question Robin Getz
2004-08-26 19:17 ` Ladislav Michl
2004-08-26 19:38 ` Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2004-08-26 20:26 Robin Getz
2004-08-26 21:42 ` Wolfgang Denk
2004-08-26  8:30 Getz, Robin
2004-08-26  9:17 ` Ladislav Michl
2004-08-26 15:05   ` Wolfgang Denk
2004-08-26 16:02     ` Ladislav Michl
2004-08-26 15:03 ` Wolfgang Denk
2004-08-26 16:13   ` Ladislav Michl
2004-08-26 16:44     ` Wolfgang Denk
2004-08-26 17:10       ` Ladislav Michl
2004-08-26 19:22         ` Wolfgang Denk
2004-08-26 20:54           ` Ladislav Michl
2004-08-26 21:58             ` Wolfgang Denk
2004-08-26 22:40               ` Ladislav Michl

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