From bea3f28d285942bf3f7ab339ce85178ded544225 Mon Sep 17 00:00:00 2001 From: Haiying Wang Date: Wed, 12 Jul 2006 10:48:05 -0400 Subject: Add support for reading and writing mac addresses to or from ID EEPROM. Added code for reading and writing Mac addresses to/from ID EEPROM(0x57). With attached patch, we can use command "mac/mac read/mac save/" to read and write EEPROM under u-boot prompt. U-boot will calculate the checksum of EEPROM while bootup, if it is right, then u-boot will check whether the mac address of eTSEC0/1/2/3 is availalbe (non-zero). If there is mac address availabe in EEPROM, u-boot will use it, otherewise, u-boot will use the mac address defined in MPC8641HPCN.h. This matches the requirement to set unique mac address for each TSEC port. Signed-off-by: Haiying Wang Signed-off-by: York Sun --- include/common.h | 3 +++ include/configs/MPC8641HPCN.h | 2 ++ 2 files changed, 5 insertions(+) (limited to 'include') diff --git a/include/common.h b/include/common.h index 83ccf7c987..7e54da93bf 100644 --- a/include/common.h +++ b/include/common.h @@ -197,6 +197,9 @@ int checkdram (void); char * strmhz(char *buf, long hz); int last_stage_init(void); extern ulong monitor_flash_len; +#ifdef CFG_ID_EEPROM +int mac_read_from_eeprom(void); +#endif /* common/flash.c */ void flash_perror (int); diff --git a/include/configs/MPC8641HPCN.h b/include/configs/MPC8641HPCN.h index aca2ecc234..7e91e644b1 100644 --- a/include/configs/MPC8641HPCN.h +++ b/include/configs/MPC8641HPCN.h @@ -146,6 +146,8 @@ #define CFG_DDR_CS5_BNDS 0x00000FFF /* Not done */ #endif +#define CFG_ID_EEPROM 1 +#define ID_EEPROM_ADDR 0x57 /* * In MPC8641HPCN, allocate 16MB flash spaces at fe000000 and ff000000. -- cgit