[PATCH 3/6] net: make NET a menuconfig (and downgrade NO_NET to a simple config)

Quentin Schulz quentin.schulz at cherry.de
Tue Apr 21 10:37:54 CEST 2026


Hi Heinrich,

On 4/20/26 10:24 PM, Heinrich Schuchardt wrote:
> Am 20. April 2026 13:36:09 MESZ schrieb Quentin Schulz <foss+uboot at 0leil.net>:
>> From: Quentin Schulz <quentin.schulz at cherry.de>
>>
>> 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 at cherry.de>
>> ---
>>
>> 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
> 
> Does this imply that NET_LEGACY is the default? Choosing LEGACY as default would not be plausible to me. We should use LWIP as default. Then every new board will use it, hopefully.
> 

(below, "current" means the value in master branch, so before this 
series is applied).

(current) CONFIG_NET is the default already, see 
https://source.denx.de/u-boot/u-boot/-/blob/master/Kconfig#L794-L824. 
This series does not aim to change anything but the name of the symbols. 
Yes, we could make NET_LWIP the new default stack, but not in this 
series. Also, we have an issue that if you enable SPL_NET you need the 
legacy stack, even in proper (according to 
https://source.denx.de/u-boot/u-boot/-/blob/master/common/spl/Kconfig#L1152-L1154). 
So we would need to tackle this first (we don't necessarily need to 
support lwIP in SPL, just that the choice in SPL shouldn't impact the 
choice in proper).

If you're asking about this defconfig specifically, it's simply because 
it is not a typical defconfig. It includes 
configs/am62px_evm_r5_defconfig which sets CONFIG_NO_NET=y. Because 
NO_NET used to (before this series) be a choice with (current) NET and 
NET_LWIP, am62px_evm_r5_ethboot_defconfig needed to override it with 
another choice, namely (current) NET. Because NET_LEGACY is 
automatically selected when NO_NET is unset (due to NET default y), we 
only need to unset NO_NET in configs/am62px_evm_r5_ethboot_defconfig to 
restore the current state of enabling the legacy stack (current NET, now 
NET_LEGACY). This is not changing anything, just moving things around.

Does this answer your question?

Cheers,
Quentin


More information about the U-Boot mailing list