boards: move board_get_enetaddr() into board-specific init
The environment is the canonical storage location of the mac address, so we're killing off the global data location and moving everything to querying the env directly. Rather than have the common ppc code have board-specific hooks, move the board_get_enetaddr() function into the board-specific init functions. Signed-off-by: Mike Frysinger <vapier@gentoo.org> CC: Ben Warren <biggerbadderben@gmail.com>
This commit is contained in:
parent
f11e6ff5b1
commit
d8d21e699d
|
@ -105,7 +105,7 @@ int checkboard (void)
|
||||||
* board_get_enetaddr -- Read the MAC Address in the I2C EEPROM
|
* board_get_enetaddr -- Read the MAC Address in the I2C EEPROM
|
||||||
*-----------------------------------------------------------------------------
|
*-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void board_get_enetaddr (uchar * enet)
|
static void board_get_enetaddr(uchar *enet)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char buff[256], *cp;
|
char buff[256], *cp;
|
||||||
|
@ -142,9 +142,19 @@ void board_get_enetaddr (uchar * enet)
|
||||||
enet[3] |= 0x80;
|
enet[3] |= 0x80;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
printf ("MAC address = %02x:%02x:%02x:%02x:%02x:%02x\n",
|
printf("MAC address = %pM\n", enet);
|
||||||
enet[0], enet[1], enet[2], enet[3], enet[4], enet[5]);
|
}
|
||||||
|
|
||||||
|
int misc_init_r(void)
|
||||||
|
{
|
||||||
|
uchar enetaddr[6];
|
||||||
|
|
||||||
|
if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
|
||||||
|
board_get_enetaddr(enetaddr);
|
||||||
|
eth_putenv_enetaddr("ethaddr", enetaddr);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rpxclassic_init (void)
|
void rpxclassic_init (void)
|
||||||
|
|
|
@ -241,7 +241,7 @@ static unsigned int get_reffreq (void)
|
||||||
return *((ulong *) packet->data);
|
return *((ulong *) packet->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void board_get_enetaddr (uchar * addr)
|
static void board_get_enetaddr(uchar *addr)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
vpd_packet_t *packet;
|
vpd_packet_t *packet;
|
||||||
|
@ -251,6 +251,18 @@ void board_get_enetaddr (uchar * addr)
|
||||||
addr[i] = packet->data[i];
|
addr[i] = packet->data[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int misc_init_r(void)
|
||||||
|
{
|
||||||
|
uchar enetaddr[6];
|
||||||
|
|
||||||
|
if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
|
||||||
|
board_get_enetaddr(enetaddr);
|
||||||
|
eth_putenv_enetaddr("ethaddr", enetaddr);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check Board Identity:
|
* Check Board Identity:
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -394,9 +394,8 @@ int is_pci_host(struct pci_controller *hose)
|
||||||
* mgmt mac address.
|
* mgmt mac address.
|
||||||
*
|
*
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static int macaddr_idx = 0;
|
|
||||||
|
|
||||||
void board_get_enetaddr (uchar * enet)
|
void board_get_enetaddr(int macaddr_idx, uchar *enet)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
unsigned short tmp;
|
unsigned short tmp;
|
||||||
|
@ -419,7 +418,6 @@ void board_get_enetaddr (uchar * enet)
|
||||||
tmp += 31;
|
tmp += 31;
|
||||||
memcpy(&enet[4], &tmp, 2);
|
memcpy(&enet[4], &tmp, 2);
|
||||||
|
|
||||||
macaddr_idx++;
|
|
||||||
} else {
|
} else {
|
||||||
enet[0] = 0x02;
|
enet[0] = 0x02;
|
||||||
enet[1] = 0x00;
|
enet[1] = 0x00;
|
||||||
|
|
|
@ -72,5 +72,6 @@ int sbcommon_get_master(void);
|
||||||
int sbcommon_secondary_present(void);
|
int sbcommon_secondary_present(void);
|
||||||
unsigned short sbcommon_get_serial_number(void);
|
unsigned short sbcommon_get_serial_number(void);
|
||||||
void sbcommon_fans(void);
|
void sbcommon_fans(void);
|
||||||
|
void board_get_enetaddr(int macaddr_idx, uchar *enet);
|
||||||
|
|
||||||
#endif /* __SBCOMMON_H__ */
|
#endif /* __SBCOMMON_H__ */
|
||||||
|
|
|
@ -354,6 +354,7 @@ int misc_init_r (void)
|
||||||
{
|
{
|
||||||
unsigned short sernum;
|
unsigned short sernum;
|
||||||
char envstr[255];
|
char envstr[255];
|
||||||
|
uchar enetaddr[6];
|
||||||
KAREF_FPGA_REGS_ST *karef_ps;
|
KAREF_FPGA_REGS_ST *karef_ps;
|
||||||
OFEM_FPGA_REGS_ST *ofem_ps;
|
OFEM_FPGA_REGS_ST *ofem_ps;
|
||||||
|
|
||||||
|
@ -408,6 +409,34 @@ int misc_init_r (void)
|
||||||
printf("fakeled is set. use 'setenv fakeled ; setenv bootdelay 5 ; saveenv' to recover\n");
|
printf("fakeled is set. use 'setenv fakeled ; setenv bootdelay 5 ; saveenv' to recover\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_HAS_ETH0
|
||||||
|
if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
|
||||||
|
board_get_enetaddr(0, enetaddr);
|
||||||
|
eth_putenv_enetaddr("ethaddr", enetaddr);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_HAS_ETH1
|
||||||
|
if (!eth_getenv_enetaddr("eth1addr", enetaddr)) {
|
||||||
|
board_get_enetaddr(1, enetaddr);
|
||||||
|
eth_putenv_enetaddr("eth1addr", enetaddr);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_HAS_ETH2
|
||||||
|
if (!eth_getenv_enetaddr("eth2addr", enetaddr)) {
|
||||||
|
board_get_enetaddr(2, enetaddr);
|
||||||
|
eth_putenv_enetaddr("eth2addr", enetaddr);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_HAS_ETH3
|
||||||
|
if (!eth_getenv_enetaddr("eth3addr", enetaddr)) {
|
||||||
|
board_get_enetaddr(3, enetaddr);
|
||||||
|
eth_putenv_enetaddr("eth3addr", enetaddr);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -321,6 +321,7 @@ int misc_init_r (void)
|
||||||
{
|
{
|
||||||
unsigned short sernum;
|
unsigned short sernum;
|
||||||
char envstr[255];
|
char envstr[255];
|
||||||
|
uchar enetaddr[6];
|
||||||
unsigned char opto_rev;
|
unsigned char opto_rev;
|
||||||
OPTO_FPGA_REGS_ST *opto_ps;
|
OPTO_FPGA_REGS_ST *opto_ps;
|
||||||
|
|
||||||
|
@ -379,6 +380,34 @@ int misc_init_r (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_HAS_ETH0
|
||||||
|
if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
|
||||||
|
board_get_enetaddr(0, enetaddr);
|
||||||
|
eth_putenv_enetaddr("ethaddr", enetaddr);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_HAS_ETH1
|
||||||
|
if (!eth_getenv_enetaddr("eth1addr", enetaddr)) {
|
||||||
|
board_get_enetaddr(1, enetaddr);
|
||||||
|
eth_putenv_enetaddr("eth1addr", enetaddr);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_HAS_ETH2
|
||||||
|
if (!eth_getenv_enetaddr("eth2addr", enetaddr)) {
|
||||||
|
board_get_enetaddr(2, enetaddr);
|
||||||
|
eth_putenv_enetaddr("eth2addr", enetaddr);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_HAS_ETH3
|
||||||
|
if (!eth_getenv_enetaddr("eth3addr", enetaddr)) {
|
||||||
|
board_get_enetaddr(3, enetaddr);
|
||||||
|
eth_putenv_enetaddr("eth3addr", enetaddr);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -258,7 +258,7 @@ int board_early_init_f (void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void board_get_enetaddr (uchar * addr)
|
static void board_get_enetaddr(uchar *addr)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
|
volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
|
||||||
|
@ -284,3 +284,15 @@ void board_get_enetaddr (uchar * addr)
|
||||||
|
|
||||||
cpm->cp_rccr = rccrtmp;
|
cpm->cp_rccr = rccrtmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int misc_init_r(void)
|
||||||
|
{
|
||||||
|
uchar enetaddr[6];
|
||||||
|
|
||||||
|
if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
|
||||||
|
board_get_enetaddr(enetaddr);
|
||||||
|
eth_putenv_enetaddr("ethaddr", enetaddr);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
|
@ -223,6 +223,18 @@ int board_early_init_r(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern void board_get_enetaddr(uchar *enetaddr);
|
||||||
|
int misc_init_r(void)
|
||||||
|
{
|
||||||
|
uchar enetaddr[6];
|
||||||
|
|
||||||
|
if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
|
||||||
|
board_get_enetaddr(enetaddr);
|
||||||
|
eth_putenv_enetaddr("ethaddr", enetaddr);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_RESET)
|
#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_RESET)
|
||||||
void init_ide_reset(void)
|
void init_ide_reset(void)
|
||||||
|
|
|
@ -335,29 +335,58 @@ ulong post_word_load (void)
|
||||||
* board_get_enetaddr -- Read the MAC Addresses in the I2C EEPROM
|
* board_get_enetaddr -- Read the MAC Addresses in the I2C EEPROM
|
||||||
*-----------------------------------------------------------------------------
|
*-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
static int enetaddr_num = 0;
|
static int read_i2c;
|
||||||
void board_get_enetaddr (uchar * enet)
|
static void board_get_enetaddr(uchar *enet)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
unsigned char buff[0x100], *cp;
|
unsigned char buff[0x100], *cp;
|
||||||
|
|
||||||
|
if (read_i2c)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Initialize I2C */
|
/* Initialize I2C */
|
||||||
i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
|
i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
|
||||||
|
|
||||||
/* Read 256 bytes in EEPROM */
|
/* Read 256 bytes in EEPROM */
|
||||||
i2c_read (0x50, 0, 1, buff, 0x100);
|
i2c_read (0x50, 0, 1, buff, 0x100);
|
||||||
|
|
||||||
if (enetaddr_num == 0) {
|
cp = &buff[0xF4];
|
||||||
cp = &buff[0xF4];
|
|
||||||
enetaddr_num = 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
cp = &buff[0xFA];
|
|
||||||
|
|
||||||
for (i = 0; i < 6; i++,cp++)
|
for (i = 0; i < 6; i++,cp++)
|
||||||
enet[i] = *cp;
|
enet[i] = *cp;
|
||||||
|
|
||||||
printf ("MAC address = %02x:%02x:%02x:%02x:%02x:%02x\n",
|
printf("MAC address = %pM\n", enet);
|
||||||
enet[0], enet[1], enet[2], enet[3], enet[4], enet[5]);
|
read_i2c = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int misc_init_r(void)
|
||||||
|
{
|
||||||
|
uchar enetaddr[6], i2c_enetaddr[6];
|
||||||
|
|
||||||
|
if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
|
||||||
|
board_get_enetaddr(i2c_enetaddr);
|
||||||
|
eth_putenv_enetaddr("ethaddr", i2c_enetaddr);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_HAS_ETH1
|
||||||
|
if (!eth_getenv_enetaddr("eth1addr", enetaddr)) {
|
||||||
|
board_get_enetaddr(i2c_enetaddr);
|
||||||
|
eth_putenv_enetaddr("eth1addr", i2c_enetaddr);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_HAS_ETH2
|
||||||
|
if (!eth_getenv_enetaddr("eth2addr", enetaddr)) {
|
||||||
|
board_get_enetaddr(i2c_enetaddr);
|
||||||
|
eth_putenv_enetaddr("eth2addr", i2c_enetaddr);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_HAS_ETH3
|
||||||
|
if (!eth_getenv_enetaddr("eth3addr", enetaddr)) {
|
||||||
|
board_get_enetaddr(i2c_enetaddr);
|
||||||
|
eth_putenv_enetaddr("eth3addr", i2c_enetaddr);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -352,13 +352,6 @@ void board_serial_init (void);
|
||||||
void board_ether_init (void);
|
void board_ether_init (void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_RPXCLASSIC) || defined(CONFIG_MBX) || \
|
|
||||||
defined(CONFIG_IAD210) || defined(CONFIG_XPEDITE1K) || \
|
|
||||||
defined(CONFIG_METROBOX) || defined(CONFIG_KAREF) || \
|
|
||||||
defined(CONFIG_V38B)
|
|
||||||
void board_get_enetaddr (uchar *addr);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_HERMES
|
#ifdef CONFIG_HERMES
|
||||||
/* $(BOARD)/hermes.c */
|
/* $(BOARD)/hermes.c */
|
||||||
void hermes_start_lxt980 (int speed);
|
void hermes_start_lxt980 (int speed);
|
||||||
|
|
|
@ -67,6 +67,7 @@
|
||||||
|
|
||||||
/* using this define saves us updating another source file */
|
/* using this define saves us updating another source file */
|
||||||
#define CONFIG_BOARD_EARLY_INIT_F 1
|
#define CONFIG_BOARD_EARLY_INIT_F 1
|
||||||
|
#define CONFIG_MISC_INIT_R
|
||||||
|
|
||||||
#undef CONFIG_BOOTARGS
|
#undef CONFIG_BOOTARGS
|
||||||
/* #define CONFIG_BOOTCOMMAND \
|
/* #define CONFIG_BOOTCOMMAND \
|
||||||
|
|
|
@ -50,6 +50,8 @@
|
||||||
#undef CONFIG_8xx_TFTP_MODE
|
#undef CONFIG_8xx_TFTP_MODE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define CONFIG_MISC_INIT_R
|
||||||
|
|
||||||
#define CONFIG_DRAM_SPEED (CONFIG_8xx_BUSCLOCK) /* MHz */
|
#define CONFIG_DRAM_SPEED (CONFIG_8xx_BUSCLOCK) /* MHz */
|
||||||
#define CONFIG_BOOTCOMMAND "bootm FE020000" /* autoboot command */
|
#define CONFIG_BOOTCOMMAND "bootm FE020000" /* autoboot command */
|
||||||
#define CONFIG_BOOTARGS " "
|
#define CONFIG_BOOTARGS " "
|
||||||
|
|
|
@ -53,6 +53,7 @@
|
||||||
#define CONFIG_SYS_DISCOVER_PHY 1
|
#define CONFIG_SYS_DISCOVER_PHY 1
|
||||||
#define CONFIG_MII 1
|
#define CONFIG_MII 1
|
||||||
#endif /* CONFIG_FEC_ENET */
|
#endif /* CONFIG_FEC_ENET */
|
||||||
|
#define CONFIG_MISC_INIT_R
|
||||||
|
|
||||||
/* Video console (graphic: Epson SED13806 on ECCX board, no keyboard */
|
/* Video console (graphic: Epson SED13806 on ECCX board, no keyboard */
|
||||||
#if 1
|
#if 1
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
#define CONFIG_440 1
|
#define CONFIG_440 1
|
||||||
#define CONFIG_440GX 1 /* 440 GX */
|
#define CONFIG_440GX 1 /* 440 GX */
|
||||||
#define CONFIG_BOARD_EARLY_INIT_F 1 /* Call board_pre_init */
|
#define CONFIG_BOARD_EARLY_INIT_F 1 /* Call board_pre_init */
|
||||||
|
#define CONFIG_MISC_INIT_R
|
||||||
#undef CONFIG_SYS_DRAM_TEST /* Disable-takes long time! */
|
#undef CONFIG_SYS_DRAM_TEST /* Disable-takes long time! */
|
||||||
#define CONFIG_SYS_CLK_FREQ 33333333 /* external freq to pll */
|
#define CONFIG_SYS_CLK_FREQ 33333333 /* external freq to pll */
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
|
|
||||||
#define CONFIG_BOARD_EARLY_INIT_R 1 /* do board-specific init */
|
#define CONFIG_BOARD_EARLY_INIT_R 1 /* do board-specific init */
|
||||||
#define CONFIG_BOARD_EARLY_INIT_F 1 /* do board-specific init */
|
#define CONFIG_BOARD_EARLY_INIT_F 1 /* do board-specific init */
|
||||||
|
#define CONFIG_MISC_INIT_R
|
||||||
|
|
||||||
#define CONFIG_SYS_XLB_PIPELINING 1 /* gives better performance */
|
#define CONFIG_SYS_XLB_PIPELINING 1 /* gives better performance */
|
||||||
|
|
||||||
|
|
|
@ -879,14 +879,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
s = getenv ("ethaddr");
|
s = getenv ("ethaddr");
|
||||||
#if defined (CONFIG_MBX) || \
|
|
||||||
defined (CONFIG_RPXCLASSIC) || \
|
|
||||||
defined(CONFIG_IAD210) || \
|
|
||||||
defined(CONFIG_V38B)
|
|
||||||
if (s == NULL)
|
|
||||||
board_get_enetaddr (bd->bi_enetaddr);
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
for (i = 0; i < 6; ++i) {
|
for (i = 0; i < 6; ++i) {
|
||||||
bd->bi_enetaddr[i] = s ? simple_strtoul (s, &e, 16) : 0;
|
bd->bi_enetaddr[i] = s ? simple_strtoul (s, &e, 16) : 0;
|
||||||
if (s)
|
if (s)
|
||||||
|
@ -914,11 +906,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
|
||||||
/* handle the 3rd ethernet address */
|
/* handle the 3rd ethernet address */
|
||||||
|
|
||||||
s = getenv ("eth2addr");
|
s = getenv ("eth2addr");
|
||||||
#if defined(CONFIG_XPEDITE1K) || defined(CONFIG_METROBOX) || defined(CONFIG_KAREF)
|
|
||||||
if (s == NULL)
|
|
||||||
board_get_enetaddr(bd->bi_enet2addr);
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
for (i = 0; i < 6; ++i) {
|
for (i = 0; i < 6; ++i) {
|
||||||
bd->bi_enet2addr[i] = s ? simple_strtoul (s, &e, 16) : 0;
|
bd->bi_enet2addr[i] = s ? simple_strtoul (s, &e, 16) : 0;
|
||||||
if (s)
|
if (s)
|
||||||
|
@ -929,11 +916,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
|
||||||
#ifdef CONFIG_HAS_ETH3
|
#ifdef CONFIG_HAS_ETH3
|
||||||
/* handle 4th ethernet address */
|
/* handle 4th ethernet address */
|
||||||
s = getenv("eth3addr");
|
s = getenv("eth3addr");
|
||||||
#if defined(CONFIG_XPEDITE1K) || defined(CONFIG_METROBOX) || defined(CONFIG_KAREF)
|
|
||||||
if (s == NULL)
|
|
||||||
board_get_enetaddr(bd->bi_enet3addr);
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
for (i = 0; i < 6; ++i) {
|
for (i = 0; i < 6; ++i) {
|
||||||
bd->bi_enet3addr[i] = s ? simple_strtoul (s, &e, 16) : 0;
|
bd->bi_enet3addr[i] = s ? simple_strtoul (s, &e, 16) : 0;
|
||||||
if (s)
|
if (s)
|
||||||
|
@ -944,11 +926,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
|
||||||
#ifdef CONFIG_HAS_ETH4
|
#ifdef CONFIG_HAS_ETH4
|
||||||
/* handle 5th ethernet address */
|
/* handle 5th ethernet address */
|
||||||
s = getenv("eth4addr");
|
s = getenv("eth4addr");
|
||||||
#if defined(CONFIG_XPEDITE1K) || defined(CONFIG_METROBOX) || defined(CONFIG_KAREF)
|
|
||||||
if (s == NULL)
|
|
||||||
board_get_enetaddr(bd->bi_enet4addr);
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
for (i = 0; i < 6; ++i) {
|
for (i = 0; i < 6; ++i) {
|
||||||
bd->bi_enet4addr[i] = s ? simple_strtoul (s, &e, 16) : 0;
|
bd->bi_enet4addr[i] = s ? simple_strtoul (s, &e, 16) : 0;
|
||||||
if (s)
|
if (s)
|
||||||
|
@ -959,11 +936,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
|
||||||
#ifdef CONFIG_HAS_ETH5
|
#ifdef CONFIG_HAS_ETH5
|
||||||
/* handle 6th ethernet address */
|
/* handle 6th ethernet address */
|
||||||
s = getenv("eth5addr");
|
s = getenv("eth5addr");
|
||||||
#if defined(CONFIG_XPEDITE1K) || defined(CONFIG_METROBOX) || defined(CONFIG_KAREF)
|
|
||||||
if (s == NULL)
|
|
||||||
board_get_enetaddr(bd->bi_enet5addr);
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
for (i = 0; i < 6; ++i) {
|
for (i = 0; i < 6; ++i) {
|
||||||
bd->bi_enet5addr[i] = s ? simple_strtoul (s, &e, 16) : 0;
|
bd->bi_enet5addr[i] = s ? simple_strtoul (s, &e, 16) : 0;
|
||||||
if (s)
|
if (s)
|
||||||
|
|
Loading…
Reference in New Issue