Skip to content
Snippets Groups Projects
Commit fff18bee authored by Harald Krapfenbauer's avatar Harald Krapfenbauer Committed by Mike Frysinger
Browse files

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: default avatarHarald Krapfenbauer <harald.krapfenbauer@bluetechnix.com>
Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
parent 7ed998f6
No related branches found
No related tags found
No related merge requests found
...@@ -24,27 +24,37 @@ int checkboard(void) ...@@ -24,27 +24,37 @@ int checkboard(void)
return 0; return 0;
} }
#ifdef CONFIG_BFIN_MAC static void board_init_enetaddr(char *var)
static void board_init_enetaddr(uchar *mac_addr)
{ {
puts("Warning: Generating 'random' MAC address\n"); #ifdef CONFIG_NET_MULTI
bfin_gen_rand_mac(mac_addr); uchar enetaddr[6];
eth_setenv_enetaddr("ethaddr", mac_addr);
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) 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) int misc_init_r(void)
{ {
#ifdef CONFIG_BFIN_MAC board_init_enetaddr("ethaddr");
uchar enetaddr[6]; board_init_enetaddr("eth1addr");
if (!eth_getenv_enetaddr("ethaddr", enetaddr))
board_init_enetaddr(enetaddr);
#endif
gpio_cfi_flash_init(); gpio_cfi_flash_init();
......
...@@ -24,34 +24,37 @@ int checkboard(void) ...@@ -24,34 +24,37 @@ int checkboard(void)
return 0; return 0;
} }
#ifdef CONFIG_BFIN_MAC static void board_init_enetaddr(char *var)
static void board_init_enetaddr(uchar *mac_addr)
{ {
puts("Warning: Generating 'random' MAC address\n"); #ifdef CONFIG_NET_MULTI
bfin_gen_rand_mac(mac_addr); uchar enetaddr[6];
eth_setenv_enetaddr("ethaddr", mac_addr);
}
int board_eth_init(bd_t *bis) if (eth_getenv_enetaddr(var, enetaddr))
{ return;
return bfin_EMAC_initialize(bis);
} printf("Warning: %s: generating 'random' MAC address\n", var);
bfin_gen_rand_mac(enetaddr);
eth_setenv_enetaddr(var, enetaddr);
#endif #endif
}
#ifdef CONFIG_SMC911X #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) int board_eth_init(bd_t *bis)
{ {
return smc911x_initialize(0, CONFIG_SMC911X_BASE); /* 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) int misc_init_r(void)
{ {
#ifdef CONFIG_BFIN_MAC board_init_enetaddr("ethaddr");
uchar enetaddr[6]; board_init_enetaddr("eth1addr");
if (!eth_getenv_enetaddr("ethaddr", enetaddr))
board_init_enetaddr(enetaddr);
#endif
gpio_cfi_flash_init(); gpio_cfi_flash_init();
......
...@@ -24,27 +24,37 @@ int checkboard(void) ...@@ -24,27 +24,37 @@ int checkboard(void)
return 0; return 0;
} }
#ifdef CONFIG_BFIN_MAC static void board_init_enetaddr(char *var)
static void board_init_enetaddr(uchar *mac_addr)
{ {
puts("Warning: Generating 'random' MAC address\n"); #ifdef CONFIG_NET_MULTI
bfin_gen_rand_mac(mac_addr); uchar enetaddr[6];
eth_setenv_enetaddr("ethaddr", mac_addr);
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) 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) int misc_init_r(void)
{ {
#ifdef CONFIG_BFIN_MAC board_init_enetaddr("ethaddr");
uchar enetaddr[6]; board_init_enetaddr("eth1addr");
if (!eth_getenv_enetaddr("ethaddr", enetaddr))
board_init_enetaddr(enetaddr);
#endif
gpio_cfi_flash_init(); gpio_cfi_flash_init();
......
...@@ -65,6 +65,9 @@ ...@@ -65,6 +65,9 @@
#ifndef __ADSPBF534__ #ifndef __ADSPBF534__
#define ADI_CMDS_NETWORK 1 #define ADI_CMDS_NETWORK 1
#define CONFIG_BFIN_MAC #define CONFIG_BFIN_MAC
#define CONFIG_SMC911X 1
#define CONFIG_SMC911X_BASE 0x20308000
#define CONFIG_SMC911X_16_BIT
#define CONFIG_NETCONSOLE 1 #define CONFIG_NETCONSOLE 1
#define CONFIG_NET_MULTI 1 #define CONFIG_NET_MULTI 1
#endif #endif
......
...@@ -63,11 +63,11 @@ ...@@ -63,11 +63,11 @@
*/ */
#ifndef __ADSPBF534__ #ifndef __ADSPBF534__
#define ADI_CMDS_NETWORK 1 #define ADI_CMDS_NETWORK 1
#define CONFIG_NET_MULTI #define CONFIG_SMC911X 1
/* The next 3 lines are for use with SMSC on EXT-BF5xx-USB-ETH2 */ #define CONFIG_SMC911X_BASE 0x20308000
#define CONFIG_SMC911X 1
#define CONFIG_SMC911X_BASE 0x24000000
#define CONFIG_SMC911X_16_BIT #define CONFIG_SMC911X_16_BIT
#define CONFIG_NETCONSOLE 1
#define CONFIG_NET_MULTI 1
#endif #endif
#define CONFIG_HOSTNAME cm-bf537u #define CONFIG_HOSTNAME cm-bf537u
/* Uncomment next line to use fixed MAC address */ /* Uncomment next line to use fixed MAC address */
......
...@@ -62,10 +62,12 @@ ...@@ -62,10 +62,12 @@
/* /*
* Network Settings * Network Settings
*/ */
/* TCM-BF537E has no PHY on it, but EXT-BF5xx-USB/Ethernet board has */
#ifndef __ADSPBF534__ #ifndef __ADSPBF534__
#define ADI_CMDS_NETWORK 1 #define ADI_CMDS_NETWORK 1
#define CONFIG_BFIN_MAC #define CONFIG_BFIN_MAC
#define CONFIG_SMC911X 1
#define CONFIG_SMC911X_BASE 0x20308000
#define CONFIG_SMC911X_16_BIT
#define CONFIG_NETCONSOLE 1 #define CONFIG_NETCONSOLE 1
#define CONFIG_NET_MULTI 1 #define CONFIG_NET_MULTI 1
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment