[U-Boot] [PATCH 09/12] da850: read MAC address from I2C EEPROM on AM18xx EVM

Wolfgang Denk wd at denx.de
Tue Aug 2 18:30:36 CEST 2011


Dear nagabhushana.netagunte at ti.com,

In message <1312299792-16415-10-git-send-email-nagabhushana.netagunte at ti.com> you wrote:
> From: Nagabhushana Netagunte <nagabhushana.netagunte at ti.com>
> 
> The AM18xx EVM contains MAC address in I2C EEPROM compared
> da850/omap-l138 Logic PD EVM which maintains in SPI flash. ...

Sorry, I cannot parse this. Please reformulate.

>  	if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
> -		/* Set Ethernet MAC address from EEPROM */
> -		ret = get_mac_addr_spi(addr);
> -		if (ret != 0)
> -			return -EINVAL;
> +		/* Read Ethernet MAC address from EEPROM */
> +		if (dvevm_read_mac_address(addr)) {
> +			/* Set Ethernet MAC address from EEPROM */
> +			davinci_sync_env_enetaddr(addr);
> +		} else {
> +			/* Set Ethernet MAC address from SPI flash */
> +			ret = get_mac_addr_spi(addr);
> +			if (ret != 0)
> +				return -EINVAL;
> +		}

This is a pretty bad idea, as it will slow down booting and may cause
undefined behaviour if anybody decides to put an EEPROm on a board
where you assume there is none.

Please find a different way to test which board you have (or provide a
separate configuration).  Implement this test just once, in early init
code, so that not each and every driver or feature as to test this
himself again and again.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Spock, did you see the looks on their faces?"
"Yes, Captain, a sort of vacant contentment."


More information about the U-Boot mailing list