]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
net: make NET a menuconfig (and downgrade NO_NET to a simple config)
authorQuentin Schulz <quentin.schulz@cherry.de>
Mon, 20 Apr 2026 11:36:09 +0000 (13:36 +0200)
committerTom Rini <trini@konsulko.com>
Mon, 27 Apr 2026 17:26:40 +0000 (11:26 -0600)
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 <quentin.schulz@cherry.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
configs/am62px_evm_r5_ethboot_defconfig
configs/j722s_evm_r5_ethboot_defconfig
net/Kconfig

index 8baec9d43ffcdd1c0c899267e8a6e73cec965457..df49324b25aeceec6536220c9be7e0d2a4b5115b 100644 (file)
@@ -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
index e4682edb45544e6cb2795d4aa91293e2e5214b8d..cc71f913d3c832a5a5f46e44c249c54144bcbd41 100644 (file)
@@ -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
index 89d949b5f2c8d72cb6eaf99dfedd1bd1f906c151..e712a0dd2ace1513a1b1f23506d825e193185404 100644 (file)
@@ -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