summaryrefslogtreecommitdiff
path: root/board/cm-bf537e/cm-bf537e.c
diff options
context:
space:
mode:
authorHarald Krapfenbauer <harald.krapfenbauer@bluetechnix.com>2011-05-17 15:25:54 -0400
committerMike Frysinger <vapier@gentoo.org>2011-07-12 02:17:45 -0400
commitfff18bee7ed5973093d809aaa71d71eb2ed63a19 (patch)
tree55d6af4609708e8eead6ba1646b20e16495835c8 /board/cm-bf537e/cm-bf537e.c
parent7ed998f629d00abb2aa97805346d4d2e9dbe71d7 (diff)
downloadu-boot-imx-fff18bee7ed5973093d809aaa71d71eb2ed63a19.zip
u-boot-imx-fff18bee7ed5973093d809aaa71d71eb2ed63a19.tar.gz
u-boot-imx-fff18bee7ed5973093d809aaa71d71eb2ed63a19.tar.bz2
Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: update network settings
These boards can have an addon card plugged onto them, so enable support for it. Signed-off-by: Harald Krapfenbauer <harald.krapfenbauer@bluetechnix.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'board/cm-bf537e/cm-bf537e.c')
-rw-r--r--board/cm-bf537e/cm-bf537e.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/board/cm-bf537e/cm-bf537e.c b/board/cm-bf537e/cm-bf537e.c
index 1e350dc..38dbc6e 100644
--- a/board/cm-bf537e/cm-bf537e.c
+++ b/board/cm-bf537e/cm-bf537e.c
@@ -24,27 +24,37 @@ int checkboard(void)
return 0;
}
-#ifdef CONFIG_BFIN_MAC
-static void board_init_enetaddr(uchar *mac_addr)
+static void board_init_enetaddr(char *var)
{
- puts("Warning: Generating 'random' MAC address\n");
- bfin_gen_rand_mac(mac_addr);
- eth_setenv_enetaddr("ethaddr", mac_addr);
+#ifdef CONFIG_NET_MULTI
+ uchar enetaddr[6];
+
+ if (eth_getenv_enetaddr(var, enetaddr))
+ return;
+
+ printf("Warning: %s: generating 'random' MAC address\n", var);
+ bfin_gen_rand_mac(enetaddr);
+ eth_setenv_enetaddr(var, enetaddr);
+#endif
}
+#ifndef CONFIG_BFIN_MAC
+# define bfin_EMAC_initialize(x) 1
+#endif
+#ifndef CONFIG_SMC911X
+# define smc911x_initialize(n, x) 1
+#endif
int board_eth_init(bd_t *bis)
{
- return bfin_EMAC_initialize(bis);
+ /* return ok if at least 1 eth device works */
+ return bfin_EMAC_initialize(bis) &
+ smc911x_initialize(0, CONFIG_SMC911X_BASE);
}
-#endif
int misc_init_r(void)
{
-#ifdef CONFIG_BFIN_MAC
- uchar enetaddr[6];
- if (!eth_getenv_enetaddr("ethaddr", enetaddr))
- board_init_enetaddr(enetaddr);
-#endif
+ board_init_enetaddr("ethaddr");
+ board_init_enetaddr("eth1addr");
gpio_cfi_flash_init();