Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id ABDB3F588C5 for ; Mon, 20 Apr 2026 12:54:48 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9CEA384383; Mon, 20 Apr 2026 14:54:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=0leil.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=0leil.net header.i=@0leil.net header.b="JSUUqbqK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D85E784314; Mon, 20 Apr 2026 13:36:53 +0200 (CEST) Received: from smtp-bc09.mail.infomaniak.ch (smtp-bc09.mail.infomaniak.ch [IPv6:2001:1600:7:10::bc09]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C00CA83E16 for ; Mon, 20 Apr 2026 13:36:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=0leil.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=foss+uboot@0leil.net Received: from smtp-4-0000.mail.infomaniak.ch (unknown [IPv6:2001:1600:7:10::a6b]) by smtp-4-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4fzk3R3cChz1C3v; Mon, 20 Apr 2026 13:36:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=0leil.net; s=20231125; t=1776685009; bh=sMhlt6JOPSP6rQAmuvvk6YnnTwj4XeAR93xEmHCzgbQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=JSUUqbqKlAjLt0VBKPOWblqvm1FsLrzkiXgBCbR8/F1AcrA0DvuyoxYez2bma+cKa uDPXD6DYMr5X8rK/bIkQG7D6mQjY8+XYN+VLSU3s2853NC6aYF7DuB8Tao9D1CHHZ6 PYTDmGnjuzx/VteIi6OgWOjMSUO4/2SgCbX73NXgKK1DseLO2vu+Hf6u3oirBt2hnh 4t2ARN91McAm/nC6Cpq6CvHgg+diFRBFAMDr14iYaIbHkXGtkdKW/neaPETXsVbinA 4A3yuXeB9urL0t5KczxhRlDvf/B2gUJIVUIyPhmYdT3zMnnWfe4D+JYq5/IZ0y1VYz KIt2FbDJ0pBog== Received: from unknown by smtp-4-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4fzk3H1ZdLzVpn; Mon, 20 Apr 2026 13:36:43 +0200 (CEST) From: Quentin Schulz Date: Mon, 20 Apr 2026 13:36:09 +0200 Subject: [PATCH 3/6] net: make NET a menuconfig (and downgrade NO_NET to a simple config) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260420-net-kconfig-v1-3-9900002d8e72@cherry.de> References: <20260420-net-kconfig-v1-0-9900002d8e72@cherry.de> In-Reply-To: <20260420-net-kconfig-v1-0-9900002d8e72@cherry.de> To: u-boot@lists.denx.de, uboot-stm32@st-md-mailman.stormreply.com, Paul Barker Cc: Tom Rini , Jerome Forissier , Heinrich Schuchardt , Marek Vasut , Ilias Apalodimas , Peng Fan , Udit Kumar , =?utf-8?q?Alvin_=C5=A0ipraga?= , Patrick Delaunay , Patrice Chotard , Adam Ford , Manoj Sai , Matteo Lisi , Tim Harvey , Mingkai Hu , Pramod Kumar , Gilles Talis , Le Jin , Jan Kiszka , Kongyang Liu , Stefan Roese , Francesco Dolcini , Michal Simek , Mattijs Korpershoek , Casey Connolly , Vignesh Raghavendra , Bryan Brattlof , Vaishnav Achath , Jayesh Choudhary , Simon Glass , Lukasz Majewski , Marek Vasut , Sughosh Ganu , Yao Zi , Fabio Estevam , Alice Guo , Sam Protsenko , Martyn Welch , Maarten Brock , Kory Maincent , "Markus Schneider-Pargmann (TI.com)" , Padmarao Begari , Matthias Brugger , Mikhail Kshevetskiy , Heiko Schocher , Andrew Goodbody , Peter Robinson , Brian Sune , Julien Stephan , Dinesh Maniyam , Ben Dooks , Tien Fong Chee , Leo Yu-Chi Liang , Weijie Gao , Anshul Dalal , Neil Armstrong , Andre Przywara , Andrew Davis , Hrushikesh Salunke , Alexey Charkov , Dario Binacchi , Ye Li , Andreas Dannenberg , Chintan Vankar , Martin Schwan , Benjamin Hahn , David Lechner , Ariel D'Alessandro , Dmitrii Merkurev , Christian Marangi , Robert Marko , Beiyan Yun , "Lucien.Jheng" , Romain Gantois , Siddharth Vadapalli , Kever Yang , Jonas Karlman , George Chan , Balaji Selvanathan , Benjamin ROBIN , Max Merchel , Sean Edmond , Christoph Niedermaier , Shantur Rathore , "Ying-Chun Liu (PaulLiu)" , Adriano Cordova , Sky Huang , Quentin Schulz X-Mailer: b4 0.15-dev-47773 X-Infomaniak-Routing: alpha X-Mailman-Approved-At: Mon, 20 Apr 2026 14:54:20 +0200 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.8 at phobos.denx.de X-Virus-Status: Clean From: Quentin Schulz This will allow a bunch of simplifications across the code base. Disabling NET is the equivalent of today's NO_NET choice. This means that if NET is enabled, either the legacy or lwIP stack is necessarily selected, which allows us to simplify if NET_LEGACY || NET_LWIP into if NET in a later commit. Config fragments - or defconfigs including other defconfigs - setting the network stack (NET_LEGACY or NET_LWIP) must also set NET (or unset NO_NET) if the config they apply to - or the included defconfigs - unsets NET (or selects NO_NET) as otherwise the NET_LEGACY and NET_LWIP symbols are unreachable. This is the case for the two defconfig modified in this commit. NO_NET is now a convenience symbol which hides NET entirely to avoid modifying many defconfigs. If one selected NO_NET to disable the networking stack in the past, this will still work for now. Technically, we should be using the "transitional" Kconfig attribute but that is only available since Kconfig from Linux kernel v6.18 and we're on 6.1 right now. Note that this moves CONFIG_SYS_RX_ETH_BUFFER from under the Network menu back into the main menu as it seems like it needs to be defined even when there's no need for NET support at all and menuconfig option doesn't work the same way as a menu. Signed-off-by: Quentin Schulz --- I'd say we should have everything net-related depends on NET as well, so that disabling networking support with NET=n is also disabling anything related (e.g. Ethernet controller and PHY drivers, USB Ethernet, USB gadget CDC/RNDIS, network CLI commands, etc.). --- configs/am62px_evm_r5_ethboot_defconfig | 2 +- configs/j722s_evm_r5_ethboot_defconfig | 2 +- net/Kconfig | 23 ++++++++++++----------- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/configs/am62px_evm_r5_ethboot_defconfig b/configs/am62px_evm_r5_ethboot_defconfig index 8baec9d43ff..df49324b25a 100644 --- a/configs/am62px_evm_r5_ethboot_defconfig +++ b/configs/am62px_evm_r5_ethboot_defconfig @@ -5,7 +5,7 @@ CONFIG_ARCH_K3=y CONFIG_SOC_K3_AM62P5=y CONFIG_TARGET_AM62P5_R5_EVM=y CONFIG_DEFAULT_DEVICE_TREE="k3-am62p5-r5-sk" -CONFIG_NET_LEGACY=y +# CONFIG_NO_NET is not set CONFIG_SPL_BOARD_INIT=y CONFIG_SPL_DMA=y CONFIG_SPL_ENV_SUPPORT=y diff --git a/configs/j722s_evm_r5_ethboot_defconfig b/configs/j722s_evm_r5_ethboot_defconfig index e4682edb455..cc71f913d3c 100644 --- a/configs/j722s_evm_r5_ethboot_defconfig +++ b/configs/j722s_evm_r5_ethboot_defconfig @@ -5,7 +5,7 @@ CONFIG_ARCH_K3=y CONFIG_SOC_K3_J722S=y CONFIG_TARGET_J722S_R5_EVM=y CONFIG_DEFAULT_DEVICE_TREE="k3-j722s-r5-evm" -CONFIG_NET_LEGACY=y +# CONFIG_NO_NET is not set CONFIG_SPL_DRIVERS_MISC=y CONFIG_SPL_BOARD_INIT=y CONFIG_SPL_DMA=y diff --git a/net/Kconfig b/net/Kconfig index 89d949b5f2c..e712a0dd2ac 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -2,17 +2,22 @@ # Network configuration # -menu "Networking" +config NO_NET + bool "Disable networking" + help + Transitional variable. Equivalent to setting NET=n. + +menuconfig NET + bool "Networking" + depends on !NO_NET + default y + +if NET choice prompt "Networking stack" default NET_LEGACY -config NO_NET - bool "No networking support" - help - Do not include networking support - config NET_LEGACY bool "Legacy U-Boot networking stack" select NETDEVICES @@ -231,8 +236,6 @@ endif # if NET_LEGACY source "net/lwip/Kconfig" -if NET_LEGACY || NET_LWIP - config BOOTDEV_ETH bool "Enable bootdev for ethernet" depends on BOOTSTD @@ -276,7 +279,7 @@ config TFTP_BLOCKSIZE almost-MTU block sizes. You can also activate CONFIG_IP_DEFRAG to set a larger block. -endif # if NET_LEGACY || NET_LWIP +endif # if NET config SYS_RX_ETH_BUFFER int "Number of receive packet buffers" @@ -286,5 +289,3 @@ config SYS_RX_ETH_BUFFER controllers it is recommended to set this value to 8 or even higher, since all buffers can be full shortly after enabling the interface on high Ethernet traffic. - -endmenu -- 2.53.0