Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6CBBEC4338F for ; Tue, 17 Aug 2021 22:01:45 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C03FC6054E for ; Tue, 17 Aug 2021 22:01:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C03FC6054E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3BD0082D2D; Wed, 18 Aug 2021 00:01:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 4726482C45; Wed, 18 Aug 2021 00:00:52 +0200 (CEST) Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0585882BCE for ; Wed, 18 Aug 2021 00:00:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tom.rini@gmail.com Received: by mail-qt1-f169.google.com with SMTP id z24so18511537qtn.8 for ; Tue, 17 Aug 2021 15:00:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iA2p7WPI8EwBYG9P8lEXvg/691UXS/j/Ao/ixlDJZ3w=; b=UIY98xWKq0wP30Yxz0CRvfQEgeCn7ilRYu6KoKK3msR3KPSwxF+hNgtXKpH9tH5hcn qp5KpXwe48f9NWzIu1oAnnYB0jysdEngyyRtyIa3eUkiiPMXRBD/hHy1rdfb9imh1Qg+ 5oMFctq7YFgkv2h55s3QQsNQZafSIyHbtDE//+iJB4RtkzkSeh4fl2xdSdm1DheWuykd uk9NPZ6qdv9NYfgKD8NshHqY5r2soBDyDcU54HflP2U+DOBCF+AhU9Hfc+HHN4j2zXqS X48/CHRWGMdSPqdqJSXe+WvDw8UxGyqZksbwiEtZNGM+qsWHgw7Gz8+hUZilo4f2v3HN M1wg== X-Gm-Message-State: AOAM5305LHSpZ3h0FdKqVcGF91ObdiUpfg8Bp2DoCqB9XyzlctRKHEVn Jm6MjhTDcY589kbKjUp0Qs4e14RiWaoF X-Google-Smtp-Source: ABdhPJyCNIaaA/1/GP2Yg0wtqQ4jmJt3Mm9tsv8PFM+GKwwEtBe0ufFpNSjIRfJwAcunxm/KO4on0A== X-Received: by 2002:ac8:5195:: with SMTP id c21mr5264720qtn.382.1629237634515; Tue, 17 Aug 2021 15:00:34 -0700 (PDT) Received: from bill-the-cat.lan (2603-6081-7b01-cbda-f93a-0b29-d1e6-92fc.res6.spectrum.com. [2603:6081:7b01:cbda:f93a:b29:d1e6:92fc]) by smtp.gmail.com with ESMTPSA id 75sm2270996qko.100.2021.08.17.15.00.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Aug 2021 15:00:34 -0700 (PDT) From: Tom Rini To: u-boot@lists.denx.de Cc: Adam Ford , Lokesh Vutla Subject: [PATCH 02/13] davinci: Drop CONFIG_MAC_ADDR_IN_EEPROM Date: Tue, 17 Aug 2021 17:59:37 -0400 Message-Id: <20210817220009.22721-3-trini@konsulko.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210817220009.22721-1-trini@konsulko.com> References: <20210817220009.22721-1-trini@konsulko.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean 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 Cc: Lokesh Vutla Signed-off-by: Tom Rini --- .../mach-davinci/include/mach/davinci_misc.h | 1 - arch/arm/mach-davinci/misc.c | 27 ------------ board/davinci/da8xxevm/Kconfig | 9 ---- board/davinci/da8xxevm/da850evm.c | 41 ++----------------- board/davinci/da8xxevm/omapl138_lcdk.c | 29 ------------- 5 files changed, 3 insertions(+), 104 deletions(-) diff --git a/arch/arm/mach-davinci/include/mach/davinci_misc.h b/arch/arm/mach-davinci/include/mach/davinci_misc.h index 48b11f7a5c82..a40de0cc9c34 100644 --- a/arch/arm/mach-davinci/include/mach/davinci_misc.h +++ b/arch/arm/mach-davinci/include/mach/davinci_misc.h @@ -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, diff --git a/arch/arm/mach-davinci/misc.c b/arch/arm/mach-davinci/misc.c index 90b38b7e020e..73fdd1f24329 100644 --- a/arch/arm/mach-davinci/misc.c +++ b/arch/arm/mach-davinci/misc.c @@ -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 */ diff --git a/board/davinci/da8xxevm/Kconfig b/board/davinci/da8xxevm/Kconfig index bb1188b4ea2d..c5499a63fd36 100644 --- a/board/davinci/da8xxevm/Kconfig +++ b/board/davinci/da8xxevm/Kconfig @@ -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 diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c index 6c75231ddf77..f6ce3367f86d 100644 --- a/board/davinci/da8xxevm/da850evm.c +++ b/board/davinci/da8xxevm/da850evm.c @@ -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; } diff --git a/board/davinci/da8xxevm/omapl138_lcdk.c b/board/davinci/da8xxevm/omapl138_lcdk.c index d5f43bf52044..43d9b69ae65e 100644 --- a/board/davinci/da8xxevm/omapl138_lcdk.c +++ b/board/davinci/da8xxevm/omapl138_lcdk.c @@ -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()) -- 2.17.1