]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
simplify NET_LEGACY || NET_LWIP condition with NET condition
authorQuentin Schulz <quentin.schulz@cherry.de>
Mon, 20 Apr 2026 11:36:10 +0000 (13:36 +0200)
committerTom Rini <trini@konsulko.com>
Mon, 27 Apr 2026 17:26:40 +0000 (11:26 -0600)
Since the move to make NET a menuconfig and NO_NET a synonym of NET=n,
when NET is enabled, NET_LEGACY || NET_LWIP is necessarily true, so
let's simplify the various checks across the codebase.

SPL_NET_LWIP doesn't exist but SPL_NET_LEGACY is an alias for SPL_NET so
the proper symbol is still defined in SPL whenever needed.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
23 files changed:
Makefile
board/engicam/imx8mp/icore_mx8mp.c
board/polyhex/imx8mp_debix_model_a/imx8mp_debix_model_a.c
board/ti/am335x/board.c
board/xilinx/common/board.c
cmd/Kconfig
cmd/bdinfo.c
common/Kconfig
common/board_r.c
doc/usage/cmd/bdinfo.rst
drivers/net/Kconfig
drivers/net/phy/Kconfig
drivers/usb/gadget/Kconfig
env/flags.c
include/env_callback.h
include/env_flags.h
include/net-common.h
lib/efi_loader/Kconfig
net/Makefile
test/cmd/bdinfo.c
test/py/tests/test_efi_loader.py
test/py/tests/test_fpga.py
test/py/tests/test_net.py

index 285a9e2beed261284a17264909b53a641c5b6fc1..32d82c0697ac81e5c328c3eb2d1647edebdd35ba 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1081,7 +1081,7 @@ libs-$(CONFIG_OF_EMBED) += dts/
 libs-y += env/
 libs-y += lib/
 libs-y += fs/
-libs-$(filter y,$(CONFIG_NET_LEGACY) $(CONFIG_NET_LWIP)) += net/
+libs-$(CONFIG_NET) += net/
 libs-y += disk/
 libs-y += drivers/
 libs-$(CONFIG_SYS_FSL_DDR) += drivers/ddr/fsl/
index f01da9612351784f30f20dc73521456af023231d..547cfa3a35f9de8e1c0b3b6a04afc3ca3f9df381 100644 (file)
@@ -30,7 +30,7 @@ static void setup_fec(void)
        setbits_le32(&gpr->gpr[1], BIT(22));
 }
 
-#if CONFIG_IS_ENABLED(NET_LEGACY) || CONFIG_IS_ENABLED(NET_LWIP)
+#if CONFIG_IS_ENABLED(NET)
 int board_phy_config(struct phy_device *phydev)
 {
        if (phydev->drv->config)
index cff9383bad4f8ce0c06fce3b306c0331d0ee7532..23d24140ca7bb213e40e1fc35bb18041588e7d92 100644 (file)
@@ -26,7 +26,7 @@ static void setup_fec(void)
        setbits_le32(&gpr->gpr[1], BIT(22));
 }
 
-#if CONFIG_IS_ENABLED(NET_LEGACY) || CONFIG_IS_ENABLED(NET_LWIP)
+#if CONFIG_IS_ENABLED(NET)
 int board_phy_config(struct phy_device *phydev)
 {
        if (phydev->drv->config)
index 4b7aa5c85860f0dc69fcd581eb8956bf4891d42c..b5f69a45a7cb94dd7f0f38ab2b83874888667fe9 100644 (file)
@@ -911,7 +911,7 @@ int board_late_init(void)
 #endif
 
 /* CPSW plat */
-#if (CONFIG_IS_ENABLED(NET_LEGACY) || CONFIG_IS_ENABLED(NET_LWIP)) && \
+#if CONFIG_IS_ENABLED(NET) && \
     !CONFIG_IS_ENABLED(OF_CONTROL)
 struct cpsw_slave_data slave_data[] = {
        {
index b21a136113781377e4b1944d1e8e52e864364677..89562ef77fc56476b0995e21d41f0ac12353a61c 100644 (file)
@@ -508,8 +508,7 @@ int board_late_init_xilinx(void)
                                ret |= env_set_by_index("uuid", id, uuid);
                        }
 
-                       if (!(CONFIG_IS_ENABLED(NET_LEGACY) ||
-                             CONFIG_IS_ENABLED(NET_LWIP)))
+                       if (!CONFIG_IS_ENABLED(NET))
                                continue;
 
                        for (i = 0; i < EEPROM_HDR_NO_OF_MAC_ADDR; i++) {
index f19a656146aff672666b706dc0a32172a8ee0310..64f70b22e26aa19f34c6cfa46297f9ea5362e71f 100644 (file)
@@ -1946,7 +1946,7 @@ config CMD_XXD
 
 endmenu
 
-if NET_LEGACY || NET_LWIP
+if NET
 
 menuconfig CMD_NET
        bool "Network commands"
@@ -2329,7 +2329,7 @@ config CMD_PXE
 
 endif  # if CMD_NET
 
-endif # NET_LEGACY || NET_LWIP
+endif # NET
 
 menu "Misc commands"
 
index 39e7bec3885ec4e018dcd100c81b545948f534cb..ddf77303735cbe401b89f2f3fbcbc2083893e06f 100644 (file)
@@ -152,7 +152,7 @@ static int bdinfo_print_all(struct bd_info *bd)
        bdinfo_print_num_l("relocaddr", gd->relocaddr);
        bdinfo_print_num_l("reloc off", gd->reloc_off);
        printf("%-12s= %u-bit\n", "Build", (uint)sizeof(void *) * 8);
-       if (IS_ENABLED(CONFIG_NET_LEGACY) || IS_ENABLED(CONFIG_NET_LWIP))
+       if (IS_ENABLED(CONFIG_NET))
                print_eth();
        bdinfo_print_num_l("fdt_blob", (ulong)map_to_sysmem(gd->fdt_blob));
        if (IS_ENABLED(CONFIG_VIDEO))
@@ -194,8 +194,7 @@ int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
                case 'a':
                        return bdinfo_print_all(bd);
                case 'e':
-                       if (!IS_ENABLED(CONFIG_NET_LEGACY) &&
-                           !IS_ENABLED(CONFIG_NET_LWIP))
+                       if (!IS_ENABLED(CONFIG_NET))
                                return CMD_RET_USAGE;
                        print_eth();
                        return CMD_RET_SUCCESS;
@@ -221,7 +220,7 @@ U_BOOT_CMD(
        "  - print all Board Info structure"
 #if CONFIG_IS_ENABLED(GETOPT)
        "\n"
-#if IS_ENABLED(CONFIG_NET_LEGACY) || IS_ENABLED(CONFIG_NET_LWIP)
+#if IS_ENABLED(CONFIG_NET)
        "bdinfo -e\n"
        "  - print Board Info related to network\n"
 #endif
index 3c3af0e364758e94b065becc8cc178812aefb150..8e8c733aa2952f7e1363463013e09679131f46e5 100644 (file)
@@ -425,7 +425,7 @@ config LOGF_FUNC_PAD
 
 config LOG_SYSLOG
        bool "Log output to syslog server"
-       depends on NET_LEGACY || NET_LWIP
+       depends on NET
        help
          Enables a log driver which broadcasts log records via UDP port 514
          to syslog servers.
index 37e6f51c7a7a5b86159ed6617d39043a2e5a3f5d..4594291082944d596973ea1078bbf6c960376092 100644 (file)
@@ -495,7 +495,7 @@ static int initr_boot_led_on(void)
        return 0;
 }
 
-#if CONFIG_IS_ENABLED(NET_LEGACY) || CONFIG_IS_ENABLED(NET_LWIP)
+#if CONFIG_IS_ENABLED(NET)
 static int initr_net(void)
 {
        puts("Net:   ");
@@ -756,7 +756,7 @@ static void initcall_run_r(void)
 #if CONFIG_IS_ENABLED(PCI_ENDPOINT)
        INITCALL(pci_ep_init);
 #endif
-#if CONFIG_IS_ENABLED(NET_LEGACY) || CONFIG_IS_ENABLED(NET_LWIP)
+#if CONFIG_IS_ENABLED(NET)
        WATCHDOG_RESET();
        INITCALL(initr_net);
 #endif
index 09db9101bd166373fe048e4e93b9cf5598a7cf75..6226d14bd664f85e0e19f8d0167e64ef8e8adecf 100644 (file)
@@ -124,12 +124,12 @@ Build
 current eth
     name of the active network device
 
-    Only shown if CONFIG_NET_LEGACY=y or CONFIG_NET_LWIP=y.
+    Only shown if CONFIG_NET=y.
 
 IP addr
     network address, value of the environment variable *ipaddr*
 
-    Only shown if CONFIG_NET_LEGACY=y or CONFIG_NET_LWIP=y.
+    Only shown if CONFIG_NET=y.
 
 fdt_blob
     address of U-Boot's own device tree, NULL if none
@@ -173,5 +173,4 @@ The bdinfo command is available if CONFIG_CMD_BDI=y.
 
 The options to bdinfo are only available if CONFIG_GETOPT=y.
 
-The ``-e`` option is additionally only available if CONFIG_NET_LEGACY=y or
-CONFIG_NET_LWIP=y.
+The ``-e`` option is additionally only available if CONFIG_NET=y.
index f0288387aedf11dc56e774ebe5c743cc68506f7a..666618681df6a5d0d4a18b6cb396e2470474e35e 100644 (file)
@@ -339,7 +339,7 @@ config ESSEDMA
 
 config ETH_SANDBOX
        depends on SANDBOX
-       depends on NET_LEGACY || NET_LWIP
+       depends on NET
        default y
        bool "Sandbox: Mocked Ethernet driver"
        help
index 93f32aea59504b0a3c1b7b01156f417201e86eca..0025c895f125c06a5a141f53027120bfa729ee08 100644 (file)
@@ -7,7 +7,7 @@ config MV88E6352_SWITCH
 
 menuconfig PHYLIB
        bool "Ethernet PHY (physical media interface) support"
-       depends on NET_LEGACY || NET_LWIP
+       depends on NET
        help
          Enable Ethernet PHY (physical media interface) support.
 
index d4ffc24c0636e01151e00103d8ce0564e6a1514b..185829622492b25c244c6183b63315b5fe530a8c 100644 (file)
@@ -232,7 +232,7 @@ endif # USB_GADGET_DOWNLOAD
 
 config USB_ETHER
        bool "USB Ethernet Gadget"
-       depends on NET_LEGACY || NET_LWIP
+       depends on NET
        default y if ARCH_SUNXI && USB_MUSB_GADGET
        help
          Creates an Ethernet network device through a USB peripheral
index 45eb9820d9f5a6137739b6093396d6ee2631e714..f1966bc91b48ff1f5cbf7409b9b8ea88bc7f0fbc 100644 (file)
@@ -22,7 +22,7 @@
 #include <env_internal.h>
 #endif
 
-#if CONFIG_IS_ENABLED(NET_LEGACY) || CONFIG_IS_ENABLED(NET_LWIP)
+#if CONFIG_IS_ENABLED(NET)
 #define ENV_FLAGS_NET_VARTYPE_REPS "im"
 #else
 #define ENV_FLAGS_NET_VARTYPE_REPS ""
@@ -57,7 +57,7 @@ static const char * const env_flags_vartype_names[] = {
        "decimal",
        "hexadecimal",
        "boolean",
-#if CONFIG_IS_ENABLED(NET_LEGACY) || CONFIG_IS_ENABLED(NET_LWIP)
+#if CONFIG_IS_ENABLED(NET)
        "IP address",
        "MAC address",
 #endif
@@ -211,7 +211,7 @@ static void skip_num(int hex, const char *value, const char **end,
                *end = value;
 }
 
-#if CONFIG_IS_ENABLED(NET_LEGACY) || CONFIG_IS_ENABLED(NET_LWIP)
+#if CONFIG_IS_ENABLED(NET)
 int eth_validate_ethaddr_str(const char *addr)
 {
        const char *end;
@@ -244,7 +244,7 @@ static int _env_flags_validate_type(const char *value,
        enum env_flags_vartype type)
 {
        const char *end;
-#if CONFIG_IS_ENABLED(NET_LEGACY) || CONFIG_IS_ENABLED(NET_LWIP)
+#if CONFIG_IS_ENABLED(NET)
        const char *cur;
        int i;
 #endif
@@ -273,7 +273,7 @@ static int _env_flags_validate_type(const char *value,
                if (value[1] != '\0')
                        return -1;
                break;
-#if CONFIG_IS_ENABLED(NET_LEGACY) || CONFIG_IS_ENABLED(NET_LWIP)
+#if CONFIG_IS_ENABLED(NET)
        case env_flags_vartype_ipaddr:
                cur = value;
                for (i = 0; i < 4; i++) {
index f7bb23df56992bf89757e775e08201debb73560f..1181ab4a15793d5591b0475a07760602b0ab5065 100644 (file)
@@ -32,7 +32,7 @@
 #define DNS_CALLBACK
 #endif
 
-#if CONFIG_IS_ENABLED(NET_LEGACY) || CONFIG_IS_ENABLED(NET_LWIP)
+#if CONFIG_IS_ENABLED(NET)
 #define NET_CALLBACKS \
        "bootfile:bootfile," \
        "ipaddr:ipaddr," \
index 85721a89cfbdd4abd3d0ecbde6e9fdcf7f700730..123fdbcb0ba71aed56208ef2660e95aaaad1be8f 100644 (file)
@@ -14,7 +14,7 @@ enum env_flags_vartype {
        env_flags_vartype_decimal,
        env_flags_vartype_hex,
        env_flags_vartype_bool,
-#if CONFIG_IS_ENABLED(NET_LEGACY) || CONFIG_IS_ENABLED(NET_LWIP)
+#if CONFIG_IS_ENABLED(NET)
        env_flags_vartype_ipaddr,
        env_flags_vartype_macaddr,
 #endif
@@ -41,7 +41,7 @@ enum env_flags_varaccess {
 #define CFG_ENV_FLAGS_LIST_STATIC ""
 #endif
 
-#if CONFIG_IS_ENABLED(NET_LEGACY) || CONFIG_IS_ENABLED(NET_LWIP)
+#if CONFIG_IS_ENABLED(NET)
 #ifdef CONFIG_REGEX
 #define ETHADDR_WILDCARD "\\d*"
 #else
@@ -123,7 +123,7 @@ enum env_flags_varaccess env_flags_parse_varaccess(const char *flags);
  */
 enum env_flags_varaccess env_flags_parse_varaccess_from_binflags(int binflags);
 
-#if CONFIG_IS_ENABLED(NET_LEGACY) || CONFIG_IS_ENABLED(NET_LWIP)
+#if CONFIG_IS_ENABLED(NET)
 /*
  * Check if a string has the format of an Ethernet MAC address
  */
index 0cbdf344664d1bd0689f1a43038a2b6288296640..69b6316c1ec693a1fffaa8bd4854555f00f52b96 100644 (file)
@@ -235,7 +235,7 @@ int eth_rx(void);                   /* Check for received packets */
  */
 void reset_phy(void);
 
-#if CONFIG_IS_ENABLED(NET_LEGACY) || CONFIG_IS_ENABLED(NET_LWIP)
+#if CONFIG_IS_ENABLED(NET)
 /**
  * eth_set_enable_bootdevs() - Enable or disable binding of Ethernet bootdevs
  *
index 495a85fa86930af7ad26ad256ccd7976ea0e5920..3279fc88354495284969723bb3d417d9e88ff5d7 100644 (file)
@@ -517,7 +517,7 @@ config EFI_RISCV_BOOT_PROTOCOL
 config EFI_IP4_CONFIG2_PROTOCOL
        bool "EFI_IP4_CONFIG2_PROTOCOL support"
        default y if ARCH_QEMU || SANDBOX
-       depends on NET_LEGACY || NET_LWIP
+       depends on NET
        help
          Provides an implementation of the EFI_IP4_CONFIG2_PROTOCOL, this
          protocol can be used to set and get the current ip address and
@@ -599,7 +599,7 @@ config EFI_BOOTMGR
 
 config EFI_HTTP_BOOT
        bool "EFI HTTP Boot support"
-       depends on NET_LEGACY || NET_LWIP
+       depends on NET
        select CMD_NET
        select CMD_DHCP
        select CMD_DNS
index a9323ceb40b98ef1410d09d22c433bdf68170fb8..ceac6de6377a43c017bcef665d78bc1cf3da5ae3 100644 (file)
@@ -37,7 +37,7 @@ CFLAGS_eth_common.o += -Wno-format-extra-args
 
 endif
 
-ifeq ($(filter y,$(CONFIG_NET_LEGACY) $(CONFIG_NET_LWIP)),y)
+ifeq ($(CONFIG_NET),y)
 obj-$(CONFIG_DM_DSA)   += dsa-uclass.o
 obj-$(CONFIG_$(PHASE_)DM_ETH) += eth-uclass.o
 obj-$(CONFIG_$(PHASE_)BOOTDEV_ETH) += eth_bootdev.o
index 3233a0a6a5110ec70274bd9d62dda8368315b0bd..7f4f1868c6a2eb15ce0a0fe9630b98e1cafa0355 100644 (file)
@@ -172,7 +172,7 @@ static int bdinfo_test_all(struct unit_test_state *uts)
        ut_assertok(test_num_l(uts, "reloc off", gd->reloc_off));
        ut_assert_nextline("%-12s= %u-bit", "Build", (uint)sizeof(void *) * 8);
 
-       if (IS_ENABLED(CONFIG_NET_LEGACY) || IS_ENABLED(CONFIG_NET_LWIP))
+       if (IS_ENABLED(CONFIG_NET))
                ut_assertok(test_eth(uts));
 
        /*
@@ -314,7 +314,7 @@ static int bdinfo_test_help(struct unit_test_state *uts)
                        ut_assert_nextlinen("bdinfo -a");
                ut_assert_nextlinen("  - print all Board Info structure");
                if (CONFIG_IS_ENABLED(GETOPT)) {
-                       if (IS_ENABLED(CONFIG_NET_LEGACY) || IS_ENABLED(CONFIG_NET_LWIP)) {
+                       if (IS_ENABLED(CONFIG_NET)) {
                                ut_assert_nextlinen("bdinfo -e");
                                ut_assert_nextlinen("  - print Board Info related to network");
                        }
@@ -348,7 +348,7 @@ static int bdinfo_test_eth(struct unit_test_state *uts)
        ut_assertok(run_commandf("bdinfo -e"));
        if (!CONFIG_IS_ENABLED(GETOPT))
                ut_assertok(bdinfo_test_all(uts));
-       else if (IS_ENABLED(CONFIG_NET_LEGACY) || IS_ENABLED(CONFIG_NET_LWIP))
+       else if (IS_ENABLED(CONFIG_NET))
                ut_assertok(test_eth(uts));
        ut_assert_console_end();
 
index fc45209a581d073f58ab4e48d4e5d0009440b5be..91f151d09cda9895539a86a911fa66846115fe0e 100644 (file)
@@ -98,7 +98,7 @@ def test_efi_setup_dhcp(ubman):
     global net_set_up
     net_set_up = True
 
-@pytest.mark.buildconfigspec('net_legacy', 'net_lwip')
+@pytest.mark.buildconfigspec('net')
 def test_efi_setup_static(ubman):
     """Set up the network using a static IP configuration.
 
index 0ab47c0bde5306a6dfb554dbca109b2a7496852b..74cd42b910e95888b47da3c9488a743e4aeb7cb3 100644 (file)
@@ -506,7 +506,7 @@ def test_fpga_loadfs(ubman):
 @pytest.mark.buildconfigspec('cmd_fpga_load_secure')
 @pytest.mark.buildconfigspec('cmd_net')
 @pytest.mark.buildconfigspec('cmd_dhcp')
-@pytest.mark.buildconfigspec('net_legacy', 'net_lwip')
+@pytest.mark.buildconfigspec('net')
 def test_fpga_secure_bit_auth(ubman):
 
     test_net.test_net_dhcp(ubman)
@@ -534,7 +534,7 @@ def test_fpga_secure_bit_auth(ubman):
 @pytest.mark.buildconfigspec('cmd_fpga_load_secure')
 @pytest.mark.buildconfigspec('cmd_net')
 @pytest.mark.buildconfigspec('cmd_dhcp')
-@pytest.mark.buildconfigspec('net_legacy', 'net_lwip')
+@pytest.mark.buildconfigspec('net')
 def test_fpga_secure_bit_img_auth_kup(ubman):
 
     test_net.test_net_dhcp(ubman)
index 4f8995300607b2cb9d6b561c8229f12ed5a8fbfb..27cdd73fd49c740be458e2b70f4f2c754c52947d 100644 (file)
@@ -201,7 +201,7 @@ def test_net_dhcp6(ubman):
     global net6_set_up
     net6_set_up = True
 
-@pytest.mark.buildconfigspec('net_legacy', 'net_lwip')
+@pytest.mark.buildconfigspec('net')
 def test_net_setup_static(ubman):
     """Set up a static IP configuration.