[U-Boot] [PATCH 3/3] net: Remove all calls to net_random_ethaddr()
Joe Hershberger
joe.hershberger at ni.com
Mon May 4 21:55:15 CEST 2015
Remove the calls to net_random_ethaddr() that some boards and some
drivers are calling. This is now implemented inside of net/eth.c
Enable the feature for all boards that previously enabled it.
Signed-off-by: Joe Hershberger <joe.hershberger at ni.com>
---
There are a few seemingly unrelated changes to the defconfig files in
this patch. These result from actually running savedefconfig to generate
the defconfig instead of editing them manually.
board/bct-brettl2/bct-brettl2.c | 13 ------------
board/bf518f-ezbrd/bf518f-ezbrd.c | 28 ++++++------------------
board/bf526-ezbrd/bf526-ezbrd.c | 28 ++++++------------------
board/bf527-ezkit/bf527-ezkit.c | 9 +-------
board/bf537-minotaur/bf537-minotaur.c | 18 ----------------
board/bf537-pnav/bf537-pnav.c | 18 ----------------
board/bf537-srv1/bf537-srv1.c | 19 -----------------
board/bf537-stamp/bf537-stamp.c | 28 ++++++------------------
board/buffalo/lsxl/lsxl.c | 10 ---------
board/cm-bf527/cm-bf527.c | 11 +---------
board/cm-bf537e/cm-bf537e.c | 15 -------------
board/cm-bf537u/cm-bf537u.c | 15 -------------
board/dnp5370/dnp5370.c | 28 ++++++------------------
board/ip04/ip04.c | 12 -----------
board/tcm-bf518/tcm-bf518.c | 40 -----------------------------------
board/tcm-bf537/tcm-bf537.c | 15 -------------
configs/bct-brettl2_defconfig | 3 ++-
configs/bf518f-ezbrd_defconfig | 2 ++
configs/bf526-ezbrd_defconfig | 2 ++
configs/bf527-ezkit_defconfig | 2 ++
configs/bf537-minotaur_defconfig | 2 ++
configs/bf537-pnav_defconfig | 2 ++
configs/bf537-srv1_defconfig | 2 ++
configs/bf537-stamp_defconfig | 2 ++
configs/cm-bf527_defconfig | 2 ++
configs/cm-bf537e_defconfig | 2 ++
configs/cm-bf537u_defconfig | 2 ++
configs/dnp5370_defconfig | 2 ++
configs/ip04_defconfig | 2 ++
configs/lschlv2_defconfig | 4 +++-
configs/lsxhl_defconfig | 4 +++-
configs/tcm-bf518_defconfig | 2 ++
configs/tcm-bf537_defconfig | 2 ++
drivers/net/dm9000x.c | 6 ------
drivers/net/ftmac110.c | 3 ---
include/configs/lsxl.h | 1 -
36 files changed, 66 insertions(+), 290 deletions(-)
diff --git a/board/bct-brettl2/bct-brettl2.c b/board/bct-brettl2/bct-brettl2.c
index 1f0dfb4..bf7cd62 100644
--- a/board/bct-brettl2/bct-brettl2.c
+++ b/board/bct-brettl2/bct-brettl2.c
@@ -29,13 +29,6 @@ int checkboard(void)
}
#ifdef CONFIG_BFIN_MAC
-static void board_init_enetaddr(uchar *mac_addr)
-{
- puts("Warning: Generating 'random' MAC address\n");
- net_random_ethaddr(mac_addr);
- eth_setenv_enetaddr("ethaddr", mac_addr);
-}
-
int board_eth_init(bd_t *bis)
{
int retry = 3;
@@ -107,12 +100,6 @@ static void turn_leds_off(void)
/* miscellaneous platform dependent initialisations */
int misc_init_r(void)
{
-#ifdef CONFIG_BFIN_MAC
- uchar enetaddr[6];
- if (!eth_getenv_enetaddr("ethaddr", enetaddr))
- board_init_enetaddr(enetaddr);
-#endif
-
gpio_cfi_flash_init();
init_tlv320aic31();
init_mute_pin();
diff --git a/board/bf518f-ezbrd/bf518f-ezbrd.c b/board/bf518f-ezbrd/bf518f-ezbrd.c
index 8ecfbb2..bf4a7db 100644
--- a/board/bf518f-ezbrd/bf518f-ezbrd.c
+++ b/board/bf518f-ezbrd/bf518f-ezbrd.c
@@ -29,28 +29,14 @@ int checkboard(void)
#if defined(CONFIG_BFIN_MAC)
static void board_init_enetaddr(uchar *mac_addr)
{
-#ifdef CONFIG_SYS_NO_FLASH
-# define USE_MAC_IN_FLASH 0
-#else
-# define USE_MAC_IN_FLASH 1
-#endif
- bool valid_mac = false;
-
- if (USE_MAC_IN_FLASH) {
- /* we cram the MAC in the last flash sector */
- uchar *board_mac_addr = (uchar *)0x203F0096;
- if (is_valid_ethaddr(board_mac_addr)) {
- memcpy(mac_addr, board_mac_addr, 6);
- valid_mac = true;
- }
- }
-
- if (!valid_mac) {
- puts("Warning: Generating 'random' MAC address\n");
- net_random_ethaddr(mac_addr);
+#ifndef CONFIG_SYS_NO_FLASH
+ /* we cram the MAC in the last flash sector */
+ uchar *board_mac_addr = (uchar *)0x203F0096;
+ if (is_valid_ethaddr(board_mac_addr)) {
+ memcpy(mac_addr, board_mac_addr, 6);
+ eth_setenv_enetaddr("ethaddr", mac_addr);
}
-
- eth_setenv_enetaddr("ethaddr", mac_addr);
+#endif
}
/* Only the first run of boards had a KSZ switch */
diff --git a/board/bf526-ezbrd/bf526-ezbrd.c b/board/bf526-ezbrd/bf526-ezbrd.c
index 0a88491..db1ee28 100644
--- a/board/bf526-ezbrd/bf526-ezbrd.c
+++ b/board/bf526-ezbrd/bf526-ezbrd.c
@@ -26,28 +26,14 @@ int checkboard(void)
#ifdef CONFIG_BFIN_MAC
static void board_init_enetaddr(uchar *mac_addr)
{
-#ifdef CONFIG_SYS_NO_FLASH
-# define USE_MAC_IN_FLASH 0
-#else
-# define USE_MAC_IN_FLASH 1
-#endif
- bool valid_mac = false;
-
- if (USE_MAC_IN_FLASH) {
- /* we cram the MAC in the last flash sector */
- uchar *board_mac_addr = (uchar *)0x203F0096;
- if (is_valid_ethaddr(board_mac_addr)) {
- memcpy(mac_addr, board_mac_addr, 6);
- valid_mac = true;
- }
- }
-
- if (!valid_mac) {
- puts("Warning: Generating 'random' MAC address\n");
- net_random_ethaddr(mac_addr);
+#ifndef CONFIG_SYS_NO_FLASH
+ /* we cram the MAC in the last flash sector */
+ uchar *board_mac_addr = (uchar *)0x203F0096;
+ if (is_valid_ethaddr(board_mac_addr)) {
+ memcpy(mac_addr, board_mac_addr, 6);
+ eth_setenv_enetaddr("ethaddr", mac_addr);
}
-
- eth_setenv_enetaddr("ethaddr", mac_addr);
+#endif
}
int board_eth_init(bd_t *bis)
diff --git a/board/bf527-ezkit/bf527-ezkit.c b/board/bf527-ezkit/bf527-ezkit.c
index 257775f..d3e660d 100644
--- a/board/bf527-ezkit/bf527-ezkit.c
+++ b/board/bf527-ezkit/bf527-ezkit.c
@@ -41,15 +41,8 @@ static void board_init_enetaddr(uchar *mac_addr)
mac_addr[ret] = otp_mac_p[5 - ret];
if (is_valid_ethaddr(mac_addr))
- valid_mac = true;
+ eth_setenv_enetaddr("ethaddr", mac_addr);
}
-
- if (!valid_mac) {
- puts("Warning: Generating 'random' MAC address\n");
- net_random_ethaddr(mac_addr);
- }
-
- eth_setenv_enetaddr("ethaddr", mac_addr);
}
int board_eth_init(bd_t *bis)
diff --git a/board/bf537-minotaur/bf537-minotaur.c b/board/bf537-minotaur/bf537-minotaur.c
index 71b4293..9312216 100644
--- a/board/bf537-minotaur/bf537-minotaur.c
+++ b/board/bf537-minotaur/bf537-minotaur.c
@@ -23,26 +23,8 @@ int checkboard(void)
}
#ifdef CONFIG_BFIN_MAC
-static void board_init_enetaddr(uchar *mac_addr)
-{
- puts("Warning: Generating 'random' MAC address\n");
- net_random_ethaddr(mac_addr);
- eth_setenv_enetaddr("ethaddr", mac_addr);
-}
-
int board_eth_init(bd_t *bis)
{
return bfin_EMAC_initialize(bis);
}
#endif
-
-int misc_init_r(void)
-{
-#ifdef CONFIG_BFIN_MAC
- uchar enetaddr[6];
- if (!eth_getenv_enetaddr("ethaddr", enetaddr))
- board_init_enetaddr(enetaddr);
-#endif
-
- return 0;
-}
diff --git a/board/bf537-pnav/bf537-pnav.c b/board/bf537-pnav/bf537-pnav.c
index 93522df..6739fe1 100644
--- a/board/bf537-pnav/bf537-pnav.c
+++ b/board/bf537-pnav/bf537-pnav.c
@@ -23,26 +23,8 @@ int checkboard(void)
}
#ifdef CONFIG_BFIN_MAC
-static void board_init_enetaddr(uchar *mac_addr)
-{
- puts("Warning: Generating 'random' MAC address\n");
- net_random_ethaddr(mac_addr);
- eth_setenv_enetaddr("ethaddr", mac_addr);
-}
-
int board_eth_init(bd_t *bis)
{
return bfin_EMAC_initialize(bis);
}
#endif
-
-int misc_init_r(void)
-{
-#ifdef CONFIG_BFIN_MAC
- uchar enetaddr[6];
- if (!eth_getenv_enetaddr("ethaddr", enetaddr))
- board_init_enetaddr(enetaddr);
-#endif
-
- return 0;
-}
diff --git a/board/bf537-srv1/bf537-srv1.c b/board/bf537-srv1/bf537-srv1.c
index 6581028..f0de7ff 100644
--- a/board/bf537-srv1/bf537-srv1.c
+++ b/board/bf537-srv1/bf537-srv1.c
@@ -22,27 +22,8 @@ int checkboard(void)
return 0;
}
-#ifdef CONFIG_BFIN_MAC
-static void board_init_enetaddr(uchar *mac_addr)
-{
- puts("Warning: Generating 'random' MAC address\n");
- net_random_ethaddr(mac_addr);
- eth_setenv_enetaddr("ethaddr", mac_addr);
-}
-
int board_eth_init(bd_t *bis)
{
return bfin_EMAC_initialize(bis);
}
#endif
-
-int misc_init_r(void)
-{
-#ifdef CONFIG_BFIN_MAC
- uchar enetaddr[6];
- if (!eth_getenv_enetaddr("ethaddr", enetaddr))
- board_init_enetaddr(enetaddr);
-#endif
-
- return 0;
-}
diff --git a/board/bf537-stamp/bf537-stamp.c b/board/bf537-stamp/bf537-stamp.c
index 66e5492..85d41d0 100644
--- a/board/bf537-stamp/bf537-stamp.c
+++ b/board/bf537-stamp/bf537-stamp.c
@@ -29,28 +29,14 @@ int checkboard(void)
#ifdef CONFIG_BFIN_MAC
static void board_init_enetaddr(uchar *mac_addr)
{
-#ifdef CONFIG_SYS_NO_FLASH
-# define USE_MAC_IN_FLASH 0
-#else
-# define USE_MAC_IN_FLASH 1
-#endif
- bool valid_mac = false;
-
- if (USE_MAC_IN_FLASH) {
- /* we cram the MAC in the last flash sector */
- uchar *board_mac_addr = (uchar *)0x203F0000;
- if (is_valid_ethaddr(board_mac_addr)) {
- memcpy(mac_addr, board_mac_addr, 6);
- valid_mac = true;
- }
- }
-
- if (!valid_mac) {
- puts("Warning: Generating 'random' MAC address\n");
- net_random_ethaddr(mac_addr);
+#ifndef CONFIG_SYS_NO_FLASH
+ /* we cram the MAC in the last flash sector */
+ uchar *board_mac_addr = (uchar *)0x203F0000;
+ if (is_valid_ethaddr(board_mac_addr)) {
+ memcpy(mac_addr, board_mac_addr, 6);
+ eth_setenv_enetaddr("ethaddr", mac_addr);
}
-
- eth_setenv_enetaddr("ethaddr", mac_addr);
+#endif
}
int board_eth_init(bd_t *bis)
diff --git a/board/buffalo/lsxl/lsxl.c b/board/buffalo/lsxl/lsxl.c
index 487875c..45dd788 100644
--- a/board/buffalo/lsxl/lsxl.c
+++ b/board/buffalo/lsxl/lsxl.c
@@ -230,16 +230,6 @@ static void rescue_mode(void)
uchar enetaddr[6];
printf("Entering rescue mode..\n");
-#ifdef CONFIG_RANDOM_MACADDR
- if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
- net_random_ethaddr(enetaddr);
- if (eth_setenv_enetaddr("ethaddr", enetaddr)) {
- printf("Failed to set ethernet address\n");
- set_led(LED_ALARM_BLINKING);
- return;
- }
- }
-#endif
setenv("bootsource", "rescue");
}
diff --git a/board/cm-bf527/cm-bf527.c b/board/cm-bf527/cm-bf527.c
index 2871fa2..3186c67 100644
--- a/board/cm-bf527/cm-bf527.c
+++ b/board/cm-bf527/cm-bf527.c
@@ -26,8 +26,6 @@ int checkboard(void)
#ifdef CONFIG_BFIN_MAC
static void board_init_enetaddr(uchar *mac_addr)
{
- bool valid_mac = false;
-
/* the MAC is stored in OTP memory page 0xDF */
uint32_t ret;
uint64_t otp_mac;
@@ -40,15 +38,8 @@ static void board_init_enetaddr(uchar *mac_addr)
mac_addr[ret] = otp_mac_p[5 - ret];
if (is_valid_ethaddr(mac_addr))
- valid_mac = true;
- }
-
- if (!valid_mac) {
- puts("Warning: Generating 'random' MAC address\n");
- net_random_ethaddr(mac_addr);
+ eth_setenv_enetaddr("ethaddr", mac_addr);
}
-
- eth_setenv_enetaddr("ethaddr", mac_addr);
}
int board_eth_init(bd_t *bis)
diff --git a/board/cm-bf537e/cm-bf537e.c b/board/cm-bf537e/cm-bf537e.c
index 902611e..57c72a2 100644
--- a/board/cm-bf537e/cm-bf537e.c
+++ b/board/cm-bf537e/cm-bf537e.c
@@ -23,18 +23,6 @@ int checkboard(void)
return 0;
}
-static void board_init_enetaddr(char *var)
-{
- uchar enetaddr[6];
-
- if (eth_getenv_enetaddr(var, enetaddr))
- return;
-
- printf("Warning: %s: generating 'random' MAC address\n", var);
- net_random_ethaddr(enetaddr);
- eth_setenv_enetaddr(var, enetaddr);
-}
-
#ifndef CONFIG_BFIN_MAC
# define bfin_EMAC_initialize(x) 1
#endif
@@ -50,9 +38,6 @@ int board_eth_init(bd_t *bis)
int misc_init_r(void)
{
- board_init_enetaddr("ethaddr");
- board_init_enetaddr("eth1addr");
-
gpio_cfi_flash_init();
return 0;
diff --git a/board/cm-bf537u/cm-bf537u.c b/board/cm-bf537u/cm-bf537u.c
index 69bffd7..f365cdb 100644
--- a/board/cm-bf537u/cm-bf537u.c
+++ b/board/cm-bf537u/cm-bf537u.c
@@ -23,18 +23,6 @@ int checkboard(void)
return 0;
}
-static void board_init_enetaddr(char *var)
-{
- uchar enetaddr[6];
-
- if (eth_getenv_enetaddr(var, enetaddr))
- return;
-
- printf("Warning: %s: generating 'random' MAC address\n", var);
- net_random_ethaddr(enetaddr);
- eth_setenv_enetaddr(var, enetaddr);
-}
-
#ifndef CONFIG_BFIN_MAC
# define bfin_EMAC_initialize(x) 1
#endif
@@ -50,9 +38,6 @@ int board_eth_init(bd_t *bis)
int misc_init_r(void)
{
- board_init_enetaddr("ethaddr");
- board_init_enetaddr("eth1addr");
-
gpio_cfi_flash_init();
return 0;
diff --git a/board/dnp5370/dnp5370.c b/board/dnp5370/dnp5370.c
index 655fcac..ae9ba84 100644
--- a/board/dnp5370/dnp5370.c
+++ b/board/dnp5370/dnp5370.c
@@ -36,28 +36,14 @@ int checkboard(void)
#ifdef CONFIG_BFIN_MAC
static void board_init_enetaddr(uchar *mac_addr)
{
-#ifdef CONFIG_SYS_NO_FLASH
-# define USE_MAC_IN_FLASH 0
-#else
-# define USE_MAC_IN_FLASH 1
-#endif
- bool valid_mac = false;
-
- if (USE_MAC_IN_FLASH) {
- /* we cram the MAC in the last flash sector */
- uchar *board_mac_addr = (uchar *)0x202F0000;
- if (is_valid_ethaddr(board_mac_addr)) {
- memcpy(mac_addr, board_mac_addr, 6);
- valid_mac = true;
- }
- }
-
- if (!valid_mac) {
- puts("Warning: Generating 'random' MAC address\n");
- net_random_ethaddr(mac_addr);
+#ifndef CONFIG_SYS_NO_FLASH
+ /* we cram the MAC in the last flash sector */
+ uchar *board_mac_addr = (uchar *)0x202F0000;
+ if (is_valid_ethaddr(board_mac_addr)) {
+ memcpy(mac_addr, board_mac_addr, 6);
+ eth_setenv_enetaddr("ethaddr", mac_addr);
}
-
- eth_setenv_enetaddr("ethaddr", mac_addr);
+#endif
}
int board_eth_init(bd_t *bis)
diff --git a/board/ip04/ip04.c b/board/ip04/ip04.c
index d20500f..70765bc 100644
--- a/board/ip04/ip04.c
+++ b/board/ip04/ip04.c
@@ -26,16 +26,4 @@ int board_eth_init(bd_t *bis)
{
return dm9000_initialize(bis);
}
-
-int misc_init_r(void)
-{
- uchar enetaddr[6];
- if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
- puts("Warning: Generating 'random' MAC address\n");
- net_random_ethaddr(enetaddr);
- eth_setenv_enetaddr("ethaddr", enetaddr);
- }
-
- return 0;
-}
#endif
diff --git a/board/tcm-bf518/tcm-bf518.c b/board/tcm-bf518/tcm-bf518.c
index 3fa7d97..4348678 100644
--- a/board/tcm-bf518/tcm-bf518.c
+++ b/board/tcm-bf518/tcm-bf518.c
@@ -23,52 +23,12 @@ int checkboard(void)
}
#if defined(CONFIG_BFIN_MAC)
-static void board_init_enetaddr(uchar *mac_addr)
-{
- bool valid_mac = false;
-
-#if 0
- /* the MAC is stored in OTP memory page 0xDF */
- uint32_t ret;
- uint64_t otp_mac;
-
- ret = bfrom_OtpRead(0xDF, OTP_LOWER_HALF, &otp_mac);
- if (!(ret & OTP_MASTER_ERROR)) {
- uchar *otp_mac_p = (uchar *)&otp_mac;
-
- for (ret = 0; ret < 6; ++ret)
- mac_addr[ret] = otp_mac_p[5 - ret];
-
- if (is_valid_ethaddr(mac_addr))
- valid_mac = true;
- }
-#endif
-
- if (!valid_mac) {
- puts("Warning: Generating 'random' MAC address\n");
- net_random_ethaddr(mac_addr);
- }
-
- eth_setenv_enetaddr("ethaddr", mac_addr);
-}
-
int board_eth_init(bd_t *bis)
{
return bfin_EMAC_initialize(bis);
}
#endif
-int misc_init_r(void)
-{
-#ifdef CONFIG_BFIN_MAC
- uchar enetaddr[6];
- if (!eth_getenv_enetaddr("ethaddr", enetaddr))
- board_init_enetaddr(enetaddr);
-#endif
-
- return 0;
-}
-
#ifdef CONFIG_BFIN_SDH
int board_mmc_init(bd_t *bis)
{
diff --git a/board/tcm-bf537/tcm-bf537.c b/board/tcm-bf537/tcm-bf537.c
index 2531a44..2cf70ca 100644
--- a/board/tcm-bf537/tcm-bf537.c
+++ b/board/tcm-bf537/tcm-bf537.c
@@ -23,18 +23,6 @@ int checkboard(void)
return 0;
}
-static void board_init_enetaddr(char *var)
-{
- uchar enetaddr[6];
-
- if (eth_getenv_enetaddr(var, enetaddr))
- return;
-
- printf("Warning: %s: generating 'random' MAC address\n", var);
- net_random_ethaddr(enetaddr);
- eth_setenv_enetaddr(var, enetaddr);
-}
-
#ifndef CONFIG_BFIN_MAC
# define bfin_EMAC_initialize(x) 1
#endif
@@ -50,9 +38,6 @@ int board_eth_init(bd_t *bis)
int misc_init_r(void)
{
- board_init_enetaddr("ethaddr");
- board_init_enetaddr("eth1addr");
-
gpio_cfi_flash_init();
return 0;
diff --git a/configs/bct-brettl2_defconfig b/configs/bct-brettl2_defconfig
index 26b145d..84eb1fe 100644
--- a/configs/bct-brettl2_defconfig
+++ b/configs/bct-brettl2_defconfig
@@ -1,3 +1,4 @@
CONFIG_BLACKFIN=y
-CONFIG_TARGET_BCT_BRETTL2=y
+CONFIG_NET=y
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED=y
diff --git a/configs/bf518f-ezbrd_defconfig b/configs/bf518f-ezbrd_defconfig
index fb35ad0..cee1469 100644
--- a/configs/bf518f-ezbrd_defconfig
+++ b/configs/bf518f-ezbrd_defconfig
@@ -1,3 +1,5 @@
CONFIG_BLACKFIN=y
CONFIG_TARGET_BF518F_EZBRD=y
+CONFIG_NET=y
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED=y
diff --git a/configs/bf526-ezbrd_defconfig b/configs/bf526-ezbrd_defconfig
index da06d3a..d02751a 100644
--- a/configs/bf526-ezbrd_defconfig
+++ b/configs/bf526-ezbrd_defconfig
@@ -1,3 +1,5 @@
CONFIG_BLACKFIN=y
CONFIG_TARGET_BF526_EZBRD=y
+CONFIG_NET=y
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED=y
diff --git a/configs/bf527-ezkit_defconfig b/configs/bf527-ezkit_defconfig
index 69f6ef7..0e7e2d2 100644
--- a/configs/bf527-ezkit_defconfig
+++ b/configs/bf527-ezkit_defconfig
@@ -1,3 +1,5 @@
CONFIG_BLACKFIN=y
CONFIG_TARGET_BF527_EZKIT=y
+CONFIG_NET=y
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED=y
diff --git a/configs/bf537-minotaur_defconfig b/configs/bf537-minotaur_defconfig
index e76118f..7f38081 100644
--- a/configs/bf537-minotaur_defconfig
+++ b/configs/bf537-minotaur_defconfig
@@ -1,2 +1,4 @@
CONFIG_BLACKFIN=y
CONFIG_TARGET_BF537_MINOTAUR=y
+CONFIG_NET=y
+CONFIG_NET_RANDOM_ETHADDR=y
diff --git a/configs/bf537-pnav_defconfig b/configs/bf537-pnav_defconfig
index ba5eaaa..76afb03 100644
--- a/configs/bf537-pnav_defconfig
+++ b/configs/bf537-pnav_defconfig
@@ -1,2 +1,4 @@
CONFIG_BLACKFIN=y
CONFIG_TARGET_BF537_PNAV=y
+CONFIG_NET=y
+CONFIG_NET_RANDOM_ETHADDR=y
diff --git a/configs/bf537-srv1_defconfig b/configs/bf537-srv1_defconfig
index 61ac0e7..45bb79e 100644
--- a/configs/bf537-srv1_defconfig
+++ b/configs/bf537-srv1_defconfig
@@ -1,2 +1,4 @@
CONFIG_BLACKFIN=y
CONFIG_TARGET_BF537_SRV1=y
+CONFIG_NET=y
+CONFIG_NET_RANDOM_ETHADDR=y
diff --git a/configs/bf537-stamp_defconfig b/configs/bf537-stamp_defconfig
index 9b9a92f..2e1da22 100644
--- a/configs/bf537-stamp_defconfig
+++ b/configs/bf537-stamp_defconfig
@@ -1,3 +1,5 @@
CONFIG_BLACKFIN=y
CONFIG_TARGET_BF537_STAMP=y
+CONFIG_NET=y
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED=y
diff --git a/configs/cm-bf527_defconfig b/configs/cm-bf527_defconfig
index a6830b5..92c0bc9 100644
--- a/configs/cm-bf527_defconfig
+++ b/configs/cm-bf527_defconfig
@@ -1,3 +1,5 @@
CONFIG_BLACKFIN=y
CONFIG_TARGET_CM_BF527=y
+CONFIG_NET=y
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED=y
diff --git a/configs/cm-bf537e_defconfig b/configs/cm-bf537e_defconfig
index a44eab7..eaa2475 100644
--- a/configs/cm-bf537e_defconfig
+++ b/configs/cm-bf537e_defconfig
@@ -1,3 +1,5 @@
CONFIG_BLACKFIN=y
CONFIG_TARGET_CM_BF537E=y
+CONFIG_NET=y
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED=y
diff --git a/configs/cm-bf537u_defconfig b/configs/cm-bf537u_defconfig
index 29c33b9..186ae51 100644
--- a/configs/cm-bf537u_defconfig
+++ b/configs/cm-bf537u_defconfig
@@ -1,3 +1,5 @@
CONFIG_BLACKFIN=y
CONFIG_TARGET_CM_BF537U=y
+CONFIG_NET=y
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED=y
diff --git a/configs/dnp5370_defconfig b/configs/dnp5370_defconfig
index 0c00087..93e3eeb 100644
--- a/configs/dnp5370_defconfig
+++ b/configs/dnp5370_defconfig
@@ -1,2 +1,4 @@
CONFIG_BLACKFIN=y
CONFIG_TARGET_DNP5370=y
+CONFIG_NET=y
+CONFIG_NET_RANDOM_ETHADDR=y
diff --git a/configs/ip04_defconfig b/configs/ip04_defconfig
index ba737ae..1afee74 100644
--- a/configs/ip04_defconfig
+++ b/configs/ip04_defconfig
@@ -1,3 +1,5 @@
CONFIG_BLACKFIN=y
CONFIG_TARGET_IP04=y
+CONFIG_NET=y
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED=y
diff --git a/configs/lschlv2_defconfig b/configs/lschlv2_defconfig
index 8c02fb3..31452a3 100644
--- a/configs/lschlv2_defconfig
+++ b/configs/lschlv2_defconfig
@@ -1,4 +1,6 @@
-CONFIG_SYS_EXTRA_OPTIONS="LSCHLV2"
CONFIG_ARM=y
CONFIG_KIRKWOOD=y
CONFIG_TARGET_LSXL=y
+CONFIG_NET=y
+CONFIG_SYS_EXTRA_OPTIONS="LSCHLV2"
+CONFIG_NET_RANDOM_ETHADDR=y
diff --git a/configs/lsxhl_defconfig b/configs/lsxhl_defconfig
index 86845d1..00f48bc 100644
--- a/configs/lsxhl_defconfig
+++ b/configs/lsxhl_defconfig
@@ -1,4 +1,6 @@
-CONFIG_SYS_EXTRA_OPTIONS="LSXHL"
CONFIG_ARM=y
CONFIG_KIRKWOOD=y
CONFIG_TARGET_LSXL=y
+CONFIG_NET=y
+CONFIG_SYS_EXTRA_OPTIONS="LSXHL"
+CONFIG_NET_RANDOM_ETHADDR=y
diff --git a/configs/tcm-bf518_defconfig b/configs/tcm-bf518_defconfig
index 0c9ae4d..2a3f9fa 100644
--- a/configs/tcm-bf518_defconfig
+++ b/configs/tcm-bf518_defconfig
@@ -1,3 +1,5 @@
CONFIG_BLACKFIN=y
CONFIG_TARGET_TCM_BF518=y
+CONFIG_NET=y
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED=y
diff --git a/configs/tcm-bf537_defconfig b/configs/tcm-bf537_defconfig
index 6d604b6..7ff0f9d 100644
--- a/configs/tcm-bf537_defconfig
+++ b/configs/tcm-bf537_defconfig
@@ -1,3 +1,5 @@
CONFIG_BLACKFIN=y
CONFIG_TARGET_TCM_BF537=y
+CONFIG_NET=y
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED=y
diff --git a/drivers/net/dm9000x.c b/drivers/net/dm9000x.c
index ccd2131..3c41cec 100644
--- a/drivers/net/dm9000x.c
+++ b/drivers/net/dm9000x.c
@@ -343,13 +343,7 @@ static int dm9000_init(struct eth_device *dev, bd_t *bd)
printf("MAC: %pM\n", dev->enetaddr);
if (!is_valid_ethaddr(dev->enetaddr)) {
-#ifdef CONFIG_RANDOM_MACADDR
- printf("Bad MAC address (uninitialized EEPROM?), randomizing\n");
- net_random_ethaddr(dev->enetaddr);
- printf("MAC: %pM\n", dev->enetaddr);
-#else
printf("WARNING: Bad MAC address (uninitialized EEPROM?)\n");
-#endif
}
/* fill device MAC address registers */
diff --git a/drivers/net/ftmac110.c b/drivers/net/ftmac110.c
index 4bae9ad..4f17015 100644
--- a/drivers/net/ftmac110.c
+++ b/drivers/net/ftmac110.c
@@ -424,9 +424,6 @@ int ftmac110_initialize(bd_t *bis)
dev->send = ftmac110_send;
dev->recv = ftmac110_recv;
- if (!eth_getenv_enetaddr_by_index("eth", card_nr, dev->enetaddr))
- net_random_ethaddr(dev->enetaddr);
-
/* allocate tx descriptors (it must be 16 bytes aligned) */
chip->txd = dma_alloc_coherent(
sizeof(struct ftmac110_desc) * CFG_TXDES_NUM, &chip->txd_dma);
diff --git a/include/configs/lsxl.h b/include/configs/lsxl.h
index c354c29..490f84e 100644
--- a/include/configs/lsxl.h
+++ b/include/configs/lsxl.h
@@ -37,7 +37,6 @@
#define CONFIG_MISC_INIT_R
#define CONFIG_SHOW_BOOT_PROGRESS
-#define CONFIG_RANDOM_MACADDR
#define CONFIG_LIB_RAND
#define CONFIG_KIRKWOOD_GPIO
#define CONFIG_OF_LIBFDT
--
1.7.11.5
More information about the U-Boot
mailing list