From patchwork Fri Dec 2 21:42:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rini X-Patchwork-Id: 1711628 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.a=rsa-sha256 header.s=google header.b=CVkGt7JR; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NP6554H3Rz23n4 for ; Sat, 3 Dec 2022 08:48:25 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BDC4385430; Fri, 2 Dec 2022 22:44:13 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="CVkGt7JR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A8EF58524E; Fri, 2 Dec 2022 22:43:33 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) (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 6AF92850EA for ; Fri, 2 Dec 2022 22:43:26 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-ej1-x635.google.com with SMTP id vp12so14431143ejc.8 for ; Fri, 02 Dec 2022 13:43:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=445X4mVblb/vR3b/F9t6xN6bpnkEjpjb1U621+va4AQ=; b=CVkGt7JRbPlWi1smCFBRWpHc/6FHcdjLWJC4OlE4h/nD/hG1+Z4CbRKDhWGvctQVm9 HTY/SRPBGqLr2/VgEI9amn1aR9baRIdCjK7gE2hzo4KtvkZSn45l3PoETdL7ruzlihz3 /Hm/TW4CWoR1LaASdPQ+zyqOjwGBc7bJPcyXQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=445X4mVblb/vR3b/F9t6xN6bpnkEjpjb1U621+va4AQ=; b=e0+Yl8Y6R6+qNn70UOKNaRKlPAHqVZ152x2BzOd3U+BxEbBKkXg0zQf1c1CYL4+IIw dFz/dduVl8m1yukgl3m3xxYo4E4ZvmZwkiOQ9kV1bRH4ncHyymZZObXLpwLwmU5uma45 8qE3sU8psqZyq3MqeCGBn6HvjVPPvJhANqXJef5fz9p1iRVVBxUiMEYRaX4xMBBdYr17 naGsIbAI6mdsDUIFWuVkStTcX6eZLhKwkEkWiDQm2cpTZmqHYxCbFBb8i4Oz3eDUCug4 dZX+pOob913uuSFBuH3scFffwlEiplY96Ftf7fUsCcMpfeVznhUN6FCCCPZTG4yfbq9C 521w== X-Gm-Message-State: ANoB5plHVIr2a6iOq5vXSN+7Tx/mM+PPxF6yHAOlTF0fhD+z3URlD8yN qr0ExgQ4YKyltwbKm+2PP4ax4f0swb8s64YF X-Google-Smtp-Source: AA0mqf5DEyIWhauB7fMYoELG1oDQZaHyWLKmXYef2ZE5wJDpxBugdcWavg4E9qRgqTg/jCQX9hCTYQ== X-Received: by 2002:a17:906:8e94:b0:7bf:7ac6:69c3 with SMTP id ru20-20020a1709068e9400b007bf7ac669c3mr5943769ejc.621.1670017405935; Fri, 02 Dec 2022 13:43:25 -0800 (PST) Received: from bill-the-cat.lan (2603-6081-7b00-6400-f99b-6f1a-2cc1-7368.res6.spectrum.com. [2603:6081:7b00:6400:f99b:6f1a:2cc1:7368]) by smtp.gmail.com with ESMTPSA id b23-20020a1709062b5700b007c0991735c0sm3434248ejg.79.2022.12.02.13.43.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 13:43:25 -0800 (PST) From: Tom Rini To: u-boot@lists.denx.de Subject: [PATCH 29/41] Convert CONFIG_OVERWRITE_ETHADDR_ONCE to Kconfig Date: Fri, 2 Dec 2022 16:42:39 -0500 Message-Id: <20221202214251.3027264-29-trini@konsulko.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221202214251.3027264-1-trini@konsulko.com> References: <20221127152536.1556469-41-trini@konsulko.com> <20221202214251.3027264-1-trini@konsulko.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean This converts the following to Kconfig: CONFIG_OVERWRITE_ETHADDR_ONCE Signed-off-by: Tom Rini --- README | 7 ------- configs/M5253DEMO_defconfig | 1 + configs/M5275EVB_defconfig | 1 + configs/eb_cpu5282_defconfig | 1 + configs/eb_cpu5282_internal_defconfig | 1 + env/Kconfig | 9 +++++++++ include/configs/M5253DEMO.h | 2 -- include/configs/M5275EVB.h | 4 ---- include/configs/eb_cpu5282.h | 4 ---- 9 files changed, 13 insertions(+), 17 deletions(-) diff --git a/README b/README index 9e2627863ce5..3ebee1cb3755 100644 --- a/README +++ b/README @@ -1071,13 +1071,6 @@ The following options need to be configured: completely disabled. Anybody can change or delete these parameters. - 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 - read-only.] - The same can be accomplished in a more flexible way for any variable by configuring the type of access to allow for those variables in the ".flags" variable diff --git a/configs/M5253DEMO_defconfig b/configs/M5253DEMO_defconfig index 4de6290b7d31..ea079972c9bc 100644 --- a/configs/M5253DEMO_defconfig +++ b/configs/M5253DEMO_defconfig @@ -25,6 +25,7 @@ CONFIG_CMD_CACHE=y CONFIG_CMD_EXT2=y CONFIG_CMD_FAT=y CONFIG_MAC_PARTITION=y +CONFIG_OVERWRITE_ETHADDR_ONCE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_USE_HOSTNAME=y CONFIG_HOSTNAME="M5253DEMO" diff --git a/configs/M5275EVB_defconfig b/configs/M5275EVB_defconfig index 01961e5ae27f..d84d9d98c5ac 100644 --- a/configs/M5275EVB_defconfig +++ b/configs/M5275EVB_defconfig @@ -31,6 +31,7 @@ CONFIG_CMD_MII=y CONFIG_MII_INIT=y CONFIG_CMD_PING=y CONFIG_CMD_CACHE=y +CONFIG_OVERWRITE_ETHADDR_ONCE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_SYS_FAULT_ECHO_LINK_DOWN=y CONFIG_SYS_RX_ETH_BUFFER=8 diff --git a/configs/eb_cpu5282_defconfig b/configs/eb_cpu5282_defconfig index a831c1c5d2aa..7304b4938725 100644 --- a/configs/eb_cpu5282_defconfig +++ b/configs/eb_cpu5282_defconfig @@ -32,6 +32,7 @@ CONFIG_BOOTP_BOOTFILESIZE=y CONFIG_CMD_MII=y CONFIG_MII_INIT=y CONFIG_CMD_DATE=y +CONFIG_OVERWRITE_ETHADDR_ONCE=y CONFIG_SYS_FAULT_ECHO_LINK_DOWN=y CONFIG_SYS_RX_ETH_BUFFER=8 CONFIG_SYS_I2C_LEGACY=y diff --git a/configs/eb_cpu5282_internal_defconfig b/configs/eb_cpu5282_internal_defconfig index 6a673c918110..5ecdda418aad 100644 --- a/configs/eb_cpu5282_internal_defconfig +++ b/configs/eb_cpu5282_internal_defconfig @@ -30,6 +30,7 @@ CONFIG_BOOTP_BOOTFILESIZE=y CONFIG_CMD_MII=y CONFIG_MII_INIT=y CONFIG_CMD_DATE=y +CONFIG_OVERWRITE_ETHADDR_ONCE=y CONFIG_SYS_FAULT_ECHO_LINK_DOWN=y CONFIG_SYS_RX_ETH_BUFFER=8 CONFIG_SYS_I2C_LEGACY=y diff --git a/env/Kconfig b/env/Kconfig index c28d9e89f68b..7ca992aa1d40 100644 --- a/env/Kconfig +++ b/env/Kconfig @@ -30,6 +30,15 @@ config ENV_OVERWRITE Use this to permit overriding of certain environmental variables like Ethernet and Serial +config OVERWRITE_ETHADDR_ONCE + bool "Enable overwriting ethaddr environment variables once" + depends on !ENV_OVERWRITE + help + Enable this to allow for the ethaddr environment variables to be + overwritten one time per boot, only. This allows for a default + to be installed in the environment, which can be changed exactly ONCE + by the user. + config ENV_MIN_ENTRIES int "Minimum number of entries in the environment hashtable" default 64 diff --git a/include/configs/M5253DEMO.h b/include/configs/M5253DEMO.h index 65a7aa04086e..bc156df20d51 100644 --- a/include/configs/M5253DEMO.h +++ b/include/configs/M5253DEMO.h @@ -20,8 +20,6 @@ env/embedded.o(.text*); #ifdef CONFIG_DRIVER_DM9000 -# define CONFIG_OVERWRITE_ETHADDR_ONCE - # define CONFIG_EXTRA_ENV_SETTINGS \ "netdev=eth0\0" \ "inpclk=" __stringify(CONFIG_SYS_INPUT_CLKSRC) "\0" \ diff --git a/include/configs/M5275EVB.h b/include/configs/M5275EVB.h index ff9f85358963..41974cff410d 100644 --- a/include/configs/M5275EVB.h +++ b/include/configs/M5275EVB.h @@ -38,10 +38,6 @@ #define CFG_SYS_I2C_PINMUX_CLR (0xFFF0) #define CFG_SYS_I2C_PINMUX_SET (0x000F) -#ifdef CONFIG_MCFFEC -# define CONFIG_OVERWRITE_ETHADDR_ONCE -#endif /* FEC_ENET */ - #define CONFIG_EXTRA_ENV_SETTINGS \ "netdev=eth0\0" \ "loadaddr=10000\0" \ diff --git a/include/configs/eb_cpu5282.h b/include/configs/eb_cpu5282.h index b267b74b1595..26e4ade34ee7 100644 --- a/include/configs/eb_cpu5282.h +++ b/include/configs/eb_cpu5282.h @@ -42,10 +42,6 @@ * Network * *----------------------------------------------------------------------*/ -#ifdef CONFIG_MCFFEC -#define CONFIG_OVERWRITE_ETHADDR_ONCE -#endif - /*------------------------------------------------------------------------- * Low Level Configuration Settings * (address mappings, register initial values, etc.)