net: Implement random ethaddr fallback in eth.c
Subsystems (3)
PATCH 1/3 net: Implement random ethaddr fallback in eth.c
Implement the random ethaddr fallback in eth.c so it is in a common place and not reimplemented in each board or driver that wants this behavior.
---
To function properly in the driver-model case, this patch requires that
https://patchwork.ozlabs.org/patch/467418/ be applied.
README | 3 ++- doc/README.enetaddr | 2 ++ net/Kconfig | 8 ++++++++ net/eth.c | 12 ++++++++++++ 4 files changed, 24 insertions(+), 1 deletion(-)
README +2 -1
@@ -5629,7 +5629,8 @@ o If both the SROM and the environment contain a MAC address, and the warning is printed. o If neither SROM nor the environment contain a MAC address, an error - is raised. + is raised. If CONFIG_NET_RANDOM_ETHADDR is defined, then in this case + a random, locally-assigned MAC is used. If Ethernet drivers implement the 'write_hwaddr' function, valid MAC addresses will be programmed into hardware as part of the initialization process. This
doc/README.enetaddr +2 -0
@@ -37,6 +37,8 @@ Correct flow of setting up the MAC address (summarized): environment variable will be used unchanged. If the environment variable is not set, it will be initialized from eth_device->enetaddr, and a warning will be printed. + If both are invalid and CONFIG_NET_RANDOM_ETHADDR is defined, a random, + locally-assigned MAC is written to eth_device->enetaddr. 4. Program the address into hardware if the following conditions are met: a) The relevant driver has a 'write_addr' function b) The user hasn't set an 'ethmacskip' environment variable
net/Kconfig +8 -0
@@ -7,4 +7,12 @@ menuconfig NET if NET +config NET_RANDOM_ETHADDR + bool "Random ethaddr if unset" + help + Selecting this will allow the Ethernet interface to function + even when the ethaddr variable for that interface is unset. + A new MAC address will be generated on every boot and it will + not be added to the environment. + endif # if NET
net/eth.c +12 -0
@@ -529,9 +529,15 @@ static int eth_post_probe(struct udevice *dev)printf ("\nWarning: %s using MAC address from ROM\n" , dev->name); }else if (is_zero_ethaddr (pdata->enetaddr)) { +#ifdef CONFIG_NET_RANDOM_ETHADDR +net_random_ethaddr (pdata->enetaddr); +printf ("\nWarning: %s (eth%d) using random MAC address - %pM\n" , + dev->name, dev->seq, pdata->enetaddr); +#else printf ("\nError: %s address not set.\n" , dev->name);return -EINVAL ; +#endif }return 0 ;
@@ -657,9 +663,15 @@ int eth_write_hwaddr(struct eth_device *dev, const char *base_name,printf ("\nWarning: %s using MAC address from net device\n" , dev->name); }else if (is_zero_ethaddr (dev->enetaddr)) { +#ifdef CONFIG_NET_RANDOM_ETHADDR +net_random_ethaddr (dev->enetaddr); +printf ("\nWarning: %s (eth%d) using random MAC address - %pM\n" , + dev->name, eth_number, dev->enetaddr); +#else printf ("\nError: %s address not set.\n" , dev->name);return -EINVAL ; +#endif }if (dev->write_hwaddr && !eth_mac_skip (eth_number)) {
Signature · 1 line
1.7.11.5
PATCH 2/3 net: Remove all references to CONFIG_ETHADDR and friends
We really don't want boards defining fixed MAC addresses in their config so we just remove the option to set it in a fixed way. If you must have a MAC address that was not provisioned, then use the random MAC address functionality.
---
README | 16 ++-------------- doc/README.enetaddr | 2 +- drivers/net/greth.c | 10 +++------- drivers/net/lan91c96.c | 7 ------- examples/standalone/README.smc91111_eeprom | 23 ----------------------- include/configs/M5208EVBE.h | 2 -- include/configs/M5235EVB.h | 2 -- include/configs/M5272C3.h | 2 -- include/configs/M5282EVB.h | 2 -- include/configs/M53017EVB.h | 3 --- include/configs/M5329EVB.h | 2 -- include/configs/M5373EVB.h | 2 -- include/configs/M54418TWR.h | 3 --- include/configs/M54451EVB.h | 2 -- include/configs/M54455EVB.h | 3 --- include/configs/M5475EVB.h | 5 ----- include/configs/M5485EVB.h | 3 --- include/configs/MPC8536DS.h | 4 ---- include/configs/MPC8540ADS.h | 5 +---- include/configs/MPC8541CDS.h | 3 --- include/configs/MPC8544DS.h | 2 -- include/configs/MPC8548CDS.h | 6 ------ include/configs/MPC8555CDS.h | 5 ----- include/configs/MPC8560ADS.h | 8 +------- include/configs/MPC8568MDS.h | 4 ---- include/configs/MPC8572DS.h | 6 ------ include/configs/MPC8610HPCD.h | 1 - include/configs/MPC8641HPCN.h | 10 +--------- include/configs/a4m072.h | 1 - include/configs/bct-brettl2.h | 2 -- include/configs/bf518f-ezbrd.h | 2 -- include/configs/bf526-ezbrd.h | 2 -- include/configs/bf527-ezkit.h | 2 -- include/configs/bf533-ezkit.h | 2 -- include/configs/bf533-stamp.h | 2 -- include/configs/bf537-minotaur.h | 2 -- include/configs/bf537-pnav.h | 2 -- include/configs/bf537-srv1.h | 2 -- include/configs/bf537-stamp.h | 2 -- include/configs/bf538f-ezkit.h | 2 -- include/configs/bf548-ezkit.h | 2 -- include/configs/bf561-acvilon.h | 3 --- include/configs/bf561-ezkit.h | 2 -- include/configs/blackstamp.h | 3 --- include/configs/blackvme.h | 3 --- include/configs/br4.h | 3 --- include/configs/cm-bf527.h | 2 -- include/configs/cm-bf533.h | 2 -- include/configs/cm-bf537e.h | 2 -- include/configs/cm-bf537u.h | 2 -- include/configs/cm-bf548.h | 2 -- include/configs/cm-bf561.h | 2 -- include/configs/cobra5272.h | 1 - include/configs/dbau1x00.h | 2 -- include/configs/ea20.h | 3 +-- include/configs/gr_cpci_ax2000.h | 1 - include/configs/gr_ep2s60.h | 10 ---------- include/configs/gr_xc3s_1500.h | 9 --------- include/configs/grsim.h | 11 ----------- include/configs/grsim_leon2.h | 11 ----------- include/configs/ibf-dsp561.h | 2 -- include/configs/inka4x0.h | 3 --- include/configs/microblaze-generic.h | 1 - include/configs/motionpro.h | 2 -- include/configs/omap3_cairo.h | 1 - include/configs/pb1x00.h | 2 -- include/configs/pr1.h | 2 -- include/configs/sbc405.h | 1 - include/configs/sbc8548.h | 4 ---- include/configs/sbc8641d.h | 10 +--------- include/configs/scb9328.h | 1 - include/configs/sequoia.h | 9 --------- include/configs/stxgp3.h | 6 +----- include/configs/stxssa.h | 6 +----- include/configs/tcm-bf518.h | 2 -- include/configs/tcm-bf537.h | 2 -- include/configs/uniphier.h | 1 - include/configs/v38b.h | 1 - include/configs/work_92105.h | 11 ----------- include/configs/xaeniax.h | 1 - include/configs/zeus.h | 2 -- include/env_default.h | 18 ------------------ 82 files changed, 13 insertions(+), 317 deletions(-)
README +2 -14
@@ -2113,18 +2113,6 @@ CBFS (Coreboot Filesystem) support Some PHY like Intel LXT971A need extra delay after command issued before MII status register can be read -- Ethernet address: - CONFIG_ETHADDR - CONFIG_ETH1ADDR - CONFIG_ETH2ADDR - CONFIG_ETH3ADDR - CONFIG_ETH4ADDR - CONFIG_ETH5ADDR - - Define a default value for Ethernet address to use - for the respective Ethernet interface, in case this - is not determined automatically. - - IP address: CONFIG_IPADDR
@@ -2879,8 +2867,8 @@ CBFS (Coreboot Filesystem) support completely disabled. Anybody can change or delete these parameters. - Alternatively, if you #define _both_ CONFIG_ETHADDR - _and_ CONFIG_OVERWRITE_ETHADDR_ONCE, a default + Alternatively, if you define _both_ an ethaddr in the + default env _and_ CONFIG_OVERWRITE_ETHADDR_ONCE, a default Ethernet address is installed in the environment, which can be changed exactly ONCE by the user. [The serial# is unaffected by this, i. e. it remains
doc/README.enetaddr +1 -1
@@ -15,7 +15,7 @@ Here are the places where MAC addresses might be stored: - board-specific location (eeprom, dedicated flash, ...) Note: only used when mandatory due to hardware design etc... - - environment ("ethaddr", "eth1addr", ...) (see CONFIG_ETHADDR) + - environment ("ethaddr", "eth1addr", ...) Note: this is the preferred way to permanently store MAC addresses - ethernet data (struct eth_device -> enetaddr)
drivers/net/greth.c +3 -7
@@ -12,6 +12,7 @@#include <common.h> #include <command.h> +#include <errno.h> #include <net.h> #include <netdev.h> #include <malloc.h>
@@ -653,13 +654,8 @@ int greth_initialize(bd_t * bis) } } }else { -/* HW Address not found in environment, Set default HW address */ - addr[0 ] =GRETH_HWADDR_0 ;/* MSB */ - addr[1 ] =GRETH_HWADDR_1 ; - addr[2 ] =GRETH_HWADDR_2 ; - addr[3 ] =GRETH_HWADDR_3 ; - addr[4 ] =GRETH_HWADDR_4 ; - addr[5 ] =GRETH_HWADDR_5 ;/* LSB */ +/* No ethaddr set */ +return -EINVAL ; }/* set and remember MAC address */
drivers/net/lan91c96.c +0 -7
@@ -725,12 +725,6 @@ static int smc_get_ethaddr(bd_t *bd, struct eth_device *dev)static int get_rom_mac (struct eth_device *dev,unsigned char *v_rom_mac) { -#ifdef HARDCODE_MAC /* used for testing or to supress run time warnings */ -char hw_mac_addr[] = {0x02 ,0x80 ,0xad ,0x20 ,0x31 ,0xb8 }; - -memcpy (v_rom_mac, hw_mac_addr,6 ); -return (1 ); -#else int i;SMC_SELECT_BANK (dev,1 );for (i=0 ; i<6 ; i++)
@@ -738,7 +732,6 @@ static int get_rom_mac(struct eth_device *dev, unsigned char *v_rom_mac) v_rom_mac[i] =SMC_inb (dev,LAN91C96_IA0 + i); }return (1 ); -#endif }/* Structure to detect the device IDs */
examples/standalone/README.smc91111_eeprom +0 -23
@@ -27,29 +27,6 @@ To find out who has a MAC address, or to purchase MAC addresses, goto the IEEE, at: http://standards.ieee.org/regauth/oui/index.shtml -To change your MAC address, there can not be a MAC address predefined in -U-Boot. To ensure that this does not occur, check your -include/configs/<board_name>.h file, and check to see that the following -settings are _not_ or commented out there. - -#define HARDCODE_MAC 1 -#define CONFIG_ETHADDR 02:80:ad:20:31:b8 - -The purpose of HARDCODE_MAC is to hardcode the MAC address in software, -(not what we want), or to preset it to 02:80:ad:20:31:b8 (not what we -want either). - -You can check this in a running U-Boot, by doing a power cycle, then -before U-Boot tries to do any networking, running the 'printenv' command - - BOOT> printenv - - ethaddr=02:80:ad:20:31:b8 - -If you see the 'ethaddr' variable show up, like the above, you need to -recompile U-Boot, with the above settings commented out of the -include/configs/<board_name>.h file. - 2. Running the smc91111_eeprom program ---------------------------------------------------------------------
include/configs/M5208EVBE.h +0 -2
@@ -74,12 +74,10 @@#define CONFIG_UDP_CHECKSUM #ifdef CONFIG_MCFFEC -# define CONFIG_ETHADDR 00:e0:0c:bc:e5:60# define CONFIG_IPADDR 192.162.1.2# define CONFIG_NETMASK 255.255.255.0# define CONFIG_SERVERIP 192.162.1.1# define CONFIG_GATEWAYIP 192.162.1.1 -# define CONFIG_OVERWRITE_ETHADDR_ONCE #endif /* CONFIG_MCFFEC */ #define CONFIG_HOSTNAME M5208EVBe
include/configs/M5235EVB.h +0 -2
@@ -95,12 +95,10 @@#define CONFIG_BOOTDELAY 1/* autoboot after 5 seconds */ #define CONFIG_BOOTFILE "u-boot.bin"#ifdef CONFIG_MCFFEC -# define CONFIG_ETHADDR 00:e0:0c:bc:e5:60# define CONFIG_IPADDR 192.162.1.2# define CONFIG_NETMASK 255.255.255.0# define CONFIG_SERVERIP 192.162.1.1# define CONFIG_GATEWAYIP 192.162.1.1 -# define CONFIG_OVERWRITE_ETHADDR_ONCE #endif /* FEC_ENET */ #define CONFIG_HOSTNAME M5235EVB
include/configs/M5272C3.h +0 -2
@@ -94,12 +94,10 @@#endif #ifdef CONFIG_MCFFEC -# define CONFIG_ETHADDR 00:e0:0c:bc:e5:60# define CONFIG_IPADDR 192.162.1.2# define CONFIG_NETMASK 255.255.255.0# define CONFIG_SERVERIP 192.162.1.1# define CONFIG_GATEWAYIP 192.162.1.1 -# define CONFIG_OVERWRITE_ETHADDR_ONCE #endif /* CONFIG_MCFFEC */ #define CONFIG_HOSTNAME M5272C3
include/configs/M5282EVB.h +0 -2
@@ -80,12 +80,10 @@#define CONFIG_BOOTDELAY 5#ifdef CONFIG_MCFFEC -# define CONFIG_ETHADDR 00:e0:0c:bc:e5:60# define CONFIG_IPADDR 192.162.1.2# define CONFIG_NETMASK 255.255.255.0# define CONFIG_SERVERIP 192.162.1.1# define CONFIG_GATEWAYIP 192.162.1.1 -# define CONFIG_OVERWRITE_ETHADDR_ONCE #endif /* CONFIG_MCFFEC */ #define CONFIG_HOSTNAME M5282EVB
include/configs/M53017EVB.h +0 -3
@@ -94,13 +94,10 @@#define CONFIG_UDP_CHECKSUM #ifdef CONFIG_MCFFEC -# define CONFIG_ETHADDR 00:e0:0c:bc:e5:60 -# define CONFIG_ETH1ADDR 00:e0:0c:bc:e5:61# define CONFIG_IPADDR 192.162.1.2# define CONFIG_NETMASK 255.255.255.0# define CONFIG_SERVERIP 192.162.1.1# define CONFIG_GATEWAYIP 192.162.1.1 -# define CONFIG_OVERWRITE_ETHADDR_ONCE #endif /* FEC_ENET */ #define CONFIG_HOSTNAME M53017
include/configs/M5329EVB.h +0 -2
@@ -88,12 +88,10 @@#define CONFIG_UDP_CHECKSUM #ifdef CONFIG_MCFFEC -# define CONFIG_ETHADDR 00:e0:0c:bc:e5:60# define CONFIG_IPADDR 192.162.1.2# define CONFIG_NETMASK 255.255.255.0# define CONFIG_SERVERIP 192.162.1.1# define CONFIG_GATEWAYIP 192.162.1.1 -# define CONFIG_OVERWRITE_ETHADDR_ONCE #endif /* FEC_ENET */ #define CONFIG_HOSTNAME M5329EVB
include/configs/M5373EVB.h +0 -2
@@ -88,12 +88,10 @@#define CONFIG_UDP_CHECKSUM #ifdef CONFIG_MCFFEC -# define CONFIG_ETHADDR 00:e0:0c:bc:e5:60# define CONFIG_IPADDR 192.162.1.2# define CONFIG_NETMASK 255.255.255.0# define CONFIG_SERVERIP 192.162.1.1# define CONFIG_GATEWAYIP 192.162.1.1 -# define CONFIG_OVERWRITE_ETHADDR_ONCE #endif /* FEC_ENET */ #define CONFIG_HOSTNAME M5373EVB
include/configs/M54418TWR.h +0 -3
@@ -113,15 +113,12 @@ "::eth0:off:rw console=ttyS0,115200"#endif -#define CONFIG_ETHADDR 00:e0:0c:bc:e5:60 -#define CONFIG_ETH1ADDR 00:e0:0c:bc:e5:61#define CONFIG_ETHPRIME "FEC0"#define CONFIG_IPADDR 192.168.1.2#define CONFIG_NETMASK 255.255.255.0#define CONFIG_SERVERIP 192.168.1.1#define CONFIG_GATEWAYIP 192.168.1.1 -#define CONFIG_OVERWRITE_ETHADDR_ONCE #define CONFIG_SYS_FEC_BUF_USE_SRAM /* If CONFIG_SYS_DISCOVER_PHY is not defined - hardcoded */ #ifndef CONFIG_SYS_DISCOVER_PHY
include/configs/M54451EVB.h +0 -2
@@ -77,13 +77,11 @@# define CONFIG_BOOTDELAY 1/* autoboot after 5 seconds */ # define CONFIG_BOOTARGS "root=/dev/mtdblock1 rw rootfstype=jffs2 ip=none mtdparts=physmap-flash.0:2M(kernel)ro,-(jffs2)" -# define CONFIG_ETHADDR 00:e0:0c:bc:e5:60# define CONFIG_ETHPRIME "FEC0"# define CONFIG_IPADDR 192.162.1.2# define CONFIG_NETMASK 255.255.255.0# define CONFIG_SERVERIP 192.162.1.1# define CONFIG_GATEWAYIP 192.162.1.1 -# define CONFIG_OVERWRITE_ETHADDR_ONCE /* If CONFIG_SYS_DISCOVER_PHY is not defined - hardcoded */ # ifndef CONFIG_SYS_DISCOVER_PHY
include/configs/M54455EVB.h +0 -3
@@ -83,14 +83,11 @@# define CONFIG_BOOTDELAY 1/* autoboot after 5 seconds */ # define CONFIG_BOOTARGS "root=/dev/mtdblock1 rw rootfstype=jffs2 ip=none mtdparts=physmap-flash.0:5M(kernel)ro,-(jffs2)" -# define CONFIG_ETHADDR 00:e0:0c:bc:e5:60 -# define CONFIG_ETH1ADDR 00:e0:0c:bc:e5:61# define CONFIG_ETHPRIME "FEC0"# define CONFIG_IPADDR 192.162.1.2# define CONFIG_NETMASK 255.255.255.0# define CONFIG_SERVERIP 192.162.1.1# define CONFIG_GATEWAYIP 192.162.1.1 -# define CONFIG_OVERWRITE_ETHADDR_ONCE /* If CONFIG_SYS_DISCOVER_PHY is not defined - hardcoded */ # ifndef CONFIG_SYS_DISCOVER_PHY
include/configs/M5475EVB.h +0 -5
@@ -75,13 +75,10 @@# endif # endif /* CONFIG_SYS_DISCOVER_PHY */ -# define CONFIG_ETHADDR 00:e0:0c:bc:e5:60 -# define CONFIG_ETH1ADDR 00:e0:0c:bc:e5:61# define CONFIG_IPADDR 192.162.1.2# define CONFIG_NETMASK 255.255.255.0# define CONFIG_SERVERIP 192.162.1.1# define CONFIG_GATEWAYIP 192.162.1.1 -# define CONFIG_OVERWRITE_ETHADDR_ONCE #endif
@@ -135,12 +132,10 @@#define CONFIG_UDP_CHECKSUM #ifdef CONFIG_MCFFEC -# define CONFIG_ETHADDR 00:e0:0c:bc:e5:60# define CONFIG_IPADDR 192.162.1.2# define CONFIG_NETMASK 255.255.255.0# define CONFIG_SERVERIP 192.162.1.1# define CONFIG_GATEWAYIP 192.162.1.1 -# define CONFIG_OVERWRITE_ETHADDR_ONCE #endif /* FEC_ENET */ #define CONFIG_HOSTNAME M547xEVB
include/configs/M5485EVB.h +0 -3
@@ -75,13 +75,10 @@# endif # endif /* CONFIG_SYS_DISCOVER_PHY */ -# define CONFIG_ETHADDR 00:e0:0c:bc:e5:60 -# define CONFIG_ETH1ADDR 00:e0:0c:bc:e5:61# define CONFIG_IPADDR 192.162.1.2# define CONFIG_NETMASK 255.255.255.0# define CONFIG_SERVERIP 192.162.1.1# define CONFIG_GATEWAYIP 192.162.1.1 -# define CONFIG_OVERWRITE_ETHADDR_ONCE #endif
include/configs/MPC8536DS.h +0 -4
@@ -720,13 +720,9 @@/* The mac addresses for all ethernet interface */ #if defined(CONFIG_TSEC_ENET )#define CONFIG_HAS_ETH0 -#define CONFIG_ETHADDR 00:E0:0C:02:00:FD#define CONFIG_HAS_ETH1 -#define CONFIG_ETH1ADDR 00:E0:0C:02:01:FD#define CONFIG_HAS_ETH2 -#define CONFIG_ETH2ADDR 00:E0:0C:02:02:FD#define CONFIG_HAS_ETH3 -#define CONFIG_ETH3ADDR 00:E0:0C:02:03:FD#endif #define CONFIG_IPADDR 192.168.1.254
include/configs/MPC8540ADS.h +1 -4
@@ -12,7 +12,7 @@* Please refer to doc/README.mpc85xx for more info. * * Make sure you change the MAC address and other network params first, -* search for CONFIG_ETHADDR, CONFIG_SERVERIP, etc in this file. +* search for CONFIG_SERVERIP, etc in this file. */ #ifndef __CONFIG_H
@@ -406,11 +406,8 @@/* The mac addresses for all ethernet interface */ #if defined(CONFIG_TSEC_ENET )#define CONFIG_HAS_ETH0 -#define CONFIG_ETHADDR 00:E0:0C:00:00:FD#define CONFIG_HAS_ETH1 -#define CONFIG_ETH1ADDR 00:E0:0C:00:01:FD#define CONFIG_HAS_ETH2 -#define CONFIG_ETH2ADDR 00:E0:0C:00:02:FD#endif #define CONFIG_IPADDR 192.168.1.253
include/configs/MPC8541CDS.h +0 -3
@@ -418,11 +418,8 @@ extern unsigned long get_clock_freq(void);/* The mac addresses for all ethernet interface */ #if defined(CONFIG_TSEC_ENET )#define CONFIG_HAS_ETH0 -#define CONFIG_ETHADDR 00:E0:0C:00:00:FD#define CONFIG_HAS_ETH1 -#define CONFIG_ETH1ADDR 00:E0:0C:00:01:FD#define CONFIG_HAS_ETH2 -#define CONFIG_ETH2ADDR 00:E0:0C:00:02:FD#endif #define CONFIG_IPADDR 192.168.1.253
include/configs/MPC8544DS.h +0 -2
@@ -449,9 +449,7 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);/* The mac addresses for all ethernet interface */ #if defined(CONFIG_TSEC_ENET )#define CONFIG_HAS_ETH0 -#define CONFIG_ETHADDR 00:E0:0C:02:00:FD#define CONFIG_HAS_ETH1 -#define CONFIG_ETH1ADDR 00:E0:0C:02:01:FD#endif #define CONFIG_IPADDR 192.168.1.251
include/configs/MPC8548CDS.h +0 -6
@@ -539,17 +539,11 @@ extern unsigned long get_clock_freq(void);/* * Environment Configuration */ - -/* The mac addresses for all ethernet interface */ #if defined(CONFIG_TSEC_ENET )#define CONFIG_HAS_ETH0 -#define CONFIG_ETHADDR 00:E0:0C:00:00:FD#define CONFIG_HAS_ETH1 -#define CONFIG_ETH1ADDR 00:E0:0C:00:01:FD#define CONFIG_HAS_ETH2 -#define CONFIG_ETH2ADDR 00:E0:0C:00:02:FD#define CONFIG_HAS_ETH3 -#define CONFIG_ETH3ADDR 00:E0:0C:00:03:FD#endif #define CONFIG_IPADDR 192.168.1.253
include/configs/MPC8555CDS.h +0 -5
@@ -412,15 +412,10 @@ extern unsigned long get_clock_freq(void);/* * Environment Configuration */ - -/* The mac addresses for all ethernet interface */ #if defined(CONFIG_TSEC_ENET )#define CONFIG_HAS_ETH0 -#define CONFIG_ETHADDR 00:E0:0C:00:00:FD#define CONFIG_HAS_ETH1 -#define CONFIG_ETH1ADDR 00:E0:0C:00:01:FD#define CONFIG_HAS_ETH2 -#define CONFIG_ETH2ADDR 00:E0:0C:00:02:FD#endif #define CONFIG_IPADDR 192.168.1.253
include/configs/MPC8560ADS.h +1 -7
@@ -12,7 +12,7 @@* Please refer to doc/README.mpc85xx for more info. * * Make sure you change the MAC address and other network params first, -* search for CONFIG_ETHADDR, CONFIG_SERVERIP, etc in this file. +* search for CONFIG_SERVERIP, etc. in this file. */ #ifndef __CONFIG_H
@@ -443,17 +443,11 @@/* * Environment Configuration */ - -/* The mac addresses for all ethernet interface */ #if defined(CONFIG_TSEC_ENET ) || defined(CONFIG_ETHER_ON_FCC )#define CONFIG_HAS_ETH0 -#define CONFIG_ETHADDR 00:E0:0C:00:00:FD#define CONFIG_HAS_ETH1 -#define CONFIG_ETH1ADDR 00:E0:0C:00:01:FD#define CONFIG_HAS_ETH2 -#define CONFIG_ETH2ADDR 00:E0:0C:00:02:FD#define CONFIG_HAS_ETH3 -#define CONFIG_ETH3ADDR 00:E0:0C:00:03:FD#endif #define CONFIG_IPADDR 192.168.1.253
include/configs/MPC8568MDS.h +0 -4
@@ -438,13 +438,9 @@ extern unsigned long get_clock_freq(void);/* The mac addresses for all ethernet interface */ #if defined(CONFIG_TSEC_ENET ) || defined(CONFIG_UEC_ETH )#define CONFIG_HAS_ETH0 -#define CONFIG_ETHADDR 00:E0:0C:00:00:FD#define CONFIG_HAS_ETH1 -#define CONFIG_ETH1ADDR 00:E0:0C:00:01:FD#define CONFIG_HAS_ETH2 -#define CONFIG_ETH2ADDR 00:E0:0C:00:02:FD#define CONFIG_HAS_ETH3 -#define CONFIG_ETH3ADDR 00:E0:0C:00:03:FD#endif #define CONFIG_IPADDR 192.168.1.253
include/configs/MPC8572DS.h +0 -6
@@ -658,17 +658,11 @@/* * Environment Configuration */ - -/* The mac addresses for all ethernet interface */ #if defined(CONFIG_TSEC_ENET )#define CONFIG_HAS_ETH0 -#define CONFIG_ETHADDR 00:E0:0C:02:00:FD#define CONFIG_HAS_ETH1 -#define CONFIG_ETH1ADDR 00:E0:0C:02:01:FD#define CONFIG_HAS_ETH2 -#define CONFIG_ETH2ADDR 00:E0:0C:02:02:FD#define CONFIG_HAS_ETH3 -#define CONFIG_ETH3ADDR 00:E0:0C:02:03:FD#endif #define CONFIG_IPADDR 192.168.1.254
include/configs/MPC8610HPCD.h +0 -1
@@ -300,7 +300,6 @@#define CONFIG_ULI526X #ifdef CONFIG_ULI526X -#define CONFIG_ETHADDR 00:E0:0C:00:00:01#endif /************************************************************
include/configs/MPC8641HPCN.h +1 -9
@@ -10,7 +10,7 @@* MPC8641HPCN board configuration file * * Make sure you change the MAC address and other network params first, -* search for CONFIG_ETHADDR, CONFIG_SERVERIP, etc in this file. +* search for CONFIG_SERVERIP, etc. in this file. */ #ifndef __CONFIG_H
@@ -679,14 +679,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);* Environment Configuration */ -/* The mac addresses for all ethernet interface */ -#if defined(CONFIG_TSEC_ENET ) -#define CONFIG_ETHADDR 00:E0:0C:00:00:01 -#define CONFIG_ETH1ADDR 00:E0:0C:00:01:FD -#define CONFIG_ETH2ADDR 00:E0:0C:00:02:FD -#define CONFIG_ETH3ADDR 00:E0:0C:00:03:FD -#endif -#define CONFIG_HAS_ETH0 1#define CONFIG_HAS_ETH1 1#define CONFIG_HAS_ETH2 1
include/configs/a4m072.h +0 -1
@@ -165,7 +165,6 @@"setenv bootargs ${bootargs} no_ethaddr;" \"fi\0" \"hostname=CPUP0\0" \ -"ethaddr=00:00:00:00:00:00\0" \"netdev=eth0\0" \"bootcmd=run bootcmd_nor\0" \""
include/configs/bct-brettl2.h +0 -2
@@ -73,8 +73,6 @@#define CONFIG_GATEWAYIP 192.168.233.1#define CONFIG_SERVERIP 192.168.233.53#define CONFIG_ROOTPATH "/romfs/brettl2" -/* Uncomment next line to use fixed MAC address */ -/* #define CONFIG_ETHADDR 02:80:ad:20:31:e8 */ #define CONFIG_LIB_RAND #endif
include/configs/bf518f-ezbrd.h +0 -2
@@ -87,8 +87,6 @@#endif #define CONFIG_HOSTNAME bf518f-ezbrd#define CONFIG_PHY_ADDR 3 -/* Uncomment next line to use fixed MAC address */ -/* #define CONFIG_ETHADDR 02:80:ad:20:31:e8 */ #define CONFIG_LIB_RAND /*
include/configs/bf526-ezbrd.h +0 -2
@@ -85,8 +85,6 @@#define CONFIG_NETCONSOLE 1#endif #define CONFIG_HOSTNAME bf526-ezbrd -/* Uncomment next line to use fixed MAC address */ -/* #define CONFIG_ETHADDR 02:80:ad:20:31:e8 */ #define CONFIG_LIB_RAND /*
include/configs/bf527-ezkit.h +0 -2
@@ -83,8 +83,6 @@#define CONFIG_NETCONSOLE 1#endif #define CONFIG_HOSTNAME bf527-ezkit -/* Uncomment next line to use fixed MAC address */ -/* #define CONFIG_ETHADDR 02:80:ad:20:31:e8 */ #define CONFIG_LIB_RAND /*
include/configs/bf533-ezkit.h +0 -2
@@ -75,8 +75,6 @@SSYNC (); \ } while (0)#define CONFIG_HOSTNAME bf533-ezkit -/* Uncomment next line to use fixed MAC address */ -/* #define CONFIG_ETHADDR 02:80:ad:20:31:e8 */ /*
include/configs/bf533-stamp.h +0 -2
@@ -68,8 +68,6 @@SSYNC (); \ } while (0)#define CONFIG_HOSTNAME bf533-stamp -/* Uncomment next line to use fixed MAC address */ -/* #define CONFIG_ETHADDR 02:80:ad:20:31:b8 */ /* I2C */
include/configs/bf537-minotaur.h +0 -2
@@ -86,8 +86,6 @@#define CONFIG_SYS_AUTOLOAD "no"#define CONFIG_ROOTPATH "/romfs" -/* Uncomment next line to use fixed MAC address */ -/* #define CONFIG_ETHADDR 02:80:ad:20:31:42 */ #define CONFIG_LIB_RAND
include/configs/bf537-pnav.h +0 -2
@@ -65,8 +65,6 @@#define CONFIG_RMII #endif #define CONFIG_HOSTNAME bf537-pnav -/* Uncomment next line to use fixed MAC address */ -/* #define CONFIG_ETHADDR 02:80:ad:24:21:18 */ #define CONFIG_LIB_RAND /*
include/configs/bf537-srv1.h +0 -2
@@ -86,8 +86,6 @@#define CONFIG_SYS_AUTOLOAD "no"#define CONFIG_ROOTPATH "/romfs" -/* Uncomment next line to use fixed MAC address */ -/* #define CONFIG_ETHADDR 02:80:ad:20:31:42 */ #define CONFIG_LIB_RAND /*
include/configs/bf537-stamp.h +0 -2
@@ -65,8 +65,6 @@#define CONFIG_NETCONSOLE 1#endif #define CONFIG_HOSTNAME bf537-stamp -/* Uncomment next line to use fixed MAC address */ -/* #define CONFIG_ETHADDR 02:80:ad:20:31:e8 */ #define CONFIG_LIB_RAND /*
include/configs/bf538f-ezkit.h +0 -2
@@ -63,8 +63,6 @@#define CONFIG_SMC91111 1#define CONFIG_SMC91111_BASE 0x20310300#define CONFIG_HOSTNAME bf538f-ezkit -/* Uncomment next line to use fixed MAC address */ -/* #define CONFIG_ETHADDR 02:80:ad:20:31:e8 */ /*
include/configs/bf548-ezkit.h +0 -2
@@ -73,8 +73,6 @@#define CONFIG_SMC911X_BASE 0x24000000#define CONFIG_SMC911X_16_BIT #define CONFIG_HOSTNAME bf548-ezkit -/* Uncomment next line to use fixed MAC address */ -/* #define CONFIG_ETHADDR 02:80:ad:20:31:e8 */ /*
include/configs/bf561-acvilon.h +0 -3
@@ -92,9 +92,6 @@#define CONFIG_HOSTNAME bf561-acvilon -/* Uncomment next line to use fixed MAC address */ -/* #define CONFIG_ETHADDR 02:80:ad:20:31:e8 */ -/* * Flash Settings
include/configs/bf561-ezkit.h +0 -2
@@ -64,8 +64,6 @@#define CONFIG_SMC91111_BASE 0x2C010300#define CONFIG_SMC_USE_32_BIT 1#define CONFIG_HOSTNAME bf561-ezkit -/* Uncomment next line to use fixed MAC address */ -/* #define CONFIG_ETHADDR 02:80:ad:20:31:e8 */ /*
include/configs/blackstamp.h +0 -3
@@ -76,9 +76,6 @@#define CONFIG_HOSTNAME blackstamp#define CONFIG_ROOTPATH "/checkout/uClinux-dist/romfs"#define CONFIG_SYS_AUTOLOAD "no" - -/* To remove hardcoding and enable MAC storage in EEPROM */ -/* #define CONFIG_ETHADDR 02:80:ad:20:31:b8 */ #endif #define CONFIG_ENV_IS_IN_SPI_FLASH
include/configs/blackvme.h +0 -3
@@ -85,9 +85,6 @@#define CFG_AUTOLOAD "no"#define CONFIG_CMD_DHCP #define CONFIG_CMD_PING -#define CONFIG_ENV_OVERWRITE 1/* enable changing MAC at runtime */ -/* Comment out hardcoded MAC to enable MAC storage in EEPROM */ -/* # define CONFIG_ETHADDR ff:ee:dd:cc:bb:aa */ /* * SDRAM settings & memory map
include/configs/br4.h +0 -3
@@ -69,9 +69,6 @@#endif #define CONFIG_HOSTNAME br4#define CONFIG_TFTP_BLOCKSIZE 4404 -/* Uncomment next line to use fixed MAC address */ -/* #define CONFIG_ETHADDR 5c:38:1a:80:a7:00 */ -/* * Flash Settings
include/configs/cm-bf527.h +0 -2
@@ -83,8 +83,6 @@#define CONFIG_NETCONSOLE 1#endif #define CONFIG_HOSTNAME cm-bf527 -/* Uncomment next line to use fixed MAC address */ -/* #define CONFIG_ETHADDR 02:80:ad:20:31:e8 */ #define CONFIG_LIB_RAND /*
include/configs/cm-bf533.h +0 -2
@@ -66,8 +66,6 @@#define CONFIG_SMC91111 1#define CONFIG_SMC91111_BASE 0x20200300#define CONFIG_HOSTNAME cm-bf533 -/* Uncomment next line to use fixed MAC address */ -/* #define CONFIG_ETHADDR 02:80:ad:20:31:e8 */ /*
include/configs/cm-bf537e.h +0 -2
@@ -71,8 +71,6 @@#define CONFIG_NETCONSOLE 1#endif #define CONFIG_HOSTNAME cm-bf537e -/* Uncomment next line to use fixed MAC address */ -/* #define CONFIG_ETHADDR 02:80:ad:20:31:e8 */ #define CONFIG_LIB_RAND /*
include/configs/cm-bf537u.h +0 -2
@@ -69,8 +69,6 @@#define CONFIG_NETCONSOLE 1#endif #define CONFIG_HOSTNAME cm-bf537u -/* Uncomment next line to use fixed MAC address */ -/* #define CONFIG_ETHADDR 02:80:ad:20:31:e8 */ #define CONFIG_LIB_RAND /*
include/configs/cm-bf548.h +0 -2
@@ -76,8 +76,6 @@#define CONFIG_SMC911X_BASE 0x24000000#define CONFIG_SMC911X_16_BIT #define CONFIG_HOSTNAME cm-bf548 -/* Uncomment next line to use fixed MAC address */ -/* #define CONFIG_ETHADDR 02:80:ad:24:31:91 */ /*
include/configs/cm-bf561.h +0 -2
@@ -67,8 +67,6 @@#define CONFIG_SMC911X_BASE 0x24008000/* AMS1 */ #define CONFIG_SMC911X_16_BIT #define CONFIG_HOSTNAME cm-bf561 -/* Uncomment next line to use fixed MAC address */ -/* #define CONFIG_ETHADDR 02:80:ad:20:31:cf */ /*
include/configs/cobra5272.h +0 -1
@@ -177,7 +177,6 @@ considered during boot *//* User network settings */ -#define CONFIG_ETHADDR 00:00:00:00:00:09/* default ethernet MAC addr. */ #define CONFIG_IPADDR 192.168.100.2/* default board IP address */ #define CONFIG_SERVERIP 192.168.100.1/* default tftp server IP address */
include/configs/dbau1x00.h +0 -2
@@ -37,8 +37,6 @@#endif #endif -#define CONFIG_ETHADDR DE:AD:BE:EF:01:01/* Ethernet address */ -#define CONFIG_BOOTDELAY 2/* autoboot after 2 seconds */ #define CONFIG_BAUDRATE 115200
include/configs/ea20.h +1 -2
@@ -242,7 +242,6 @@"rootpath=/opt/eldk/arm\0" \"splashpos=230,180\0" \"testrfspath=/opt/eldk/test_arm\0" \ -"tempmac=setenv ethaddr 02:ea:20:ff:ff:ff\0" \"nandargs=setenv bootargs rootfstype=ubifs ro chk_data_crc " \"ubi.mtd=${as} root=ubi0:rootfs\0" \"nandrwargs=setenv bootargs rootfstype=ubifs rw chk_data_crc " \
@@ -315,6 +314,6 @@"fi;" \"else echo U-Boot not downloaded..exiting;fi\0" \"ubootupd_nand=echo run load_magic,run load_nand,run upd;\0" \ - "bootcmd=run tempmac;run net_testrfs\0" + "bootcmd=run net_testrfs\0"#endif /* __CONFIG_H */
include/configs/gr_cpci_ax2000.h +0 -1
@@ -280,7 +280,6 @@/*#define CONFIG_SHOW_ACTIVITY*/ #define CONFIG_NET_RETRY_COUNT 10/* # of retries */ -#define CONFIG_ETHADDR 00:00:7a:cc:00:13#define CONFIG_PHY_ADDR 0x00/*
include/configs/gr_ep2s60.h +0 -10
@@ -260,16 +260,6 @@/* USE GRETH Ethernet Driver */ #define CONFIG_GRETH 1 -/* Default GRETH Ethernet HARDWARE address */ -#define GRETH_HWADDR_0 0x00 -#define GRETH_HWADDR_1 0x00 -#define GRETH_HWADDR_2 0x7a -#define GRETH_HWADDR_3 0xcc -#define GRETH_HWADDR_4 0x00 -#define GRETH_HWADDR_5 0x13 -#endif - -#define CONFIG_ETHADDR 00:00:7a:cc:00:13#define CONFIG_PHY_ADDR 0x00/*
include/configs/gr_xc3s_1500.h +0 -9
@@ -220,15 +220,6 @@*/ #define CONFIG_GRETH 1 -/* Default GRETH Ethernet HARDWARE address */ -#define GRETH_HWADDR_0 0x00 -#define GRETH_HWADDR_1 0x00 -#define GRETH_HWADDR_2 0x7a -#define GRETH_HWADDR_3 0xcc -#define GRETH_HWADDR_4 0x00 -#define GRETH_HWADDR_5 0x12 - -#define CONFIG_ETHADDR 00:00:7a:cc:00:12#define CONFIG_PHY_ADDR 0x00/*
include/configs/grsim.h +0 -11
@@ -94,7 +94,6 @@"rootpath=/export/roofs\0" \"scratch=40000000\0" \"getkernel=tftpboot $(scratch) $(bootfile)\0" \ -"ethaddr=00:00:7A:CC:00:12\0" \"bootargs=console=ttyS0,38400" \ ""#define CONFIG_NETMASK 255.255.255.0
@@ -243,16 +242,6 @@*/ #define CONFIG_GRETH 1 -/* Default HARDWARE address */ -#define GRETH_HWADDR_0 0x00 -#define GRETH_HWADDR_1 0x00 -#define GRETH_HWADDR_2 0x7A -#define GRETH_HWADDR_3 0xcc -#define GRETH_HWADDR_4 0x00 -#define GRETH_HWADDR_5 0x12 - -#define CONFIG_ETHADDR 00:00:7a:cc:00:12 -/* * Define CONFIG_GRETH_10MBIT to force GRETH at 10Mb/s */
include/configs/grsim_leon2.h +0 -11
@@ -91,7 +91,6 @@"rootpath=/export/roofs\0" \"scratch=40000000\0" \"getkernel=tftpboot $(scratch) $(bootfile)\0" \ -"ethaddr=00:00:7A:CC:00:12\0" \"bootargs=console=ttyS0,38400" \ ""#define CONFIG_NETMASK 255.255.255.0
@@ -241,16 +240,6 @@*/ /*#define CONFIG_GRETH 1*/ -/* Default HARDWARE address */ -#define GRETH_HWADDR_0 0x00 -#define GRETH_HWADDR_1 0x00 -#define GRETH_HWADDR_2 0x7A -#define GRETH_HWADDR_3 0xcc -#define GRETH_HWADDR_4 0x00 -#define GRETH_HWADDR_5 0x12 - -#define CONFIG_ETHADDR 00:00:7a:cc:00:12 -/* * Define CONFIG_GRETH_10MBIT to force GRETH at 10Mb/s */
include/configs/ibf-dsp561.h +0 -2
@@ -64,8 +64,6 @@#define CONFIG_DRIVER_AX88180 1#define AX88180_BASE 0x2c000000#define CONFIG_HOSTNAME ibf-dsp561 -/* Uncomment next line to use fixed MAC address */ -/* #define CONFIG_ETHADDR 02:80:ad:20:31:e8 */ /*
include/configs/inka4x0.h +0 -3
@@ -110,9 +110,6 @@#undef CONFIG_BOOTARGS -#define CONFIG_ETHADDR 00:a0:a4:03:00:00 -#define CONFIG_OVERWRITE_ETHADDR_ONCE -#define CONFIG_IPADDR 192.168.100.2#define CONFIG_SERVERIP 192.168.100.1#define CONFIG_NETMASK 255.255.255.0
include/configs/microblaze-generic.h +0 -1
@@ -350,7 +350,6 @@#define CONFIG_IPADDR 192.168.0.3#define CONFIG_SERVERIP 192.168.0.5#define CONFIG_GATEWAYIP 192.168.0.1 -#define CONFIG_ETHADDR 00:E0:0C:00:00:FD/* architecture dependent code */ #define CONFIG_SYS_USR_EXCEP /* user exception */
include/configs/motionpro.h +0 -2
@@ -85,8 +85,6 @@#define CONFIG_SYS_HUSH_PARSER 1/* use "hush" command parser */ #define CONFIG_SYS_PROMPT_HUSH_PS2 "> " -#define CONFIG_ETHADDR 00:50:C2:40:10:00 -#define CONFIG_OVERWRITE_ETHADDR_ONCE 1#define CONFIG_VERSION_VARIABLE 1/* include version env variable */ /*
include/configs/omap3_cairo.h +0 -1
@@ -90,7 +90,6 @@"machid=ffffffff\0" \"fdt_high=0x87000000\0" \"baudrate=115200\0" \ -"ethaddr=00:50:C2:7E:90:F0\0" \"fec_addr=00:50:C2:7E:90:F0\0" \"netmask=255.255.255.0\0" \"ipaddr=192.168.2.9\0" \
include/configs/pb1x00.h +0 -2
@@ -31,8 +31,6 @@#endif #endif -#define CONFIG_ETHADDR DE:AD:BE:EF:01:01/* Ethernet address */ -#define CONFIG_BOOTDELAY 2/* autoboot after 2 seconds */ #define CONFIG_BAUDRATE 115200
include/configs/pr1.h +0 -2
@@ -69,8 +69,6 @@#endif #define CONFIG_HOSTNAME pr1#define CONFIG_TFTP_BLOCKSIZE 4404 -/* Uncomment next line to use fixed MAC address */ -/* #define CONFIG_ETHADDR 02:80:ad:20:31:e8 */ /*
include/configs/sbc405.h +0 -1
@@ -102,7 +102,6 @@#define CONFIG_SDRAM_BANK0 1/* init onboard SDRAM bank 0 */ -#define CONFIG_ETHADDR DE:AD:BE:EF:01:01/* Ethernet address */ #define CONFIG_IPADDR 192.168.193.102#define CONFIG_NETMASK 255.255.255.224#define CONFIG_SERVERIP 192.168.193.119
include/configs/sbc8548.h +0 -4
@@ -581,13 +581,9 @@/* * Environment Configuration */ - -/* The mac addresses for all ethernet interface */ #if defined(CONFIG_TSEC_ENET )#define CONFIG_HAS_ETH0 -#define CONFIG_ETHADDR 02:E0:0C:00:00:FD#define CONFIG_HAS_ETH1 -#define CONFIG_ETH1ADDR 02:E0:0C:00:01:FD#endif #define CONFIG_IPADDR 192.168.0.55
include/configs/sbc8641d.h +1 -9
@@ -14,7 +14,7 @@* SBC8641D board configuration file * * Make sure you change the MAC address and other network params first, -* search for CONFIG_ETHADDR, CONFIG_SERVERIP, etc in this file. +* search for CONFIG_SERVERIP, etc in this file. */ #ifndef __CONFIG_H
@@ -528,14 +528,6 @@* Environment Configuration */ -/* The mac addresses for all ethernet interface */ -#if defined(CONFIG_TSEC_ENET ) -#define CONFIG_ETHADDR 02:E0:0C:00:00:01 -#define CONFIG_ETH1ADDR 02:E0:0C:00:01:FD -#define CONFIG_ETH2ADDR 02:E0:0C:00:02:FD -#define CONFIG_ETH3ADDR 02:E0:0C:00:03:FD -#endif -#define CONFIG_HAS_ETH0 1#define CONFIG_HAS_ETH1 1#define CONFIG_HAS_ETH2 1
include/configs/scb9328.h +0 -1
@@ -50,7 +50,6 @@#define CONFIG_BOOTARGS "console=ttySMX0,115200n8 root=/dev/mtdblock3 rootfstype=jffs2 mtdparts=scb9328_flash:128k(U-boot)ro,128k(U-boot_env),1m(kernel),4m(root),4m(fs) eval_board=evk9328"#define CONFIG_BOOTCOMMAND "bootm 10040000"#define CONFIG_SHOW_BOOT_PROGRESS -#define CONFIG_ETHADDR 80:81:82:83:84:85#define CONFIG_NETMASK 255.255.255.0#define CONFIG_IPADDR 10.10.10.9#define CONFIG_SERVERIP 10.10.10.10
include/configs/sequoia.h +0 -9
@@ -100,15 +100,6 @@#if defined(CONFIG_SYS_RAMBOOT )#define CONFIG_ENV_IS_NOWHERE /* Store env in memory only */ #define CONFIG_ENV_SIZE (8 << 10) -/* -* In RAM-booting version, we have no environment storage. So we need to -* provide@least preliminary MAC addresses for the 4xx EMAC driver to -* register the interfaces. Those two addresses are generated via the -* tools/gen_eth_addr tool and should only be used in a closed laboratory -* environment. -*/ -#define CONFIG_ETHADDR 4a:56:49:22:3e:43 -#define CONFIG_ETH1ADDR 02:93:53:d5:06:98#else #define CONFIG_ENV_IS_IN_FLASH /* use FLASH for environ vars */ #endif
include/configs/stxgp3.h +1 -5
@@ -13,7 +13,7 @@/* mpc8560ads board configuration file */ /* please refer to doc/README.mpc85xx for more info */ /* make sure you change the MAC address and other network params first, -* search for CONFIG_ETHADDR,CONFIG_SERVERIP,etc in this file +* search for CONFIG_SERVERIP, etc. in this file */ #ifndef __CONFIG_H
@@ -342,14 +342,10 @@#define CONFIG_KGDB_BAUDRATE 230400/* speed to run kgdb serial port */ #endif -/*Note: change below for your network setting!!! */ #if defined(CONFIG_TSEC_ENET ) || defined(CONFIG_ETHER_ON_FCC )#define CONFIG_HAS_ETH0 -#define CONFIG_ETHADDR 00:e0:0c:07:9b:8a#define CONFIG_HAS_ETH1 -#define CONFIG_ETH1ADDR 00:e0:0c:07:9b:8b#define CONFIG_HAS_ETH2 -#define CONFIG_ETH2ADDR 00:e0:0c:07:9b:8c#endif #define CONFIG_SERVERIP 192.168.85.1
include/configs/stxssa.h +1 -5
@@ -13,7 +13,7 @@/* mpc8560ads board configuration file */ /* please refer to doc/README.mpc85xx for more info */ /* make sure you change the MAC address and other network params first, -* search for CONFIG_ETHADDR,CONFIG_SERVERIP,etc in this file +* search for CONFIG_SERVERIP, etc. in this file */ #ifndef __CONFIG_H
@@ -377,14 +377,10 @@#define CONFIG_KGDB_BAUDRATE 230400/* speed to run kgdb serial port */ #endif -/*Note: change below for your network setting!!! */ #if defined(CONFIG_TSEC_ENET ) || defined(CONFIG_ETHER_ON_FCC )#define CONFIG_HAS_ETH0 -#define CONFIG_ETHADDR 00:e0:0c:07:9b:8a#define CONFIG_HAS_ETH1 -#define CONFIG_ETH1ADDR 00:e0:0c:07:9b:8b#define CONFIG_HAS_ETH2 -#define CONFIG_ETH2ADDR 00:e0:0c:07:9b:8c#endif /*
include/configs/tcm-bf518.h +0 -2
@@ -66,8 +66,6 @@#define CONFIG_NETCONSOLE 1#endif #define CONFIG_HOSTNAME tcm-bf518 -/* Uncomment next line to use fixed MAC address */ -/* #define CONFIG_ETHADDR 02:80:ad:20:31:e8 */ #define CONFIG_LIB_RAND /*
include/configs/tcm-bf537.h +0 -2
@@ -71,8 +71,6 @@#define CONFIG_NETCONSOLE 1#endif #define CONFIG_HOSTNAME tcm-bf537 -/* Uncomment next line to use fixed MAC address */ -/* #define CONFIG_ETHADDR 02:80:ad:20:31:e8 */ #define CONFIG_LIB_RAND /*
include/configs/uniphier.h +0 -1
@@ -209,7 +209,6 @@/* * Network Configuration */ -#define CONFIG_ETHADDR 00:21:83:24:00:00#define CONFIG_SERVERIP 192.168.11.1#define CONFIG_IPADDR 192.168.11.10#define CONFIG_GATEWAYIP 192.168.11.1
include/configs/v38b.h +0 -1
@@ -148,7 +148,6 @@"netmask=255.255.0.0\0" \"ipaddr=192.168.160.18\0" \"serverip=192.168.1.1\0" \ -"ethaddr=00:e0:ee:00:05:2e\0" \"bootfile=/tftpboot/v38b/uImage\0" \"u-boot=/tftpboot/v38b/u-boot.bin\0" \""
include/configs/work_92105.h +0 -11
@@ -177,17 +177,6 @@#define CONFIG_ENV_ADDR 0x80000100/* -* Provide default ethernet address -* -* THIS IS NORMALLY NOT DONE. HERE WE KEEP WHAT WAS IN THE PORTED -* BOARD CONFIG IN CASE SOME PROVISIONING PROCESS OUT THERE EXPECTS -* THIS MAC ADDRESS WHEN THE DEVICE HAS STILL ITS DEFAULT CONFIG. -*/ - -#define CONFIG_ETHADDR 00:12:B4:00:AF:FE -#define CONFIG_OVERWRITE_ETHADDR_ONCE - -/* * U-Boot Commands */ #include <config_cmd_default.h>
include/configs/xaeniax.h +0 -1
@@ -70,7 +70,6 @@#undef CONFIG_CMD_DTT -#define CONFIG_ETHADDR 08:00:3e:26:0a:5b#define CONFIG_NETMASK 255.255.255.0#define CONFIG_IPADDR 192.168.68.201#define CONFIG_SERVERIP 192.168.68.62
include/configs/zeus.h +0 -2
@@ -296,8 +296,6 @@#define CONFIG_IPADDR 192.168.1.10#define CONFIG_SERVERIP 192.168.1.100#define CONFIG_GATEWAYIP 192.168.1.100 -#define CONFIG_ETHADDR 50:00:00:00:06:00 -#define CONFIG_ETH1ADDR 50:00:00:00:06:01#if 0 #define CONFIG_BOOTDELAY -1/* autoboot disabled */ #else
include/env_default.h +0 -18
@@ -49,24 +49,6 @@ const uchar default_environment[] = {#ifdef CONFIG_LOADS_ECHO "loads_echo=" __stringify(CONFIG_LOADS_ECHO) "\0"#endif -#ifdef CONFIG_ETHADDR - "ethaddr=" __stringify(CONFIG_ETHADDR) "\0" -#endif -#ifdef CONFIG_ETH1ADDR - "eth1addr=" __stringify(CONFIG_ETH1ADDR) "\0" -#endif -#ifdef CONFIG_ETH2ADDR - "eth2addr=" __stringify(CONFIG_ETH2ADDR) "\0" -#endif -#ifdef CONFIG_ETH3ADDR - "eth3addr=" __stringify(CONFIG_ETH3ADDR) "\0" -#endif -#ifdef CONFIG_ETH4ADDR - "eth4addr=" __stringify(CONFIG_ETH4ADDR) "\0" -#endif -#ifdef CONFIG_ETH5ADDR - "eth5addr=" __stringify(CONFIG_ETH5ADDR) "\0" -#endif #ifdef CONFIG_ETHPRIME "ethprime=" CONFIG_ETHPRIME "\0"#endif
Signature · 1 line
1.7.11.5
PATCH 2/3 net: Remove all references to CONFIG_ETHADDR and friends
Quoted 7 lines · Joe Hershberger
We really don't want boards defining fixed MAC addresses in their config so we just remove the option to set it in a fixed way. If you must have a MAC address that was not provisioned, then use the random MAC address functionality.
Signed-off-by Joe Hershberger <[email protected]>---
PATCH 2/3 net: Remove all references to CONFIG_ETHADDR and friends
Bonjour Simon,
Le Mon, 4 May 2015 15:37:22 -0600, Simon Glass <[email protected]> a ?crit :
Quoted 10 lines · Joe Hershberger
Quoted 7 lines
We really don't want boards defining fixed MAC addresses in their config so we just remove the option to set it in a fixed way. If you must have a MAC address that was not provisioned, then use the random MAC address functionality.
Signed-off-by Joe Hershberger <[email protected]>---
Reviewed-by Simon Glass <[email protected]>
As much as I support the idea that one should not hard-code MAC addresses, I also support the idea that changes should not break previous behavior.
And regarding the WORK board which I submitted, its configuration header file had this address encoded in the in-house U-Boot which the customer was using before; removing this address might lead to the customer provisioning scripts failing.
Cordialement,
Albert ARIBAUD
3ADEV
PATCH 2/3 net: Remove all references to CONFIG_ETHADDR and friends
Hi Albert,
Quoted 16 lines · Albert ARIBAUD
Bonjour Simon,
Le Mon, 4 May 2015 15:37:22 -0600, Simon Glass <[email protected]> a ?crit :
Quoted 10 lines · Joe Hershberger
Quoted 7 lines
We really don't want boards defining fixed MAC addresses in their config so we just remove the option to set it in a fixed way. If you must have a MAC address that was not provisioned, then use the random MAC address functionality.
Signed-off-by Joe Hershberger <[email protected]>---
Reviewed-by Simon Glass <[email protected]>
Quoted 8 lines
As much as I support the idea that one should not hard-code MAC addresses, I also support the idea that changes should not break previous behavior.
And regarding the WORK board which I submitted, its configuration header file had this address encoded in the in-house U-Boot which the customer was using before; removing this address might lead to the customer provisioning scripts failing.
Shouldn't this be done with either MAC address orCONFIG_BOOTP_VCI_STRING or similar?
Regards,
Simon
PATCH 2/3 net: Remove all references to CONFIG_ETHADDR and friends
In reply to Albert ARIBAUDHi Albert,
Quoted 11 lines · Albert ARIBAUD
Bonjour Simon,
Le Mon, 4 May 2015 15:37:22 -0600, Simon Glass <[email protected]> a ?crit :
Quoted 6 lines · Joe Hershberger
Quoted 5 lines
We really don't want boards defining fixed MAC addresses in their config so we just remove the option to set it in a fixed way. If you must have a MAC address that was not provisioned, then use the random MAC address functionality.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Signed-off-by Joe Hershberger <[email protected]>---
Reviewed-by Simon Glass <[email protected]>As much as I support the idea that one should not hard-code MAC addresses, I also support the idea that changes should not break previous behavior.
What is broken?
Quoted 4 lines
And regarding the WORK board which I submitted, its configuration header file had this address encoded in the in-house U-Boot which the customer was using before; removing this address might lead to the customer provisioning scripts failing.
Please give details about these scripts? Where are they in the source tree so I can make sure they still work?
Thanks,
-Joe
PATCH 2/3 net: Remove all references to CONFIG_ETHADDR and friends
In reply to Albert ARIBAUDQuoted 16 lines · Albert ARIBAUD
Bonjour Simon,
Le Mon, 4 May 2015 15:37:22 -0600, Simon Glass <[email protected]> a ?crit :
Quoted 10 lines · Joe Hershberger
Quoted 7 lines
We really don't want boards defining fixed MAC addresses in their config so we just remove the option to set it in a fixed way. If you must have a MAC address that was not provisioned, then use the random MAC address functionality.
Signed-off-by Joe Hershberger <[email protected]>---
Reviewed-by Simon Glass <[email protected]>
Quoted 8 lines
As much as I support the idea that one should not hard-code MAC addresses, I also support the idea that changes should not break previous behavior.
And regarding the WORK board which I submitted, its configuration header file had this address encoded in the in-house U-Boot which the customer was using before; removing this address might lead to the customer provisioning scripts failing.
Wait, no. The policy for a long long time has been that you don't hard-code mac addresses into the environment, at least in mainline. "Factory" programming or provisioning or whatever it wants to be called always ends up needing to do something crazy. I'm all in favor of documenting best practices and maybe even non-default configurations that show how to do this, but the normal build for a given board needs to be otherwise sane.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150506/9597e861/attachment.sig>
PATCH 2/3 net: Remove all references to CONFIG_ETHADDR and friends
In reply to Joe HershbergerQuoted 7 lines · Joe Hershberger
We really don't want boards defining fixed MAC addresses in their config so we just remove the option to set it in a fixed way. If you must have a MAC address that was not provisioned, then use the random MAC address functionality.
Signed-off-by Joe Hershberger <[email protected]>---
Applied to u-boot-net/next.
PATCH 3/3 net: Remove all calls to net_random_ethaddr()
In reply to Joe HershbergerRemove 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.
---
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(-)
board/bct-brettl2/bct-brettl2.c +0 -13
@@ -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 ();
board/bf518f-ezbrd/bf518f-ezbrd.c +7 -21
@@ -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 */
board/bf526-ezbrd/bf526-ezbrd.c +7 -21
@@ -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)
board/bf527-ezkit/bf527-ezkit.c +1 -8
@@ -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)
board/bf537-minotaur/bf537-minotaur.c +0 -18
@@ -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 ; -}
board/bf537-pnav/bf537-pnav.c +0 -18
@@ -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 ; -}
board/bf537-srv1/bf537-srv1.c +0 -19
@@ -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 ; -}
board/bf537-stamp/bf537-stamp.c +7 -21
@@ -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)
board/buffalo/lsxl/lsxl.c +0 -10
@@ -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" ); }
board/cm-bf527/cm-bf527.c +1 -10
@@ -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)
board/cm-bf537e/cm-bf537e.c +0 -15
@@ -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 ;
board/cm-bf537u/cm-bf537u.c +0 -15
@@ -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 ;
board/dnp5370/dnp5370.c +7 -21
@@ -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)
board/ip04/ip04.c +0 -12
@@ -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
board/tcm-bf518/tcm-bf518.c +0 -40
@@ -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) {
board/tcm-bf537/tcm-bf537.c +0 -15
@@ -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 ;
configs/bct-brettl2_defconfig +2 -1
@@ -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
configs/bf518f-ezbrd_defconfig +2 -0
@@ -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
configs/bf526-ezbrd_defconfig +2 -0
@@ -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
configs/bf527-ezkit_defconfig +2 -0
@@ -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
configs/bf537-minotaur_defconfig +2 -0
@@ -1,2 +1,4 @@ CONFIG_BLACKFIN=y CONFIG_TARGET_BF537_MINOTAUR=y +CONFIG_NET=y +CONFIG_NET_RANDOM_ETHADDR=y
configs/bf537-pnav_defconfig +2 -0
@@ -1,2 +1,4 @@ CONFIG_BLACKFIN=y CONFIG_TARGET_BF537_PNAV=y +CONFIG_NET=y +CONFIG_NET_RANDOM_ETHADDR=y
configs/bf537-srv1_defconfig +2 -0
@@ -1,2 +1,4 @@ CONFIG_BLACKFIN=y CONFIG_TARGET_BF537_SRV1=y +CONFIG_NET=y +CONFIG_NET_RANDOM_ETHADDR=y
configs/bf537-stamp_defconfig +2 -0
@@ -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
configs/cm-bf527_defconfig +2 -0
@@ -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
configs/cm-bf537e_defconfig +2 -0
@@ -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
configs/cm-bf537u_defconfig +2 -0
@@ -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
configs/dnp5370_defconfig +2 -0
@@ -1,2 +1,4 @@ CONFIG_BLACKFIN=y CONFIG_TARGET_DNP5370=y +CONFIG_NET=y +CONFIG_NET_RANDOM_ETHADDR=y
configs/ip04_defconfig +2 -0
@@ -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
configs/lschlv2_defconfig +3 -1
@@ -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
configs/lsxhl_defconfig +3 -1
@@ -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
configs/tcm-bf518_defconfig +2 -0
@@ -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
configs/tcm-bf537_defconfig +2 -0
@@ -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
drivers/net/dm9000x.c +0 -6
@@ -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 */
drivers/net/ftmac110.c +0 -3
@@ -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);
include/configs/lsxl.h +0 -1
@@ -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
Signature · 1 line
1.7.11.5
Michael Walle
NAKPATCH 3/3 net: Remove all calls to net_random_ethaddr()
Hi Joe,
Am 2015-05-04 21:55, schrieb Joe Hershberger:
Quoted 10 lines
board/buffalo/lsxl/lsxl.c +0
-2@@ -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)) {
board/buffalo/lsxl/lsxl.c static void rescue_mode(void) · line 234
Quoted 10 lines
board/buffalo/lsxl/lsxl.c +0
-8-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" ); }
NAK.
You removed the "set_led(LED_ALARM_BLINKING)". (Mh, I've just discovered, that there is an indentation error). This is very important for this board, because there is no other feedback to the user than the LED. Remember, there is no serial console by default for this board. Please provide some kind of callback where you can move the sed_led() call to.
-michael
PATCH 3/3 net: Remove all calls to net_random_ethaddr()
Hi Michael,
Quoted 28 lines · Michael Walle
Hi Joe,
Am 2015-05-04 21:55, schrieb Joe Hershberger:
Quoted 11 lines
board/buffalo/lsxl/lsxl.c +0
-2@@ -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)) {board/buffalo/lsxl/lsxl.c static void rescue_mode(void) · line 234
Quoted 10 lines
board/buffalo/lsxl/lsxl.c +0
-8-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" ); }NAK.
Quoted 5 lines
You removed the "
set_led(LED_ALARM_BLINKING)". (Mh, I've just discovered, that there is an indentation error). This is very important for this board, because there is no other feedback to the user than the LED. Remember, there is no serial console by default for this board. Please provide some kind of callback where you can move thesed_led()call to.
The reason I removed it is because the only condition that was being checked for failure no longer happens at all. It only checked that the address could be written to the env. The policy is that the random address is not written to the env, but simply used for that boot. As such, there is nothing to fail.
Cheers,
-Joe
PATCH 3/3 net: Remove all calls to net_random_ethaddr()
Hi Joe,
Am 2015-05-05 19:36, schrieb Joe Hershberger:
Quoted 10 lines
Quoted 9 lines
You removed the "
set_led(LED_ALARM_BLINKING)". (Mh, I've just discovered,
that there is an indentation error). This is very important for this board,
because there is no other feedback to the user than the LED. Remember, there
is no serial console by default for this board. Please provide some kind of
callback where you can move thesed_led()call to.
Quoted 5 lines
The reason I removed it is because the only condition that was being checked for failure no longer happens at all. It only checked that the address could be written to the env. The policy is that the random address is not written to the env, but simply used for that boot. As such, there is nothing to fail.
Oh, sorry.
Yes this can then be removed. The check I had in mind was the one in check_enetaddr(). But i guess this will still work with the changes.
Again, sorry for the noise :(
-michael
PATCH 3/3 net: Remove all calls to net_random_ethaddr()
In reply to Joe HershbergerQuoted 7 lines · Joe Hershberger
Remove the calls to
net_random_ethaddr()that some boards and some drivers are calling. This is now implemented inside ofnet/eth.cEnable the feature for all boards that previously enabled it.
Signed-off-by Joe Hershberger <[email protected]>---
Applied to u-boot-net/next.
PATCH 1/3 net: Implement random ethaddr fallback in eth.c
In reply to Joe HershbergerQuoted 9 lines · Joe Hershberger
Implement the random ethaddr fallback in
eth.cso it is in a common place and not reimplemented in each board or driver that wants this behavior.Signed-off-by Joe Hershberger <[email protected]>---
To function properly in the driver-model case, this patch requires that
https://patchwork.ozlabs.org/patch/467418/ be applied.
Quoted 5 lines
README | 3 ++- doc/README.enetaddr | 2 ++ net/Kconfig | 8 ++++++++ net/eth.c | 12 ++++++++++++ 4 files changed, 24 insertions(+), 1 deletion(-)
PATCH 1/3 net: Implement random ethaddr fallback in eth.c
In reply to Joe HershbergerQuoted 8 lines · Joe Hershberger
Implement the random ethaddr fallback in
eth.cso it is in a common place and not reimplemented in each board or driver that wants this behavior.Signed-off-by Joe Hershberger <[email protected]>---
To function properly in the driver-model case, this patch requires that
https://patchwork.ozlabs.org/patch/467418/ be applied.
Applied to u-boot-net/next.