[U-Boot-Users] bootloader MAC

NZG ngustavson at emacinc.com
Fri Jun 9 19:58:05 CEST 2006


On Friday 09 June 2006 11:56 am, Wolfgang Denk wrote:
> Otherwise you should have  discovered  the  e100_eeprom_read()  resp.
> read_eeprom()  functions  in  these  drivers which do - guess what? -
> read the MAC address from EEPROM.
>
> The cards you used as  example  actually  *do*  have  code  in  their
> drivers  to  read the MAC address from the EEPROM and program it into
> the controller. You see?
I'm going through the e100.c code now.
The drivers do have code to read and write the MAC address, but I don't see 
any reference to them actually doing this during normal operation.
This sort of thing may give you the capability to write the MAC into the 
device if ifconfig, but that would be something the OEM would do once and 
then leave alone.

During diagnostics, 

There is a section fo code in e100 that reads out the MAC:

    memcpy(netdev->dev_addr, nic->eeprom, ETH_ALEN);
         if(!is_valid_ether_addr(netdev->dev_addr)) {
                 DPRINTK(PROBE, ERR, "Invalid MAC address from "
                         "EEPROM, aborting.\n");
                 err = -EAGAIN;
                 goto err_out_free;
         }

But this reads out the MAC into a net device, registering it's MAC with the 
OS, not loading into the physical device.

(on page 35 of the 82559ER Fast Ethernet PCI Controller data sheet)
The 82559ER performs an automatic read of seven words (0H, 1H, 2H, AH, Bh, Ch 
and DH) of the
EEPROM after the de-assertion of Reset.

(0H, 1H, 2H is the MAC)

Haven't been through the Realtek code yet.
But I suspect it's something similar.

NZG










More information about the U-Boot mailing list