Blackfin: unify net-related init code
Unify all of the net-related init code in the common Blackfin board init code to clean up the ifdef mess a bit. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
parent
c6ea30e52e
commit
8996d1608a
@ -291,6 +291,25 @@ void board_init_f(ulong bootflag)
|
|||||||
board_init_r((gd_t *) gd, 0x20000010);
|
board_init_r((gd_t *) gd, 0x20000010);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void board_net_init_r(bd_t *bd)
|
||||||
|
{
|
||||||
|
#ifdef CONFIG_CMD_NET
|
||||||
|
uchar enetaddr[6];
|
||||||
|
char *s;
|
||||||
|
|
||||||
|
if ((s = getenv("bootfile")) != NULL)
|
||||||
|
copy_filename(BootFile, s, sizeof(BootFile));
|
||||||
|
|
||||||
|
bd->bi_ip_addr = getenv_IPaddr("ipaddr");
|
||||||
|
|
||||||
|
printf("Net: ");
|
||||||
|
eth_initialize(gd->bd);
|
||||||
|
|
||||||
|
eth_getenv_enetaddr("ethaddr", enetaddr);
|
||||||
|
printf("MAC: %pM\n", enetaddr);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void board_init_r(gd_t * id, ulong dest_addr)
|
void board_init_r(gd_t * id, ulong dest_addr)
|
||||||
{
|
{
|
||||||
extern void malloc_bin_reloc(void);
|
extern void malloc_bin_reloc(void);
|
||||||
@ -349,22 +368,13 @@ void board_init_r(gd_t * id, ulong dest_addr)
|
|||||||
/* Initialize from environment */
|
/* Initialize from environment */
|
||||||
if ((s = getenv("loadaddr")) != NULL)
|
if ((s = getenv("loadaddr")) != NULL)
|
||||||
load_addr = simple_strtoul(s, NULL, 16);
|
load_addr = simple_strtoul(s, NULL, 16);
|
||||||
#ifdef CONFIG_CMD_NET
|
|
||||||
if ((s = getenv("bootfile")) != NULL)
|
|
||||||
copy_filename(BootFile, s, sizeof(BootFile));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(CONFIG_MISC_INIT_R)
|
#if defined(CONFIG_MISC_INIT_R)
|
||||||
/* miscellaneous platform dependent initialisations */
|
/* miscellaneous platform dependent initialisations */
|
||||||
misc_init_r();
|
misc_init_r();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_CMD_NET
|
board_net_init_r(bd);
|
||||||
/* IP Address */
|
|
||||||
bd->bi_ip_addr = getenv_IPaddr("ipaddr");
|
|
||||||
printf("Net: ");
|
|
||||||
eth_initialize(gd->bd);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
display_global_data();
|
display_global_data();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user