common/board_r.c: drop legacy and unused bi_enetaddr
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>
Fri, 20 May 2022 11:19:08 +0000 (13:19 +0200)
committerTom Rini <trini@konsulko.com>
Mon, 6 Jun 2022 22:01:21 +0000 (18:01 -0400)
The bi_enetaddr field in struct bd_info is write-only; nothing ever
reads back the value.

Moreover, the value we write is more or less random, and certainly not
something one can rely on: If the board has a writable environment and
the mac address has been stored there, we fetch that value. But if the
board doesn't, this code runs before initr_net() -> eth_initialize(),
and thus before the code in eth-uclass which fetches MAC addresses
from eeprom, fuses or whatnot and populates the (run-time) environment
with those values.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Tom Rini <trini@konsulko.com>
common/board_r.c
include/asm-generic/u-boot.h

index 4e3cf1f..ed29069 100644 (file)
@@ -469,18 +469,6 @@ static int initr_malloc_bootparams(void)
 }
 #endif
 
-#ifdef CONFIG_CMD_NET
-static int initr_ethaddr(void)
-{
-       struct bd_info *bd = gd->bd;
-
-       /* kept around for legacy kernels only ... ignore the next section */
-       eth_env_get_enetaddr("ethaddr", bd->bi_enetaddr);
-
-       return 0;
-}
-#endif /* CONFIG_CMD_NET */
-
 #if defined(CONFIG_LED_STATUS)
 static int initr_status_led(void)
 {
@@ -759,9 +747,6 @@ static init_fnc_t init_sequence_r[] = {
        initr_status_led,
 #endif
        /* PPC has a udelay(20) here dating from 2002. Why? */
-#ifdef CONFIG_CMD_NET
-       initr_ethaddr,
-#endif
 #if defined(CONFIG_GPIO_HOG)
        gpio_hog_probe_all,
 #endif
index 1becc66..70303ac 100644 (file)
@@ -48,7 +48,6 @@ struct bd_info {
 #endif
        unsigned long   bi_bootflags;   /* boot / reboot flag (Unused) */
        unsigned long   bi_ip_addr;     /* IP Address */
-       unsigned char   bi_enetaddr[6]; /* OLD: see README.enetaddr */
        unsigned short  bi_ethspeed;    /* Ethernet speed in Mbps */
        unsigned long   bi_intfreq;     /* Internal Freq, in MHz */
        unsigned long   bi_busfreq;     /* Bus Freq, in MHz */