[U-Boot-Users] [PATCH] Implement general ULi 526x Ethernet driver support in U-boot

Zang Roy-r61911 tie-fei.zang at freescale.com
Thu Nov 15 11:56:15 CET 2007


On Wed, 2007-11-14 at 23:34, Tabi Timur wrote:
> Zang Roy-r61911 wrote:
> 
> > +     if (((u16 *) db->srom)[0] == 0xffff || ((u16 *) db->srom)[0]
> == 0)
> > +     /* SROM absent, so write MAC address to ID Table */
> > +             set_mac_addr(dev);
> > +     else {          /*Exist SROM*/
> > +             for (i = 0; i < 6; i++)
> > +                     dev->enetaddr[i] = db->srom[20 + i];
> > +     }
> 
> What is the difference between the ID table (IDT) and the SROM?  And
> why do we 
> not program the ID table if we have SROM?
ID table is register, SROM is SROM :-). If we have SROM for the chip, we
get the MAC address from it directly. There is no need to set ID table.
In kernel, the code also get the MAC address from SROM. The SROM is the
media. If there is no SROM, ID table is the media. kernel get the MAC
address from it.

> 
> BTW, where is the code that programs the MAC address *into* the
> IDT/SROM?  
This is not the function of the driver. Manufacture should do it.
> All 
> we have is code that reads *from* the IDT/SROM.  On the 8610, the MAC
> address is 
> stored in I2C EEPROM (address 0x57), 
That is correct. But there is still a bug in the EEPROM code.
> and so U-Boot will need to copy that into 
> the IDT/SROM *before* this driver runs.
No.
Kernel needs a MAC address.
The sequence to get MAC address on 8610 board:
If there is a SROM 
	Get it from SROM ( There is no SROM :-()
else if we can get from EEPROM
	Fails now, ( There is a byte shift, CRC error. will be fixed)
else
	get it from environment stored in Flash

Roy





More information about the U-Boot mailing list