From patchwork Wed May 22 16:00:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 798169 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:92:b0:351:d90a:5487 with SMTP id m18csp549138wrx; Wed, 22 May 2024 09:16:44 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWKgqkWRu4Q7Hb9Wd8rrl6WnqonnOArao6jKLzkNF/7L9LctgBrC37nq5BnJqgqxjKNqmkpnaUTbuH9L+jAH7Ta X-Google-Smtp-Source: AGHT+IF2DfKWQdgWLEnwlYU0zH5x0ixYVvzNIG9HKin6JrcuCyRvNaAJvSLPa7SJC34unYJsUMOK X-Received: by 2002:a50:9e48:0:b0:575:c11:f3c8 with SMTP id 4fb4d7f45d1cf-57832a2f453mr1349669a12.16.1716394604145; Wed, 22 May 2024 09:16:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716394604; cv=none; d=google.com; s=arc-20160816; b=vRCn2a1neomdCmF9nHCvsMcPpjNDUjz2Fq6S95X8oKAbaWOPbYc0M0ObH9kZ4m3Saw jLt2T76lsl9iJKE6NAGMyFDXSyumyRnnezCEx5qhNp21868GxDF/U4H7HvQNQ/1gcUOB /KYS4WZJmaN653Zhqp4CjCVIFd+dGMjMo8nShkHh0ngrqmV2TxkDwWFS12VjVNZArzRG a7XzFLJvM3GPQKhQIoL6ZVV6L6RtGKK33WjVFEO5+A2iCrLX7Dt0R4foT7fOP2R/9gf+ E9RaHKS8jdCPNf6RZE7312gJvtbO/LcHjXX1vpwLScMaeoER8I2ef/ubqTwgw5AgZ4qo eBMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aOi9r/kdgGdi/iapCvYoYClaEPhpDIWstqzLzlxG6Mk=; fh=UgcnDvQyYP+9aa8+iFPHaCK0l94auLygp/VJmDph+xg=; b=AbhNWx4XQW0JxF63vLVc0OSDp7HY8EpcM6VOuVCI+pIGu+gqOYna3f4nYPgDoarkGE OOiA5EzQnWwNSflta20yuWcwLePGiyubOk7ZxsfCuRjAGnBYBkYAPJT/i/lkaIuclqNu v+u4p5L7u4G5tD1QT+x6vpq7pKcio9ZYS/OwQTgr1z6JFhC0/F4V8wGxrGds3tIIsbGY v1z90M7uR8UjbhFsWAKBihYDqgrg17dV1Add+Cpdj65Zj8MWA1X8H9VohmlFxqRJ03Fx nBPRSerTQQliSJDmF+lx9Sc3oKndDFjOcq1Wfd1ulGEGeaQmIUNazex5BAuVljBSjrFR NoDg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BQ2lnpA4; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733c2d5319si15559934a12.216.2024.05.22.09.16.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 09:16:44 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BQ2lnpA4; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DE7958887A; Wed, 22 May 2024 18:16:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="BQ2lnpA4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A9E0E8884F; Wed, 22 May 2024 18:01:16 +0200 (CEST) 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=unavailable autolearn_force=no version=3.4.2 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) (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 03DB48886B for ; Wed, 22 May 2024 18:01:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jerome.forissier@linaro.org Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-572b37afd73so11718375a12.2 for ; Wed, 22 May 2024 09:01:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716393671; x=1716998471; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aOi9r/kdgGdi/iapCvYoYClaEPhpDIWstqzLzlxG6Mk=; b=BQ2lnpA4c/Krsh9A16L7fcmCKezLGCCNUBFLr+Jj3m4UMw9rVj0iEv9JFhAZXAL347 ScuH3kpwfHPx7ipSjxkKSr83hPsgworuR5QefbtLKcM0VCGZTXgLAfraDQJTM8hbauFZ kHpp1XfFAz/7NCwNVP42LA64HSmYx/3feftuj+YPoO4r6WkhR0yVmJ7UV0ntZnFv7oHP cf8DnsWJ5/aIvdS7w5KtLnPJz+HaqaGB7iPhNN79w3eOk0mLaCrSQP5R5Yj4JlXmChn2 CM1RrVT6zUwpdUKHp5/EaTYvHssqAIcjddlJM8xEvPji+J5PIqFGkdgY9inQiR2GMrB3 YP1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716393671; x=1716998471; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aOi9r/kdgGdi/iapCvYoYClaEPhpDIWstqzLzlxG6Mk=; b=Yx0QL1G0AmmGUy2Fvbf+4lHVr/h1S8quKwZ067d5aFRcZprBZHdC6GeaWUpp7nTR17 EM4l0u7n3Pjn86A2E9U+DWnZlk3o0aRLOHD0B+QWYuN9soqZx5dBfqX+Jpro97QE+voT UtnasfEMqoPNp1xBsArhowPGf/cyMZcvFZvr41A+85iPMRWDcDnndR9VpPTyKbSjpVQO mcfm+2+EUuow6ALMc0/pxGJlZgdL+gDFDKB6vOf1aJed0hYaf2MYNNmyZXMZVQs3M0qm mYBoU3v3puQ7TNjCtVIwYg0oswGo17xGdFmLQM7sVaq829vur5Gyz4NfqK67df0M7VQA 2/SQ== X-Gm-Message-State: AOJu0YxT4PPLA+7r3Kd8VjehbniPkky4dfSOeuECLjdtNcIr6QWcZ6oT fB/O5qc9KtfpRyrr+XJW1g2WLYTstrpczqgRp3DrYqu5rcX1l5Al1ARg8g7aUiGB9zDOnfUkoKr OUzA197IJ X-Received: by 2002:a17:906:d11a:b0:a59:a8a4:a59f with SMTP id a640c23a62f3a-a6228097062mr158617566b.45.1716393671082; Wed, 22 May 2024 09:01:11 -0700 (PDT) Received: from jerome-XPS-13-9310.. ([2a01:e0a:3cb:7bb0:d6a3:fbd6:c45b:172c]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6209f64ba8sm367670266b.210.2024.05.22.09.01.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 09:01:10 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Maxim Uvarov , Jerome Forissier , Tom Rini , Lukasz Majewski , Mattijs Korpershoek , Joe Hershberger , Ramon Fried , Marek Vasut , Simon Glass , Nathan Barrett-Morrison , Marcel Ziswiler , Svyatoslav Ryhel , Bo Gan , John Keeping , Greg Malysa , Heinrich Schuchardt , Jesse Taube , Shengyu Qu , Andrew Davis , Sumit Garg , Bryan Brattlof , "Leon M. Busch-George" , Jagan Teki , Samuel Dionne-Riel , Nikhil M Jain , Joshua Watt , Rasmus Villemoes , Sean Anderson , Andre Przywara , Oleksandr Suvorov , Leo Yu-Chi Liang , Mayuresh Chitale , Samuel Holland , Patrice Chotard , Ashok Reddy Soma , Jaehoon Chung , Patrick Delaunay , Ion Agorria , Alexey Romanov , Nicolas Frattaroli , Yanhong Wang , Miquel Raynal , Jonas Karlman , Baruch Siach Subject: [PATCH 01/15] net: introduce alternative implementation as net-lwip/ Date: Wed, 22 May 2024 18:00:01 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 22 May 2024 18:16:41 +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 Prepare the introduction of the lwIP (lightweight IP) TCP/IP stack by adding a new net-lwip/ directory and the CONFIG_NET_LWIP symbol. At this point, enabling CONFIG_NET_LWIP simply disables CONFIG_NET. Subsequent commits will introduce the lwIP code, re-work the NETDEVICE integration and port some of the NET commands and features to lwIP. CONFIG_SPL_NET cannot be enabled when CONFIG_NET_LWIP=y. SPL_NET pulls some symbols that are part of NET (such as arp_init(), arp_timeout_check(), arp_receive(), net_arp_wait_packet_ip()). lwIP support in SPL may be added later. Signed-off-by: Jerome Forissier --- Kconfig | 2 ++ Makefile | 2 +- common/Kconfig | 2 +- common/spl/Kconfig | 1 + drivers/dfu/Kconfig | 2 +- drivers/fastboot/Kconfig | 4 ++-- drivers/net/phy/Kconfig | 2 +- drivers/usb/gadget/Kconfig | 2 +- net-lwip/Kconfig | 15 +++++++++++++++ net/Kconfig | 1 + 10 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 net-lwip/Kconfig diff --git a/Kconfig b/Kconfig index 82df59f176..758256ab12 100644 --- a/Kconfig +++ b/Kconfig @@ -747,6 +747,8 @@ source "env/Kconfig" source "net/Kconfig" +source "net-lwip/Kconfig" + source "drivers/Kconfig" source "fs/Kconfig" diff --git a/Makefile b/Makefile index 44deb339af..6296ad6f78 100644 --- a/Makefile +++ b/Makefile @@ -859,7 +859,7 @@ libs-$(CONFIG_OF_EMBED) += dts/ libs-y += env/ libs-y += lib/ libs-y += fs/ -libs-y += net/ +libs-$(CONFIG_NET) += net/ libs-y += disk/ libs-y += drivers/ libs-$(CONFIG_SYS_FSL_DDR) += drivers/ddr/fsl/ diff --git a/common/Kconfig b/common/Kconfig index 5e3070e925..807b726384 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -424,7 +424,7 @@ config LOGF_FUNC_PAD config LOG_SYSLOG bool "Log output to syslog server" - depends on NET + depends on NET || NET_LWIP help Enables a log driver which broadcasts log records via UDP port 514 to syslog servers. diff --git a/common/spl/Kconfig b/common/spl/Kconfig index 6405374bcc..f67f0a859d 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -1055,6 +1055,7 @@ config SPL_DM_SPI_FLASH config SPL_NET bool "Support networking" + depends on !NET_LWIP help Enable support for network devices (such as Ethernet) in SPL. This permits SPL to load U-Boot over a network link rather than diff --git a/drivers/dfu/Kconfig b/drivers/dfu/Kconfig index 0360d9da14..d331b05993 100644 --- a/drivers/dfu/Kconfig +++ b/drivers/dfu/Kconfig @@ -11,7 +11,7 @@ config DFU_OVER_USB config DFU_OVER_TFTP bool - depends on NET + depends on NET || NET_LWIP if DFU config DFU_WRITE_ALT diff --git a/drivers/fastboot/Kconfig b/drivers/fastboot/Kconfig index 70207573de..05e988166f 100644 --- a/drivers/fastboot/Kconfig +++ b/drivers/fastboot/Kconfig @@ -27,7 +27,7 @@ config USB_FUNCTION_FASTBOOT This enables the USB part of the fastboot gadget. config UDP_FUNCTION_FASTBOOT - depends on NET + depends on NET || NET_LWIP select FASTBOOT bool "Enable fastboot protocol over UDP" help @@ -41,7 +41,7 @@ config UDP_FUNCTION_FASTBOOT_PORT The fastboot protocol requires a UDP port number. config TCP_FUNCTION_FASTBOOT - depends on NET + depends on NET || NET_LWIP select FASTBOOT bool "Enable fastboot protocol over TCP" help diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig index 3d96938eab..738752d29c 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig @@ -11,7 +11,7 @@ config MV88E6352_SWITCH menuconfig PHYLIB bool "Ethernet PHY (physical media interface) support" - depends on NET + depends on NET || NET_LWIP help Enable Ethernet PHY (physical media interface) support. diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 4621a6fd5e..03fe3bca19 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig @@ -224,7 +224,7 @@ endif # USB_GADGET_DOWNLOAD config USB_ETHER bool "USB Ethernet Gadget" - depends on NET + depends on NET || NET_LWIP default y if ARCH_SUNXI && USB_MUSB_GADGET help Creates an Ethernet network device through a USB peripheral diff --git a/net-lwip/Kconfig b/net-lwip/Kconfig new file mode 100644 index 0000000000..f8e0481964 --- /dev/null +++ b/net-lwip/Kconfig @@ -0,0 +1,15 @@ +# +# Network configuration (with lwIP stack) +# + +menuconfig NET_LWIP + bool "Networking support (lwIP stack) -- EXPERIMENTAL" + help + Include networking support based on the lwIP (lightweight IP) + TCP/IP stack (https://nongnu.org/lwip). This is a replacement for + the default U-Boot network stack and applications located in net/ + and enabled via CONFIG_NET as well as other pieces of code that + depend on CONFIG_NET (such as cmd/net.c enabled via CONFIG_CMD_NET). + Therefore the two symbols CONFIG_NET and CONFIG_NET_LWIP are mutually + exclusive. + NOTE: This is currently a placeholder. diff --git a/net/Kconfig b/net/Kconfig index 5dff633629..04b81dd497 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -6,6 +6,7 @@ menuconfig NET bool "Networking support" default y imply NETDEVICES + depends on !NET_LWIP if NET