@@ -745,7 +745,47 @@ source "dts/Kconfig"
source "env/Kconfig"
+choice
+ prompt "Networking stack"
+ default NET
+
+config NO_NET
+ bool "No networking support"
+
+config NET
+ bool "Legacy U-Boot networking stack"
+ imply NETDEVICES
+
+config NET_LWIP
+ bool "Use lwIP for networking stack"
+ imply NETDEVICES
+ 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.
+
+endchoice
+
+if NET
source "net/Kconfig"
+endif
+
+if NET_LWIP
+source "net-lwip/Kconfig"
+endif
+
+config SYS_RX_ETH_BUFFER
+ int "Number of receive packet buffers"
+ default 4
+ help
+ Defines the number of Ethernet receive buffers. On some Ethernet
+ 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.
source "drivers/Kconfig"
@@ -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/
@@ -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.
@@ -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
@@ -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
@@ -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
@@ -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.
@@ -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
new file mode 100644
@@ -0,0 +1,37 @@
+#
+# Network configuration (with lwIP stack)
+#
+
+config LWIP_DEBUG
+ bool "Enable debug traces in the lwIP library"
+
+config LWIP_ASSERT
+ bool "Enable assertions in the lwIP library"
+
+config PROT_DHCP_LWIP
+ bool "DHCP support in lwIP"
+ depends on PROT_UDP_LWIP
+ help
+ Enable support for the DHCP protocol in lwIP.
+
+config PROT_DNS_LWIP
+ bool
+ depends on PROT_UDP_LWIP
+
+config PROT_RAW_LWIP
+ bool
+
+config PROT_TCP_LWIP
+ bool
+
+config PROT_UDP_LWIP
+ bool
+
+config BOOTDEV_ETH
+ bool "Enable bootdev for ethernet"
+ depends on BOOTSTD
+ default y
+ help
+ Provide a bootdev for ethernet so that is it possible to boot
+ an operating system over the network, using the PXE (Preboot
+ Execution Environment) protocol.
@@ -2,11 +2,6 @@
# Network configuration
#
-menuconfig NET
- bool "Networking support"
- default y
- imply NETDEVICES
-
if NET
config ARP_TIMEOUT
@@ -254,12 +249,3 @@ config IPV6
address and find it, it will force using IPv6 in the network stack.
endif # if NET
-
-config SYS_RX_ETH_BUFFER
- int "Number of receive packet buffers"
- default 4
- help
- Defines the number of Ethernet receive buffers. On some Ethernet
- 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.
Prepare the introduction of the lwIP (lightweight IP) TCP/IP stack by adding a new net-lwip/ directory and the NET_LWIP symbol. Network support is either NO_NET, NET (legacy stack) or NET_LWIP. Subsequent commits will introduce the lwIP code, re-work the NETDEVICE integration and port some of the NET commands and features to lwIP. SPL_NET cannot be enabled when 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. Similarly, DFU_TFTP is not compatible with NET_LWIP because it depends on net_loop(), tftp_timeout_ms, tftp_timeout_count_max. Let's add a dependency of DFU_OVER_TFTP on !NET_LWIP for now. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> --- Kconfig | 40 ++++++++++++++++++++++++++++++++++++++ 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 | 37 +++++++++++++++++++++++++++++++++++ net/Kconfig | 14 ------------- 10 files changed, 85 insertions(+), 21 deletions(-) create mode 100644 net-lwip/Kconfig