
Dear Daniel Mack,
In message 20081203010154.GE2012@buzzloop.caiaq.de you wrote:
This adds CONFIG_NE2000_NOPROM. If set, the ethernet MAC address is taken from the environment variable 'ethaddr' and the NIC is configured accordingly. Needed for boards that don't have an EEPROM to store this setting permanently.
Signed-off-by: Daniel Mack daniel@caiaq.de
ne2000_base.c | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-)
Why do we need a special CONFIG_ option? is it not possible to detect (by software) that there is no EEPROM available, and auto-adjust?
Note that there is existing policy how to handle the situation that we have both a MAC address stored in some other storeage (like EEPROM on the NIC) and in the "ethaddr" environment variable (see for example drivers/net/cs8900.c). In the end, the code shall always only rely on the U-Boot environment settings.
The system will test if MAC addresses are set in EEPROM and in the envrionment; then it should behave as follows:
* If there is no MAC address in the EEPROM, then do nothing, i. e. rely on any previously existing envrionment settings.
* If there is a MAC address in the EEPROM, and ther eis no corresponding "ethaddr" environment variable defined, then initialize (setenv()) this variable with the value read from the EEPROM.
* If there is a MAC address in the EEPROM, and there is a value in the "ethaddr" environment variable, and both are identical, we use that value and everything is fine.
* If there is a MAC address in the EEPROM, and there is a value in the "ethaddr" environment variable, and both are different, we issue a warning "Warning: MAC addresses don't match: ... HW MAC address: ... "ethaddr" value: ..." and then use the value from the ENVIRONMENT.
Best regards,
Wolfgang Denk