]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
davinci: Drop CONFIG_MAC_ADDR_IN_EEPROM
authorTom Rini <trini@konsulko.com>
Tue, 17 Aug 2021 21:59:37 +0000 (17:59 -0400)
committerTom Rini <trini@konsulko.com>
Mon, 30 Aug 2021 18:10:05 +0000 (14:10 -0400)
Looking over the current boards, there are no users of
CONFIG_MAC_ADDR_IN_EEPROM.  Further, omapl138_lcdk uses
CONFIG_NET_RANDOM_ETHADDR.  Drop various unused code paths.

Cc: Adam Ford <aford173@gmail.com>
Cc: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
arch/arm/mach-davinci/include/mach/davinci_misc.h
arch/arm/mach-davinci/misc.c
board/davinci/da8xxevm/Kconfig
board/davinci/da8xxevm/da850evm.c
board/davinci/da8xxevm/omapl138_lcdk.c

index 48b11f7a5c82bb3881cb127627669640df9d3ae2..a40de0cc9c345cf7487c100c619fa0cde4514cc3 100644 (file)
@@ -35,7 +35,6 @@ struct lpsc_resource {
        const int       lpsc_no;
 };
 
-int dvevm_read_mac_address(uint8_t *buf);
 void davinci_sync_env_enetaddr(uint8_t *rom_enetaddr);
 int davinci_configure_pin_mux(const struct pinmux_config *pins, int n_pins);
 int davinci_configure_pin_mux_items(const struct pinmux_resource *item,
index 90b38b7e020eb4a4e5c3d3e239d6f617704bde15..73fdd1f243292246da66064766fa8bc2a75ce5d9 100644 (file)
@@ -41,33 +41,6 @@ int dram_init_banksize(void)
 #endif
 
 #ifdef CONFIG_DRIVER_TI_EMAC
-/*
- * Read ethernet MAC address from EEPROM for DVEVM compatible boards.
- * Returns 1 if found, 0 otherwise.
- */
-int dvevm_read_mac_address(uint8_t *buf)
-{
-#ifdef CONFIG_SYS_I2C_EEPROM_ADDR
-       /* Read MAC address. */
-       if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0x7F00,
-               CONFIG_SYS_I2C_EEPROM_ADDR_LEN, (uint8_t *) &buf[0], 6))
-               goto i2cerr;
-
-       /* Check that MAC address is valid. */
-       if (!is_valid_ethaddr(buf))
-               goto err;
-
-       return 1; /* Found */
-
-i2cerr:
-       printf("Read from EEPROM @ 0x%02x failed\n",
-               CONFIG_SYS_I2C_EEPROM_ADDR);
-err:
-#endif /* CONFIG_SYS_I2C_EEPROM_ADDR */
-
-       return 0;
-}
-
 /*
  * Set the mii mode as MII or RMII
  */
index bb1188b4ea2d27ed3efd8225301755b0adc1548c..c5499a63fd36f54991033f6829fef88585a3cf90 100644 (file)
@@ -22,15 +22,6 @@ config MAC_ADDR_IN_SPIFLASH
          their MAC address in SPI Flash from the factory
          Enable this option to read the MAC from SPI Flash
 
-config MAC_ADDR_IN_EEPROM
-       bool "MAC address in EEPROM"
-       help
-         The DA850 EVM comes with SoM are programmed with
-         their MAC address in SPI Flash from the factory,
-         but the kit has an optional expansion board with
-         EEPROM available.  Enable this option to read the
-         MAC from the EEPROM
-
 endif
 
 endif
index 6c75231ddf775403c1db9b0697aaf6594999fae2..f6ce3367f86dac63e125467a63dc5a5d3fcd7d9a 100644 (file)
@@ -129,19 +129,12 @@ int misc_init_r(void)
 {
        dspwake();
 
-#if defined(CONFIG_MAC_ADDR_IN_SPIFLASH) || defined(CONFIG_MAC_ADDR_IN_EEPROM)
-
-       uchar env_enetaddr[6];
-       int enetaddr_found;
+#if defined(CONFIG_MAC_ADDR_IN_SPIFLASH)
+       uchar env_enetaddr[6], buff[6];
+       int enetaddr_found, spi_mac_read;
 
        enetaddr_found = eth_env_get_enetaddr("ethaddr", env_enetaddr);
 
-#endif
-
-#ifdef CONFIG_MAC_ADDR_IN_SPIFLASH
-       int spi_mac_read;
-       uchar buff[6];
-
        spi_mac_read = get_mac_addr(buff);
        buff[0] = 0;
 
@@ -173,34 +166,6 @@ int misc_init_r(void)
                                        "with the MAC address in the environment\n");
                printf("Default using MAC address from environment\n");
        }
-
-#elif defined(CONFIG_MAC_ADDR_IN_EEPROM)
-       uint8_t enetaddr[8];
-       int eeprom_mac_read;
-
-       /* Read Ethernet MAC address from EEPROM */
-       eeprom_mac_read = dvevm_read_mac_address(enetaddr);
-
-       /*
-        * MAC address not present in the environment
-        * try and read the MAC address from EEPROM flash
-        * and set it.
-        */
-       if (!enetaddr_found) {
-               if (eeprom_mac_read)
-                       /* Set Ethernet MAC address from EEPROM */
-                       davinci_sync_env_enetaddr(enetaddr);
-       } else {
-               /*
-                * MAC address present in environment compare it with
-                * the MAC address in EEPROM and warn on mismatch
-                */
-               if (eeprom_mac_read && memcmp(enetaddr, env_enetaddr, 6))
-                       printf("Warning: MAC address in EEPROM don't match "
-                                       "with the MAC address in the environment\n");
-               printf("Default using MAC address from environment\n");
-       }
-
 #endif
        return 0;
 }
index d5f43bf52044b22fcdde51b2b53a1664e5357b1b..43d9b69ae65e26c04938e87851d266a9d3357c43 100644 (file)
@@ -236,12 +236,6 @@ int board_init(void)
 
 #define CFG_MAC_ADDR_OFFSET    (flash->size - SZ_64K)
 
-static int  get_mac_addr(u8 *addr)
-{
-       /* Need to find a way to get MAC ADDRESS */
-       return 0;
-}
-
 void dsp_lpsc_on(unsigned domain, unsigned int id)
 {
        dv_reg_p mdstat, mdctl, ptstat, ptcmd;
@@ -304,29 +298,6 @@ int rmii_hw_init(void)
 
 int misc_init_r(void)
 {
-       uint8_t tmp[20], addr[10];
-
-
-       if (env_get("ethaddr") == NULL) {
-               /* Read Ethernet MAC address from EEPROM */
-               if (dvevm_read_mac_address(addr)) {
-                       /* Set Ethernet MAC address from EEPROM */
-                       davinci_sync_env_enetaddr(addr);
-               } else {
-                       get_mac_addr(addr);
-               }
-
-               if (!is_multicast_ethaddr(addr) && !is_zero_ethaddr(addr)) {
-                       sprintf((char *)tmp, "%02x:%02x:%02x:%02x:%02x:%02x",
-                               addr[0], addr[1], addr[2], addr[3], addr[4],
-                               addr[5]);
-
-                       env_set("ethaddr", (char *)tmp);
-               } else {
-                       printf("Invalid MAC address read.\n");
-               }
-       }
-
 #ifdef CONFIG_DRIVER_TI_EMAC_USE_RMII
        /* Select RMII fucntion through the expander */
        if (rmii_hw_init())