net-lwip: add TFTP support and tftpboot command
Subsystems (6)
PATCH 4/15 net-lwip: add TFTP support and tftpboot command
In reply to a message not in the archiveImplement do_tftpb().
--- cmd/Kconfig | 3 +- cmd/net-lwip.c | 8 ++ net-lwip/dhcp.c | 11 ++- net-lwip/tftp.c | 206 +++++++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 223 insertions(+), 5 deletions(-)
cmd/Kconfig +1 -2
@@ -2101,10 +2101,9 @@ config CMD_DHCP_LWIP config CMD_TFTPBOOT_LWIP bool "tftp" select PROT_UDP_LWIP - default n + default y help tftpboot - load file via network using TFTP protocol - Currently a placeholder (not implemented) endif
cmd/net-lwip.c +8 -0
@@ -11,3 +11,11 @@ U_BOOT_CMD("[loadAddress] [[hostIPaddr:]bootfilename]" );#endif + +#if defined(CONFIG_CMD_TFTPBOOT_LWIP ) +U_BOOT_CMD ( + tftpboot,3 ,0 , do_tftpb, +"boot image via network using TFTP protocol\n" , +"[loadAddress] [[hostIPaddr:]bootfilename]" +); +#endif
net-lwip/dhcp.c +10 -1
@@ -94,11 +94,20 @@ int do_dhcp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])int dhcp_run (ulong addr,const char *fname,bool autoload) {char *dhcp_argv[] = {"dhcp" ,NULL , }; +#ifdef CONFIG_CMD_TFTPBOOT_LWIP +char *tftp_argv[] = {"tftpboot" , boot_file_name,NULL , }; +#endif struct cmd_tbl cmdtp = {};/* dummy */ if (autoload) { -/* Will be supported when TFTP is added */ +#ifdef CONFIG_CMD_TFTPBOOT_LWIP +/* Assume DHCP was already performed */ +if (boot_file_name[0 ]) +return do_tftpb (&cmdtp,0 ,2 , tftp_argv); +return 0 ; +#else return -EOPNOTSUPP ; +#endif }return do_dhcp (&cmdtp,0 ,1 , dhcp_argv);
net-lwip/tftp.c +204 -2
214 lines not on this page · raw message
Signature · 1 line
2.40.1
PATCH 5/15 net-lwip: add ping command
In reply to a message not in the archiveAdd CONFIG_CMD_PING_LWIP depending on CONFIG_NET_LWIP to provide the ping command using lwIP.
The implementation is derived from lwIP's contrib/apps/ping/ping.c.
--- boot/Kconfig | 1 + cmd/Kconfig | 6 ++ cmd/net-lwip.c | 8 +++ include/net-lwip.h | 3 + net-lwip/Makefile | 1 + net-lwip/ping.c | 171 +++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 190 insertions(+) create mode 100644 net-lwip/ping.c
boot/Kconfig +1 -0
@@ -382,6 +382,7 @@ config BOOT_DEFAULTS_CMDS select CMD_PING if CMD_NET select CMD_PXE if CMD_NET select CMD_DHCP_LWIP if CMD_NET_LWIP + select CMD_PING_LWIP if CMD_NET_LWIP select CMD_BOOTI if ARM64 select CMD_BOOTZ if ARM && !ARM64 imply CMD_MII if NET
cmd/Kconfig +6 -0
@@ -2098,6 +2098,12 @@ config CMD_DHCP_LWIP help Boot image via network using DHCP/TFTP protocol +config CMD_PING_LWIP + bool "ping" + select PROT_RAW_LWIP + help + Send ICMP ECHO_REQUEST to network host + config CMD_TFTPBOOT_LWIP bool "tftp" select PROT_UDP_LWIP
cmd/net-lwip.c +8 -0
@@ -12,6 +12,14 @@ U_BOOT_CMD( );#endif +#if defined(CONFIG_CMD_PING_LWIP ) +U_BOOT_CMD ( + ping,2 ,1 , do_ping, +"send ICMP ECHO_REQUEST to network host" , +"pingAddress" +); +#endif +#if defined(CONFIG_CMD_TFTPBOOT_LWIP ) U_BOOT_CMD( tftpboot, 3, 0, do_tftpb,
include/net-lwip.h +3 -0
@@ -5,6 +5,7 @@#include <asm/cache.h> #include <linux/types.h> +#include <lwip/ip_addr.h> #include <lwip/netif.h> #include <time.h>
@@ -50,6 +51,7 @@ int eth_env_get_enetaddr_by_index(const char *base_name, int index,int eth_init (void );/* Initialize the device */ int eth_send (void *packet,int length);/* Send a packet */ int eth_rx (void ); +const char *eth_get_name (void );int eth_get_dev_index (void );int eth_init_state_only (void );/* Set active state */ void eth_set_current (void );/* set nterface to ethcur var */
@@ -80,6 +82,7 @@ int net_lwip_init(void);struct netif *net_lwip_get_netif (void );int do_dhcp (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]); +int do_ping (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]);int do_tftpb (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]);#endif /* __NET_LWIP_H__ */
net-lwip/Makefile +1 -0
@@ -7,6 +7,7 @@ obj-$(CONFIG_$(SPL_)DM_ETH) += ../net/eth_common.o obj-$(CONFIG_$(SPL_)DM_ETH) += ../net/eth-uclass.o obj-$(CONFIG_$(SPL_)DM_ETH) += net-lwip.o obj-$(CONFIG_CMD_DHCP_LWIP) += dhcp.o +obj-$(CONFIG_CMD_PING_LWIP) += ping.o obj-$(CONFIG_CMD_TFTPBOOT_LWIP) += tftp.o # Disable this warning as it is triggered by:
net-lwip/ping.c new file +171 -0
171 lines not on this page · raw message
Signature · 1 line
2.40.1
PATCH 6/15 net-lwip: add dns command
In reply to a message not in the archiveAdd CONFIG_CMD_DNS_LWIP depending on CONFIG_NET_LWIP to provide the dns command using lwIP.
--- cmd/Kconfig | 6 +++ cmd/net-lwip.c | 8 ++++ include/net-lwip.h | 1 + net-lwip/Makefile | 1 + net-lwip/dns.c | 107 +++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 123 insertions(+) create mode 100644 net-lwip/dns.c
cmd/Kconfig +6 -0
@@ -2098,6 +2098,12 @@ config CMD_DHCP_LWIP help Boot image via network using DHCP/TFTP protocol +config CMD_DNS_LWIP + bool "dns" + select PROT_DNS_LWIP + help + Lookup the IP of a hostname + config CMD_PING_LWIP bool "ping" select PROT_RAW_LWIP
cmd/net-lwip.c +8 -0
@@ -27,3 +27,11 @@ U_BOOT_CMD("[loadAddress] [[hostIPaddr:]bootfilename]" );#endif + +#if defined(CONFIG_CMD_DNS_LWIP ) +U_BOOT_CMD ( + dns,3 ,1 , do_dns, +"lookup the IP of a hostname" , +"hostname [envvar]" +); +#endif
include/net-lwip.h +1 -0
@@ -82,6 +82,7 @@ int net_lwip_init(void);struct netif *net_lwip_get_netif (void );int do_dhcp (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]); +int do_dns (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]);int do_ping (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]);int do_tftpb (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]);
net-lwip/Makefile +1 -0
@@ -7,6 +7,7 @@ obj-$(CONFIG_$(SPL_)DM_ETH) += ../net/eth_common.o obj-$(CONFIG_$(SPL_)DM_ETH) += ../net/eth-uclass.o obj-$(CONFIG_$(SPL_)DM_ETH) += net-lwip.o obj-$(CONFIG_CMD_DHCP_LWIP) += dhcp.o +obj-$(CONFIG_CMD_DNS_LWIP) += dns.o obj-$(CONFIG_CMD_PING_LWIP) += ping.o obj-$(CONFIG_CMD_TFTPBOOT_LWIP) += tftp.o
net-lwip/dns.c new file +107 -0
107 lines not on this page · raw message
Signature · 1 line
2.40.1
PATCH 7/15 net-lwip: add wget command
In reply to a message not in the archiveAdd CONFIG_CMD_WGET_LWIP depending on CONFIG_NET_LWIP to provide the wget command using the lightweight IP stack.
About the small change in cmd/efidebug.c: when the wget command based on the lwIP stack is used (CONFIG_CMD_WGET_LWIP=y) the wget command has a built-in URL validation function since it needs to parse it anyways (in parse_url()). Therefore wget_validate_uri() doesn't exist. So, guard the call in efidebug.c with CONFIG_CMD_WGET.
Based on code initially developed by Maxim U.
--- cmd/Kconfig | 7 ++ cmd/efidebug.c | 8 ++- cmd/net-lwip.c | 8 +++ include/net-lwip.h | 1 + net-lwip/Makefile | 1 + net-lwip/wget.c | 168 +++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 190 insertions(+), 3 deletions(-) create mode 100644 net-lwip/wget.c
cmd/Kconfig +7 -0
@@ -2117,6 +2117,13 @@ config CMD_TFTPBOOT_LWIP help tftpboot - load file via network using TFTP protocol +config CMD_WGET_LWIP + bool "wget" + select PROT_TCP_LWIP + help + wget is a simple command to download kernel, or other files, + from a http server over TCP. + endif endif
cmd/efidebug.c +5 -3
@@ -741,9 +741,11 @@ static int efi_boot_add_uri(int argc, char *const argv[], u16 *var_name16,if (!label)return CMD_RET_FAILURE ; -if (!wget_validate_uri (argv[3 ])) { -printf ("ERROR: invalid URI\n" ); -return CMD_RET_FAILURE ; +if (IS_ENABLED (CONFIG_CMD_WGET )) { +if (!wget_validate_uri (argv[3 ])) { +printf ("ERROR: invalid URI\n" ); +return CMD_RET_FAILURE ; + } }efi_create_indexed_name (var_name16, var_name16_size,"Boot" , id);
cmd/net-lwip.c +8 -0
@@ -35,3 +35,11 @@ U_BOOT_CMD("hostname [envvar]" );#endif + +#if defined(CONFIG_CMD_WGET_LWIP ) +U_BOOT_CMD ( + wget,3 ,1 , do_wget, +"boot image via network using HTTP protocol" , +"[loadAddress] URL" +); +#endif
include/net-lwip.h +1 -0
@@ -85,5 +85,6 @@ int do_dhcp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);int do_dns (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]);int do_ping (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]);int do_tftpb (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]); +int do_wget (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]);#endif /* __NET_LWIP_H__ */
net-lwip/Makefile +1 -0
@@ -10,6 +10,7 @@ obj-$(CONFIG_CMD_DHCP_LWIP) += dhcp.o obj-$(CONFIG_CMD_DNS_LWIP) += dns.o obj-$(CONFIG_CMD_PING_LWIP) += ping.o obj-$(CONFIG_CMD_TFTPBOOT_LWIP) += tftp.o +obj-$(CONFIG_CMD_WGET_LWIP) += wget.o # Disable this warning as it is triggered by: # sprintf(buf, index ? "foo%d" : "foo", index)
net-lwip/wget.c new file +168 -0
168 lines not on this page · raw message
Signature · 1 line
2.40.1
PATCH 8/15 net-lwip: import net command from cmd/net.c
In reply to a message not in the archiveAdd support for "net list" and "net stats" to net-lwip/ by copying the code from cmd/net.c.
--- cmd/net-lwip.c | 98 ++++++++++++++++++++++++++++++++++++++++++++++ include/net-lwip.h | 50 +++++++++++++++++++++++ 2 files changed, 148 insertions(+)
cmd/net-lwip.c +98 -0
@@ -2,6 +2,10 @@/* Copyright (C) 2024 Linaro Ltd. */ #include <command.h> +#include <dm/device.h> +#include <dm/uclass.h> +#include <linux/compat.h> +#include <linux/ethtool.h> #include <net-lwip.h> #if defined(CONFIG_CMD_DHCP_LWIP )
@@ -43,3 +47,97 @@ U_BOOT_CMD("[loadAddress] URL" );#endif + +static int do_net_list (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) +{ +const struct udevice *current =eth_get_dev (); +unsigned char env_enetaddr[ARP_HLEN ]; +const struct udevice *dev; +struct uclass *uc; + + uclass_id_foreach_dev(UCLASS_ETH, dev, uc) { +eth_env_get_enetaddr_by_index ("eth" ,dev_seq (dev), env_enetaddr); +printf ("eth%d : %s %pM %s\n" ,dev_seq (dev), dev->name, env_enetaddr, + current == dev ?"active" :"" ); + } +return CMD_RET_SUCCESS ; +} + +static int do_net_stats (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) +{ +int nstats, err, i, off; +struct udevice *dev; +u64 *values; +u8 *strings; + +if (argc <2 ) +return CMD_RET_USAGE ; + + err =uclass_get_device_by_name (UCLASS_ETH , argv[1 ], &dev); +if (err) { +printf ("Could not find device %s\n" , argv[1 ]); +return CMD_RET_FAILURE ; + } + +if (!eth_get_ops (dev)->get_sset_count || + !eth_get_ops (dev)->get_strings || + !eth_get_ops (dev)->get_stats) { +printf ("Driver does not implement stats dump!\n" ); +return CMD_RET_FAILURE ; + } + + nstats =eth_get_ops (dev)->get_sset_count (dev); + strings =kcalloc (nstats,ETH_GSTRING_LEN ,GFP_KERNEL ); +if (!strings) +return CMD_RET_FAILURE ; + + values =kcalloc (nstats,sizeof (u64),GFP_KERNEL ); +if (!values) + goto err_free_strings; + +eth_get_ops (dev)->get_strings (dev, strings); +eth_get_ops (dev)->get_stats (dev, values); + + off =0 ; +for (i =0 ; i < nstats; i++) { +printf (" %s: %llu\n" , &strings[off], values[i]); + off +=ETH_GSTRING_LEN ; + }; + +return CMD_RET_SUCCESS ; + +err_free_strings: +kfree (strings); + +return CMD_RET_FAILURE ; +} + +static struct cmd_tbl cmd_net[] = { +U_BOOT_CMD_MKENT (list,1 ,0 , do_net_list,"" ,"" ), +U_BOOT_CMD_MKENT (stats,2 ,0 , do_net_stats,"" ,"" ), +}; + +static int do_net (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) +{ +struct cmd_tbl *cp; + + cp =find_cmd_tbl (argv[1 ], cmd_net,ARRAY_SIZE (cmd_net)); + +/* Drop the net command */ + argc--; + argv++; + +if (!cp || argc > cp->maxargs) +return CMD_RET_USAGE ; +if (flag ==CMD_FLAG_REPEAT && !cmd_is_repeatable (cp)) +return CMD_RET_SUCCESS ; + +return cp->cmd (cmdtp, flag, argc, argv); +} + +U_BOOT_CMD ( + net,3 ,1 , do_net, +"NET sub-system" , +"list - list available devices\n" +"stats <device> - dump statistics for specified device\n" +);
include/net-lwip.h +50 -0
56 lines not on this page · raw message
Signature · 1 line
2.40.1
PATCH 9/15 net-lwip: add support for EFI_HTTP_BOOT
In reply to a message not in the archiveImplement the wget_with_dns() function which is needed by CONFIG_EFI_HTTP_BOOT=y. Note that there is no dependency added on CONFIG_CMD_DNS_LWIP because CONFIG_CMD_WGET_LWIP natively supports hostname resolution.
--- lib/efi_loader/Kconfig | 5 +++-- net-lwip/wget.c | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-)
lib/efi_loader/Kconfig +3 -2
@@ -505,8 +505,9 @@ config EFI_RISCV_BOOT_PROTOCOL config EFI_HTTP_BOOT bool "EFI HTTP Boot support" - select CMD_DNS - select CMD_WGET + select CMD_DNS if NET + select CMD_WGET if NET + select CMD_WGET_LWIP if NET_LWIP select BLKMAP help Enabling this option adds EFI HTTP Boot support. It allows to
net-lwip/wget.c +16 -0
@@ -166,3 +166,19 @@ int do_wget(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])return CMD_RET_FAILURE ; } + +#if defined(CONFIG_EFI_HTTP_BOOT ) +int wget_with_dns (ulong dst_addr,char *uri) +{ +char addr_str[11 ]; +struct cmd_tbl cmdtp = {}; +char *argv[] = {"wget" , addr_str, uri }; + +snprintf (addr_str,sizeof (addr_str),"0x%lx" , dst_addr); + +if (do_wget (&cmdtp,0 ,ARRAY_SIZE (argv), argv) ==CMD_RET_SUCCESS ) +return 0 ; + +return -1 ; +} +#endif
Signature · 1 line
2.40.1
PATCH 10/15 test: dm: dsa, eth: disable tests when CONFIG_NET_LWIP=y
In reply to a message not in the archiveSome sandbox tests make strong assumptions on how the network stack is implemented. For example, the ping tests assume that ARP resolution occurs upon sending out the ICMP packet. This is not always the case with the lwIP stack which can cache ARP information. Therefore, disable these tests when CONFIG_NET_LWIP is enabled.
--- test/dm/dsa.c | 2 ++ test/dm/eth.c | 4 ++++ 2 files changed, 6 insertions(+)
test/dm/dsa.c +2 -0
@@ -59,6 +59,7 @@ static int dm_test_dsa_probe(struct unit_test_state *uts)DM_TEST (dm_test_dsa_probe,UT_TESTF_SCAN_FDT ); +#if !defined(CONFIG_NET_LWIP )/* This test sends ping requests with the local address through each DSA port * via the sandbox DSA master Eth. */
@@ -80,3 +81,4 @@ static int dm_test_dsa(struct unit_test_state *uts) }DM_TEST (dm_test_dsa,UT_TESTF_SCAN_FDT ); +#endif /* !defined(CONFIG_NET_LWIP) */
test/dm/eth.c +4 -0
@@ -170,6 +170,7 @@ static int dm_test_ip6_make_lladdr(struct unit_test_state *uts)DM_TEST (dm_test_ip6_make_lladdr,UT_TESTF_SCAN_FDT );#endif +#if !defined(CONFIG_NET_LWIP )static int dm_test_eth (struct unit_test_state *uts) { net_ping_ip =string_to_ip ("1.1.2.2" );
@@ -298,6 +299,7 @@ static int dm_test_eth_act(struct unit_test_state *uts) return 0; }DM_TEST (dm_test_eth_act,UT_TESTF_SCAN_FDT ); +#endif /* !CONFIG_NET_LWIP */ /* Ensure that all addresses are loaded properly */ static int dm_test_ethaddr (struct unit_test_state *uts)
@@ -332,6 +334,7 @@ static int dm_test_ethaddr(struct unit_test_state *uts) }DM_TEST (dm_test_ethaddr,UT_TESTF_SCAN_FDT ); +#if !defined(CONFIG_NET_LWIP )/* The asserts include a return on fail; cleanup in the caller */ static int _dm_test_eth_rotate1 (struct unit_test_state *uts) {
@@ -616,6 +619,7 @@ static int dm_test_eth_async_ping_reply(struct unit_test_state *uts) }DM_TEST (dm_test_eth_async_ping_reply,UT_TESTF_SCAN_FDT ); +#endif /* !CONFIG_NET_LWIP */ #if IS_ENABLED (CONFIG_IPV6_ROUTER_DISCOVERY )
Signature · 1 line
2.40.1
PATCH 11/15 cmd: bdinfo: enable -e when CONFIG_CMD_NET_LWIP=y
In reply to a message not in the archiveSupport "bdinfo -e" when lwIP is selected.
--- cmd/bdinfo.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
cmd/bdinfo.c +3 -2
@@ -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_CMD_NET )) +if (IS_ENABLED (CONFIG_CMD_NET ) ||IS_ENABLED (CONFIG_CMD_NET_LWIP ))print_eth ();bdinfo_print_num_l ("fdt_blob" , (ulong )map_to_sysmem (gd->fdt_blob));bdinfo_print_num_l ("new_fdt" , (ulong )map_to_sysmem (gd->new_fdt));
@@ -198,7 +198,8 @@ 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_CMD_NET )) +if (!IS_ENABLED (CONFIG_CMD_NET ) && + !IS_ENABLED (CONFIG_CMD_NET_LWIP ))return CMD_RET_USAGE ;print_eth ();return CMD_RET_SUCCESS ;
Signature · 1 line
2.40.1
PATCH 12/15 configs: add qemu_arm64_lwip_defconfig
In reply to a message not in the archiveAdd qemu_arm64_lwip_defconfig which was created from qemu_arm64_defconfig with CONFIG_NET_LWIP enabled.
--- configs/qemu_arm64_lwip_defconfig | 70 +++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 configs/qemu_arm64_lwip_defconfig
configs/qemu_arm64_lwip_defconfig new file +70 -0
@@ -0,0 +1,70 @@ +CONFIG_ARM=y +CONFIG_POSITION_INDEPENDENT=y +CONFIG_ARCH_QEMU=y +CONFIG_SYS_MALLOC_LEN=0x1000000 +CONFIG_NR_DRAM_BANKS=1 +CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y +CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x40200000 +CONFIG_ENV_SIZE=0x40000 +CONFIG_ENV_SECT_SIZE=0x40000 +CONFIG_DEFAULT_DEVICE_TREE="qemu-arm64" +CONFIG_DEBUG_UART_BASE=0x9000000 +CONFIG_DEBUG_UART_CLOCK=0 +CONFIG_ARMV8_CRYPTO=y +CONFIG_SYS_LOAD_ADDR=0x40200000 +CONFIG_ENV_ADDR=0x4000000 +CONFIG_PCI=y +CONFIG_DEBUG_UART=y +CONFIG_AHCI=y +CONFIG_FIT=y +CONFIG_FIT_SIGNATURE=y +CONFIG_FIT_VERBOSE=y +CONFIG_FIT_BEST_MATCH=y +CONFIG_BOOTSTD_FULL=y +CONFIG_LEGACY_IMAGE_FORMAT=y +CONFIG_USE_PREBOOT=y +# CONFIG_DISPLAY_CPUINFO is not set +# CONFIG_DISPLAY_BOARDINFO is not set +CONFIG_PCI_INIT_R=y +CONFIG_CMD_SMBIOS=y +CONFIG_CMD_BOOTZ=y +CONFIG_CMD_BOOTEFI_SELFTEST=y +CONFIG_CMD_NVEDIT_EFI=y +CONFIG_CMD_DFU=y +CONFIG_CMD_MTD=y +CONFIG_CMD_PCI=y +CONFIG_CMD_TPM=y +CONFIG_CMD_MTDPARTS=y +CONFIG_ENV_IS_IN_FLASH=y +CONFIG_NET_LWIP=y +CONFIG_SCSI_AHCI=y +CONFIG_AHCI_PCI=y +CONFIG_DFU_MTD=y +CONFIG_DFU_RAM=y +# CONFIG_MMC is not set +CONFIG_MTD=y +CONFIG_DM_MTD=y +CONFIG_MTD_NOR_FLASH=y +CONFIG_FLASH_SHOW_PROGRESS=0 +CONFIG_CFI_FLASH=y +CONFIG_CFI_FLASH_USE_WEAK_ACCESSORS=y +CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y +CONFIG_FLASH_CFI_MTD=y +CONFIG_SYS_FLASH_CFI=y +CONFIG_SYS_MAX_FLASH_SECT=256 +CONFIG_SYS_MAX_FLASH_BANKS=2 +CONFIG_SYS_MAX_FLASH_BANKS_DETECT=y +CONFIG_E1000=y +CONFIG_NVME_PCI=y +CONFIG_PCIE_ECAM_GENERIC=y +CONFIG_SCSI=y +CONFIG_DEBUG_UART_PL011=y +CONFIG_DEBUG_UART_SHIFT=2 +CONFIG_SYSRESET=y +CONFIG_SYSRESET_CMD_POWEROFF=y +CONFIG_SYSRESET_PSCI=y +CONFIG_TPM2_MMIO=y +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_EHCI_PCI=y +CONFIG_SEMIHOSTING=y +CONFIG_TPM=y
Signature · 1 line
2.40.1
PATCH 13/15 test/py: net: add _lwip variants of dhcp, ping and tftpboot tests
In reply to a message not in the archiveWHen NET_LWIP is enabled, the dhcp/ping/tftpboot commands are enabled via CMD_DHCP_LWIP, CMD_PING_LWIP and CMD_TFTPBOOT_LWIP, respectively; therefore the config annotations in the Python test scripts need to be cmd_dhcp_lwip, cmd_ping_lwip and cmd_tftpboot_lwip.
The console output of the tftpboot command with lwIP is slightly different from the non-lwIP implementation. This is taken care of in test_net_tftpboot().
--- test/py/tests/test_net.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)
test/py/tests/test_net.py +17 -4
@@ -127,6 +127,10 @@ def test_net_dhcp(u_boot_console): global net_set_up net_set_up = True [email protected]('cmd_dhcp_lwip') +def test_net_dhcp_lwip(u_boot_console): + test_net_dhcp(u_boot_console) + @pytest.mark.buildconfigspec('cmd_dhcp') @pytest.mark.buildconfigspec('cmd_mii') def test_net_dhcp_abort(u_boot_console):
@@ -230,6 +234,10 @@ def test_net_ping(u_boot_console): output = u_boot_console.run_command('ping $serverip') assert 'is alive' in output [email protected]('cmd_ping_lwip') +def test_net_ping_lwip(u_boot_console): + test_net_ping(u_boot_console) + @pytest.mark.buildconfigspec('IPV6_ROUTER_DISCOVERY') def test_net_network_discovery(u_boot_console): """Test the network discovery feature of IPv6.
@@ -255,7 +263,7 @@ def test_net_network_discovery(u_boot_console): assert '0000:0000:0000:0000:0000:0000:0000:0000' not in output @pytest.mark.buildconfigspec('cmd_net') -def test_net_tftpboot(u_boot_console): +def test_net_tftpboot(u_boot_console, lwip = False): """Test the tftpboot command. A file is downloaded from the TFTP server, its size and optionally its
@@ -279,10 +287,11 @@ def test_net_tftpboot(u_boot_console): output = u_boot_console.run_command('tftpboot %s' % (fn)) else: output = u_boot_console.run_command('tftpboot %x %s' % (addr, fn)) - expected_text = 'Bytes transferred = ' sz = f.get('size', None) - if sz: - expected_text += '%d' % sz + if lwip: + expected_text = f'{sz} bytes transferred' + else: + expected_text = f'Bytes transferred = {sz}' assert expected_text in output expected_crc = f.get('crc32', None)
@@ -295,6 +304,10 @@ def test_net_tftpboot(u_boot_console): output = u_boot_console.run_command('crc32 $fileaddr $filesize') assert expected_crc in output [email protected]("cmd_net_lwip") +def test_net_tftpboot_lwip(u_boot_console): + test_net_tftpboot(u_boot_console, True) + @pytest.mark.buildconfigspec('cmd_nfs') def test_net_nfs(u_boot_console): """Test the nfs command.
Signature · 1 line
2.40.1
PATCH 14/15 MAINTAINERS: net-lwip: add myself as a maintainer
In reply to a message not in the archiveAdd myself as a maintainer for the lwIP network stack integration code and network commands. The library code itself (i.e., most files under lib/lwip/ except README, Makefile and integration files in u-boot) is unmodified from upstream and therefore does not need a maintainer.
--- MAINTAINERS | 11 +++++++++++ 1 file changed, 11 insertions(+)
MAINTAINERS +11 -0
@@ -1311,6 +1311,17 @@ F: drivers/net/ F: include/net.h F: net/ +NETWORK (LWIP) +M: Jerome Forissier <[email protected]> +S: Maintained +F: cmd/net-lwip.c +F: configs/qemu_arm64_lwip_defconfig +F: include/net-lwip.h +F: lib/lwip/Makefile +F: lib/lwip/README +F: lib/lwip/u-boot/ +F: net-lwip/ + NIOS M: Thomas Chou <[email protected]> S: Maintained
Signature · 1 line
2.40.1
PATCH 15/15 CI: add qemu_arm64_lwip to the test matrix
In reply to a message not in the archiveBuild and run qemu_arm64_lwip_defconfig in CI. This tests the lightweight IP (lwIP) implementation of the dhcp, tftpboot and ping commands.
--- .azure-pipelines.yml | 7 +++++++ 1 file changed, 7 insertions(+)
.azure-pipelines.yml +7 -0
@@ -199,6 +199,10 @@ stages: cd \${WORK_DIR} git config --global --add safe.directory \${WORK_DIR} git clone --depth=1 https://source.denx.de/u-boot/u-boot-test-hooks /tmp/uboot-test-hooks + # qemu_arm64_lwip_defconfig is the same as qemu_arm64 but with NET_LWIP enabled. + # The test config and the boardenv file from qemu_arm64 can be re-used so create symlinks + ln -s conf.qemu_arm64_na /tmp/uboot-test-hooks/bin/travis-ci/conf.qemu_arm64_lwip_na + ln -s u_boot_boardenv_qemu_arm64_na.py /tmp/uboot-test-hooks/py/travis-ci/u_boot_boardenv_qemu_arm64_lwip_na.py ln -s travis-ci /tmp/uboot-test-hooks/bin/\`hostname\` ln -s travis-ci /tmp/uboot-test-hooks/py/\`hostname\` grub-mkimage --prefix=\"\" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
@@ -371,6 +375,9 @@ stages: qemu_arm64: TEST_PY_BD: "qemu_arm64" TEST_PY_TEST_SPEC: "not sleep" + qemu_arm64_lwip: + TEST_PY_BD: "qemu_arm64_lwip" + TEST_PY_TEST_SPEC: "test_net_dhcp_lwip or test_net_ping_lwip or test_net_tftpboot_lwip" qemu_m68k: TEST_PY_BD: "M5208EVBE" TEST_PY_ID: "--id qemu"
Signature · 1 line
2.40.1
Re: [PATCH 11/15] cmd: bdinfo: enable -e when CONFIG_CMD_NET_LWIP=y
In reply to Jerome ForissierQuoted 32 lines · Jerome Forissier
Support "bdinfo -e" when lwIP is selected.
Signed-off-by Jerome Forissier <[email protected]>--- cmd/bdinfo.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)cmd/bdinfo.c +3
-3@@ -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_CMD_NET )) +if (IS_ENABLED (CONFIG_CMD_NET ) ||IS_ENABLED (CONFIG_CMD_NET_LWIP ))print_eth ();bdinfo_print_num_l ("fdt_blob" , (ulong )map_to_sysmem (gd->fdt_blob));bdinfo_print_num_l ("new_fdt" , (ulong )map_to_sysmem (gd->new_fdt));@@ -198,7 +198,8 @@ 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_CMD_NET )) +if (!IS_ENABLED (CONFIG_CMD_NET ) && + !IS_ENABLED (CONFIG_CMD_NET_LWIP ))return CMD_RET_USAGE ;print_eth ();return CMD_RET_SUCCESS ; --
Quoted 2 lines
2.40.1
PATCH 1/15 net: introduce alternative implementation as net-lwip/
In reply to a message not in the archivePrepare 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.
--- 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
Kconfig +2 -0
@@ -747,6 +747,8 @@ source "env/Kconfig" source "net/Kconfig" +source "net-lwip/Kconfig" + source "drivers/Kconfig" source "fs/Kconfig"
Makefile +1 -1
@@ -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/
common/Kconfig +1 -1
@@ -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.
common/spl/Kconfig +1 -0
@@ -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
drivers/dfu/Kconfig +1 -1
@@ -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
drivers/fastboot/Kconfig +2 -2
@@ -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
drivers/net/phy/Kconfig +1 -1
@@ -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.
drivers/usb/gadget/Kconfig +1 -1
@@ -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
net-lwip/Kconfig new file +15 -0
@@ -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.
net/Kconfig +1 -0
@@ -6,6 +6,7 @@ menuconfig NET bool "Networking support" default y imply NETDEVICES + depends on !NET_LWIP if NET
Signature · 1 line
2.40.1
PATCH 2/15 net-lwip: import lwIP library under lib/lwip
In reply to a message not in the archiveImport the Lightweight IP (lwIP) library as lib/lwip. The code is built when CONFIG_NET_LWIP=y.
The lwIP code was imported with the following commands:
(cd /tmp && git clone https://git.savannah.gnu.org/git/lwip.git -b STABLE-2_2_0_RELEASE) mkdir -p lib/lwip
cp -R /tmp/lwip/src/{api,core,include} lib/lwip/
mkdir -p lib/lwip/netif && cp /tmp/lwip/src/netif/ethernet.c lib/lwip/netif/ mkdir -p lib/lwip/apps/tftp && cp /tmp/lwip/src/apps/tftp/tftp.c lib/lwip/apps/tftp/ mkdir -p lib/lwip/apps/http && cp /tmp/lwip/src/apps/http/http_client.c lib/lwip/apps/http/
The list of object files added to lib/liwip/Makefile was given by:
(cd lib/lwip && find . -name \*.c | sort | sed 's@\./@\t@' | sed 's/\.c$/.o \\/') >>lib/liwip/Makefile
These files are adaptation layers written specially for U-Boot:
lib/lwip/u-boot/arch/cc.h
lib/lwip/u-boot/arch/sys_arch.h (empty)
lib/lwip/u-boot/limits.h (empty)
lib/lwip/u-boot/lwipopts.h
They were initially contributed by Maxim in a previous RFC patch series.
--- lib/Makefile | 2 + lib/lwip/Makefile | 57 + lib/lwip/README | 6 + lib/lwip/api/api_lib.c | 1367 ++++++ lib/lwip/api/api_msg.c | 2177 +++++++++ lib/lwip/api/err.c | 115 + lib/lwip/api/if_api.c | 102 + lib/lwip/api/netbuf.c | 250 + lib/lwip/api/netdb.c | 422 ++ lib/lwip/api/netifapi.c | 380 ++ lib/lwip/api/sockets.c | 4205 +++++++++++++++++ lib/lwip/api/tcpip.c | 706 +++ lib/lwip/apps/http/http_client.c | 911 ++++ lib/lwip/apps/tftp/tftp.c | 548 +++ lib/lwip/core/altcp.c | 717 +++ lib/lwip/core/altcp_alloc.c | 87 + lib/lwip/core/altcp_tcp.c | 578 +++ lib/lwip/core/def.c | 263 ++ lib/lwip/core/dns.c | 1657 +++++++ lib/lwip/core/inet_chksum.c | 608 +++ lib/lwip/core/init.c | 387 ++ lib/lwip/core/ip.c | 167 + lib/lwip/core/ipv4/acd.c | 557 +++ lib/lwip/core/ipv4/autoip.c | 379 ++ lib/lwip/core/ipv4/dhcp.c | 1999 ++++++++ lib/lwip/core/ipv4/etharp.c | 1251 +++++ lib/lwip/core/ipv4/icmp.c | 407 ++ lib/lwip/core/ipv4/igmp.c | 801 ++++ lib/lwip/core/ipv4/ip4.c | 1166 +++++ lib/lwip/core/ipv4/ip4_addr.c | 323 ++ lib/lwip/core/ipv4/ip4_frag.c | 894 ++++ lib/lwip/core/ipv6/dhcp6.c | 821 ++++ lib/lwip/core/ipv6/ethip6.c | 123 + lib/lwip/core/ipv6/icmp6.c | 425 ++ lib/lwip/core/ipv6/inet6.c | 53 + lib/lwip/core/ipv6/ip6.c | 1494 ++++++ lib/lwip/core/ipv6/ip6_addr.c | 355 ++ lib/lwip/core/ipv6/ip6_frag.c | 862 ++++ lib/lwip/core/ipv6/mld6.c | 626 +++ lib/lwip/core/ipv6/nd6.c | 2474 ++++++++++ lib/lwip/core/mem.c | 1017 ++++ lib/lwip/core/memp.c | 447 ++ lib/lwip/core/netif.c | 1855 ++++++++ lib/lwip/core/pbuf.c | 1545 ++++++ lib/lwip/core/raw.c | 673 +++ lib/lwip/core/stats.c | 168 + lib/lwip/core/sys.c | 148 + lib/lwip/core/tcp.c | 2696 +++++++++++ lib/lwip/core/tcp_in.c | 2184 +++++++++ lib/lwip/core/tcp_out.c | 2257 +++++++++ lib/lwip/core/timeouts.c | 451 ++ lib/lwip/core/udp.c | 1321 ++++++ lib/lwip/include/compat/posix/arpa/inet.h | 33 + lib/lwip/include/compat/posix/net/if.h | 36 + lib/lwip/include/compat/posix/netdb.h | 33 + lib/lwip/include/compat/posix/sys/socket.h | 33 + lib/lwip/include/compat/stdc/errno.h | 33 + lib/lwip/include/lwip/acd.h | 109 + lib/lwip/include/lwip/altcp.h | 207 + lib/lwip/include/lwip/altcp_tcp.h | 72 + lib/lwip/include/lwip/altcp_tls.h | 196 + lib/lwip/include/lwip/api.h | 434 ++ lib/lwip/include/lwip/apps/FILES | 2 + .../include/lwip/apps/altcp_proxyconnect.h | 79 + .../lwip/apps/altcp_tls_mbedtls_opts.h | 111 + lib/lwip/include/lwip/apps/fs.h | 139 + lib/lwip/include/lwip/apps/http_client.h | 160 + lib/lwip/include/lwip/apps/httpd.h | 256 + lib/lwip/include/lwip/apps/httpd_opts.h | 416 ++ lib/lwip/include/lwip/apps/lwiperf.h | 109 + lib/lwip/include/lwip/apps/mdns.h | 154 + lib/lwip/include/lwip/apps/mdns_domain.h | 80 + lib/lwip/include/lwip/apps/mdns_opts.h | 121 + lib/lwip/include/lwip/apps/mdns_out.h | 138 + lib/lwip/include/lwip/apps/mdns_priv.h | 237 + lib/lwip/include/lwip/apps/mqtt.h | 205 + lib/lwip/include/lwip/apps/mqtt_opts.h | 103 + lib/lwip/include/lwip/apps/mqtt_priv.h | 104 + lib/lwip/include/lwip/apps/netbiosns.h | 51 + lib/lwip/include/lwip/apps/netbiosns_opts.h | 66 + lib/lwip/include/lwip/apps/smtp.h | 128 + lib/lwip/include/lwip/apps/smtp_opts.h | 80 + lib/lwip/include/lwip/apps/snmp.h | 145 + lib/lwip/include/lwip/apps/snmp_core.h | 377 ++ lib/lwip/include/lwip/apps/snmp_mib2.h | 78 + lib/lwip/include/lwip/apps/snmp_opts.h | 297 ++ lib/lwip/include/lwip/apps/snmp_scalar.h | 113 + .../include/lwip/apps/snmp_snmpv2_framework.h | 32 + lib/lwip/include/lwip/apps/snmp_snmpv2_usm.h | 24 + lib/lwip/include/lwip/apps/snmp_table.h | 134 + lib/lwip/include/lwip/apps/snmp_threadsync.h | 114 + lib/lwip/include/lwip/apps/snmpv3.h | 114 + lib/lwip/include/lwip/apps/sntp.h | 81 + lib/lwip/include/lwip/apps/sntp_opts.h | 215 + lib/lwip/include/lwip/apps/tftp_client.h | 50 + lib/lwip/include/lwip/apps/tftp_common.h | 108 + lib/lwip/include/lwip/apps/tftp_opts.h | 106 + lib/lwip/include/lwip/apps/tftp_server.h | 42 + lib/lwip/include/lwip/arch.h | 402 ++ lib/lwip/include/lwip/autoip.h | 90 + lib/lwip/include/lwip/debug.h | 161 + lib/lwip/include/lwip/def.h | 156 + lib/lwip/include/lwip/dhcp.h | 155 + lib/lwip/include/lwip/dhcp6.h | 104 + lib/lwip/include/lwip/dns.h | 131 + lib/lwip/include/lwip/err.h | 117 + lib/lwip/include/lwip/errno.h | 198 + lib/lwip/include/lwip/etharp.h | 110 + lib/lwip/include/lwip/ethip6.h | 68 + lib/lwip/include/lwip/icmp.h | 110 + lib/lwip/include/lwip/icmp6.h | 72 + lib/lwip/include/lwip/if_api.h | 70 + lib/lwip/include/lwip/igmp.h | 115 + lib/lwip/include/lwip/inet.h | 188 + lib/lwip/include/lwip/inet_chksum.h | 104 + lib/lwip/include/lwip/init.h | 100 + lib/lwip/include/lwip/init.h.cmake.in | 100 + lib/lwip/include/lwip/ip.h | 339 ++ lib/lwip/include/lwip/ip4.h | 109 + lib/lwip/include/lwip/ip4_addr.h | 225 + lib/lwip/include/lwip/ip4_frag.h | 100 + lib/lwip/include/lwip/ip6.h | 93 + lib/lwip/include/lwip/ip6_addr.h | 372 ++ lib/lwip/include/lwip/ip6_frag.h | 144 + lib/lwip/include/lwip/ip6_zone.h | 306 ++ lib/lwip/include/lwip/ip_addr.h | 468 ++ lib/lwip/include/lwip/mem.h | 82 + lib/lwip/include/lwip/memp.h | 155 + lib/lwip/include/lwip/mld6.h | 99 + lib/lwip/include/lwip/nd6.h | 90 + lib/lwip/include/lwip/netbuf.h | 116 + lib/lwip/include/lwip/netdb.h | 150 + lib/lwip/include/lwip/netif.h | 698 +++ lib/lwip/include/lwip/netifapi.h | 161 + lib/lwip/include/lwip/opt.h | 3595 ++++++++++++++ lib/lwip/include/lwip/pbuf.h | 326 ++ lib/lwip/include/lwip/priv/altcp_priv.h | 159 + lib/lwip/include/lwip/priv/api_msg.h | 272 ++ lib/lwip/include/lwip/priv/mem_priv.h | 84 + lib/lwip/include/lwip/priv/memp_priv.h | 161 + lib/lwip/include/lwip/priv/memp_std.h | 153 + lib/lwip/include/lwip/priv/nd6_priv.h | 143 + lib/lwip/include/lwip/priv/raw_priv.h | 69 + lib/lwip/include/lwip/priv/sockets_priv.h | 175 + lib/lwip/include/lwip/priv/tcp_priv.h | 523 ++ lib/lwip/include/lwip/priv/tcpip_priv.h | 176 + lib/lwip/include/lwip/prot/acd.h | 91 + lib/lwip/include/lwip/prot/autoip.h | 65 + lib/lwip/include/lwip/prot/dhcp.h | 178 + lib/lwip/include/lwip/prot/dhcp6.h | 138 + lib/lwip/include/lwip/prot/dns.h | 140 + lib/lwip/include/lwip/prot/etharp.h | 114 + lib/lwip/include/lwip/prot/ethernet.h | 127 + lib/lwip/include/lwip/prot/iana.h | 97 + lib/lwip/include/lwip/prot/icmp.h | 105 + lib/lwip/include/lwip/prot/icmp6.h | 172 + lib/lwip/include/lwip/prot/ieee.h | 91 + lib/lwip/include/lwip/prot/igmp.h | 90 + lib/lwip/include/lwip/prot/ip.h | 59 + lib/lwip/include/lwip/prot/ip4.h | 131 + lib/lwip/include/lwip/prot/ip6.h | 235 + lib/lwip/include/lwip/prot/mld6.h | 71 + lib/lwip/include/lwip/prot/nd6.h | 274 ++ lib/lwip/include/lwip/prot/tcp.h | 100 + lib/lwip/include/lwip/prot/udp.h | 68 + lib/lwip/include/lwip/raw.h | 143 + lib/lwip/include/lwip/sio.h | 142 + lib/lwip/include/lwip/snmp.h | 213 + lib/lwip/include/lwip/sockets.h | 707 +++ lib/lwip/include/lwip/stats.h | 491 ++ lib/lwip/include/lwip/sys.h | 575 +++ lib/lwip/include/lwip/tcp.h | 500 ++ lib/lwip/include/lwip/tcpbase.h | 88 + lib/lwip/include/lwip/tcpip.h | 114 + lib/lwip/include/lwip/timeouts.h | 128 + lib/lwip/include/lwip/udp.h | 195 + lib/lwip/include/netif/bridgeif.h | 127 + lib/lwip/include/netif/bridgeif_opts.h | 90 + lib/lwip/include/netif/etharp.h | 3 + lib/lwip/include/netif/ethernet.h | 77 + lib/lwip/include/netif/ieee802154.h | 112 + lib/lwip/include/netif/lowpan6.h | 89 + lib/lwip/include/netif/lowpan6_ble.h | 78 + lib/lwip/include/netif/lowpan6_common.h | 82 + lib/lwip/include/netif/lowpan6_opts.h | 122 + lib/lwip/include/netif/ppp/ccp.h | 164 + lib/lwip/include/netif/ppp/chap-md5.h | 36 + lib/lwip/include/netif/ppp/chap-new.h | 200 + lib/lwip/include/netif/ppp/chap_ms.h | 44 + lib/lwip/include/netif/ppp/eap.h | 169 + lib/lwip/include/netif/ppp/ecp.h | 62 + lib/lwip/include/netif/ppp/eui64.h | 102 + lib/lwip/include/netif/ppp/fsm.h | 182 + lib/lwip/include/netif/ppp/ipcp.h | 134 + lib/lwip/include/netif/ppp/ipv6cp.h | 191 + lib/lwip/include/netif/ppp/lcp.h | 179 + lib/lwip/include/netif/ppp/magic.h | 130 + lib/lwip/include/netif/ppp/mppe.h | 181 + lib/lwip/include/netif/ppp/polarssl/arc4.h | 81 + lib/lwip/include/netif/ppp/polarssl/des.h | 92 + lib/lwip/include/netif/ppp/polarssl/md4.h | 97 + lib/lwip/include/netif/ppp/polarssl/md5.h | 96 + lib/lwip/include/netif/ppp/polarssl/sha1.h | 96 + lib/lwip/include/netif/ppp/ppp.h | 698 +++ lib/lwip/include/netif/ppp/ppp_impl.h | 736 +++ lib/lwip/include/netif/ppp/ppp_opts.h | 610 +++ lib/lwip/include/netif/ppp/pppapi.h | 137 + lib/lwip/include/netif/ppp/pppcrypt.h | 144 + lib/lwip/include/netif/ppp/pppdebug.h | 88 + lib/lwip/include/netif/ppp/pppoe.h | 187 + lib/lwip/include/netif/ppp/pppol2tp.h | 209 + lib/lwip/include/netif/ppp/pppos.h | 125 + lib/lwip/include/netif/ppp/upap.h | 131 + lib/lwip/include/netif/ppp/vj.h | 169 + lib/lwip/include/netif/slipif.h | 86 + lib/lwip/include/netif/zepif.h | 81 + lib/lwip/netif/ethernet.c | 329 ++ lib/lwip/u-boot/arch/cc.h | 43 + lib/lwip/u-boot/arch/sys_arch.h | 0 lib/lwip/u-boot/limits.h | 0 lib/lwip/u-boot/lwipopts.h | 197 + net-lwip/Kconfig | 40 +- 222 files changed, 76200 insertions(+), 1 deletion(-) create mode 100644 lib/lwip/Makefile create mode 100644 lib/lwip/README create mode 100644 lib/lwip/api/api_lib.c create mode 100644 lib/lwip/api/api_msg.c create mode 100644 lib/lwip/api/err.c create mode 100644 lib/lwip/api/if_api.c create mode 100644 lib/lwip/api/netbuf.c create mode 100644 lib/lwip/api/netdb.c create mode 100644 lib/lwip/api/netifapi.c create mode 100644 lib/lwip/api/sockets.c create mode 100644 lib/lwip/api/tcpip.c create mode 100644 lib/lwip/apps/http/http_client.c create mode 100644 lib/lwip/apps/tftp/tftp.c create mode 100644 lib/lwip/core/altcp.c create mode 100644 lib/lwip/core/altcp_alloc.c create mode 100644 lib/lwip/core/altcp_tcp.c create mode 100644 lib/lwip/core/def.c create mode 100644 lib/lwip/core/dns.c create mode 100644 lib/lwip/core/inet_chksum.c create mode 100644 lib/lwip/core/init.c create mode 100644 lib/lwip/core/ip.c create mode 100644 lib/lwip/core/ipv4/acd.c create mode 100644 lib/lwip/core/ipv4/autoip.c create mode 100644 lib/lwip/core/ipv4/dhcp.c create mode 100644 lib/lwip/core/ipv4/etharp.c create mode 100644 lib/lwip/core/ipv4/icmp.c create mode 100644 lib/lwip/core/ipv4/igmp.c create mode 100644 lib/lwip/core/ipv4/ip4.c create mode 100644 lib/lwip/core/ipv4/ip4_addr.c create mode 100644 lib/lwip/core/ipv4/ip4_frag.c create mode 100644 lib/lwip/core/ipv6/dhcp6.c create mode 100644 lib/lwip/core/ipv6/ethip6.c create mode 100644 lib/lwip/core/ipv6/icmp6.c create mode 100644 lib/lwip/core/ipv6/inet6.c create mode 100644 lib/lwip/core/ipv6/ip6.c create mode 100644 lib/lwip/core/ipv6/ip6_addr.c create mode 100644 lib/lwip/core/ipv6/ip6_frag.c create mode 100644 lib/lwip/core/ipv6/mld6.c create mode 100644 lib/lwip/core/ipv6/nd6.c create mode 100644 lib/lwip/core/mem.c create mode 100644 lib/lwip/core/memp.c create mode 100644 lib/lwip/core/netif.c create mode 100644 lib/lwip/core/pbuf.c create mode 100644 lib/lwip/core/raw.c create mode 100644 lib/lwip/core/stats.c create mode 100644 lib/lwip/core/sys.c create mode 100644 lib/lwip/core/tcp.c create mode 100644 lib/lwip/core/tcp_in.c create mode 100644 lib/lwip/core/tcp_out.c create mode 100644 lib/lwip/core/timeouts.c create mode 100644 lib/lwip/core/udp.c create mode 100644 lib/lwip/include/compat/posix/arpa/inet.h create mode 100644 lib/lwip/include/compat/posix/net/if.h create mode 100644 lib/lwip/include/compat/posix/netdb.h create mode 100644 lib/lwip/include/compat/posix/sys/socket.h create mode 100644 lib/lwip/include/compat/stdc/errno.h create mode 100644 lib/lwip/include/lwip/acd.h create mode 100644 lib/lwip/include/lwip/altcp.h create mode 100644 lib/lwip/include/lwip/altcp_tcp.h create mode 100644 lib/lwip/include/lwip/altcp_tls.h create mode 100644 lib/lwip/include/lwip/api.h create mode 100644 lib/lwip/include/lwip/apps/FILES create mode 100644 lib/lwip/include/lwip/apps/altcp_proxyconnect.h create mode 100644 lib/lwip/include/lwip/apps/altcp_tls_mbedtls_opts.h create mode 100644 lib/lwip/include/lwip/apps/fs.h create mode 100644 lib/lwip/include/lwip/apps/http_client.h create mode 100644 lib/lwip/include/lwip/apps/httpd.h create mode 100644 lib/lwip/include/lwip/apps/httpd_opts.h create mode 100644 lib/lwip/include/lwip/apps/lwiperf.h create mode 100644 lib/lwip/include/lwip/apps/mdns.h create mode 100644 lib/lwip/include/lwip/apps/mdns_domain.h create mode 100644 lib/lwip/include/lwip/apps/mdns_opts.h create mode 100644 lib/lwip/include/lwip/apps/mdns_out.h create mode 100644 lib/lwip/include/lwip/apps/mdns_priv.h create mode 100644 lib/lwip/include/lwip/apps/mqtt.h create mode 100644 lib/lwip/include/lwip/apps/mqtt_opts.h create mode 100644 lib/lwip/include/lwip/apps/mqtt_priv.h create mode 100644 lib/lwip/include/lwip/apps/netbiosns.h create mode 100644 lib/lwip/include/lwip/apps/netbiosns_opts.h create mode 100644 lib/lwip/include/lwip/apps/smtp.h create mode 100644 lib/lwip/include/lwip/apps/smtp_opts.h create mode 100644 lib/lwip/include/lwip/apps/snmp.h create mode 100644 lib/lwip/include/lwip/apps/snmp_core.h create mode 100644 lib/lwip/include/lwip/apps/snmp_mib2.h create mode 100644 lib/lwip/include/lwip/apps/snmp_opts.h create mode 100644 lib/lwip/include/lwip/apps/snmp_scalar.h create mode 100644 lib/lwip/include/lwip/apps/snmp_snmpv2_framework.h create mode 100644 lib/lwip/include/lwip/apps/snmp_snmpv2_usm.h create mode 100644 lib/lwip/include/lwip/apps/snmp_table.h create mode 100644 lib/lwip/include/lwip/apps/snmp_threadsync.h create mode 100644 lib/lwip/include/lwip/apps/snmpv3.h create mode 100644 lib/lwip/include/lwip/apps/sntp.h create mode 100644 lib/lwip/include/lwip/apps/sntp_opts.h create mode 100644 lib/lwip/include/lwip/apps/tftp_client.h create mode 100644 lib/lwip/include/lwip/apps/tftp_common.h create mode 100644 lib/lwip/include/lwip/apps/tftp_opts.h create mode 100644 lib/lwip/include/lwip/apps/tftp_server.h create mode 100644 lib/lwip/include/lwip/arch.h create mode 100644 lib/lwip/include/lwip/autoip.h create mode 100644 lib/lwip/include/lwip/debug.h create mode 100644 lib/lwip/include/lwip/def.h create mode 100644 lib/lwip/include/lwip/dhcp.h create mode 100644 lib/lwip/include/lwip/dhcp6.h create mode 100644 lib/lwip/include/lwip/dns.h create mode 100644 lib/lwip/include/lwip/err.h create mode 100644 lib/lwip/include/lwip/errno.h create mode 100644 lib/lwip/include/lwip/etharp.h create mode 100644 lib/lwip/include/lwip/ethip6.h create mode 100644 lib/lwip/include/lwip/icmp.h create mode 100644 lib/lwip/include/lwip/icmp6.h create mode 100644 lib/lwip/include/lwip/if_api.h create mode 100644 lib/lwip/include/lwip/igmp.h create mode 100644 lib/lwip/include/lwip/inet.h create mode 100644 lib/lwip/include/lwip/inet_chksum.h create mode 100644 lib/lwip/include/lwip/init.h create mode 100644 lib/lwip/include/lwip/init.h.cmake.in create mode 100644 lib/lwip/include/lwip/ip.h create mode 100644 lib/lwip/include/lwip/ip4.h create mode 100644 lib/lwip/include/lwip/ip4_addr.h create mode 100644 lib/lwip/include/lwip/ip4_frag.h create mode 100644 lib/lwip/include/lwip/ip6.h create mode 100644 lib/lwip/include/lwip/ip6_addr.h create mode 100644 lib/lwip/include/lwip/ip6_frag.h create mode 100644 lib/lwip/include/lwip/ip6_zone.h create mode 100644 lib/lwip/include/lwip/ip_addr.h create mode 100644 lib/lwip/include/lwip/mem.h create mode 100644 lib/lwip/include/lwip/memp.h create mode 100644 lib/lwip/include/lwip/mld6.h create mode 100644 lib/lwip/include/lwip/nd6.h create mode 100644 lib/lwip/include/lwip/netbuf.h create mode 100644 lib/lwip/include/lwip/netdb.h create mode 100644 lib/lwip/include/lwip/netif.h create mode 100644 lib/lwip/include/lwip/netifapi.h create mode 100644 lib/lwip/include/lwip/opt.h create mode 100644 lib/lwip/include/lwip/pbuf.h create mode 100644 lib/lwip/include/lwip/priv/altcp_priv.h create mode 100644 lib/lwip/include/lwip/priv/api_msg.h create mode 100644 lib/lwip/include/lwip/priv/mem_priv.h create mode 100644 lib/lwip/include/lwip/priv/memp_priv.h create mode 100644 lib/lwip/include/lwip/priv/memp_std.h create mode 100644 lib/lwip/include/lwip/priv/nd6_priv.h create mode 100644 lib/lwip/include/lwip/priv/raw_priv.h create mode 100644 lib/lwip/include/lwip/priv/sockets_priv.h create mode 100644 lib/lwip/include/lwip/priv/tcp_priv.h create mode 100644 lib/lwip/include/lwip/priv/tcpip_priv.h create mode 100644 lib/lwip/include/lwip/prot/acd.h create mode 100644 lib/lwip/include/lwip/prot/autoip.h create mode 100644 lib/lwip/include/lwip/prot/dhcp.h create mode 100644 lib/lwip/include/lwip/prot/dhcp6.h create mode 100644 lib/lwip/include/lwip/prot/dns.h create mode 100644 lib/lwip/include/lwip/prot/etharp.h create mode 100644 lib/lwip/include/lwip/prot/ethernet.h create mode 100644 lib/lwip/include/lwip/prot/iana.h create mode 100644 lib/lwip/include/lwip/prot/icmp.h create mode 100644 lib/lwip/include/lwip/prot/icmp6.h create mode 100644 lib/lwip/include/lwip/prot/ieee.h create mode 100644 lib/lwip/include/lwip/prot/igmp.h create mode 100644 lib/lwip/include/lwip/prot/ip.h create mode 100644 lib/lwip/include/lwip/prot/ip4.h create mode 100644 lib/lwip/include/lwip/prot/ip6.h create mode 100644 lib/lwip/include/lwip/prot/mld6.h create mode 100644 lib/lwip/include/lwip/prot/nd6.h create mode 100644 lib/lwip/include/lwip/prot/tcp.h create mode 100644 lib/lwip/include/lwip/prot/udp.h create mode 100644 lib/lwip/include/lwip/raw.h create mode 100644 lib/lwip/include/lwip/sio.h create mode 100644 lib/lwip/include/lwip/snmp.h create mode 100644 lib/lwip/include/lwip/sockets.h create mode 100644 lib/lwip/include/lwip/stats.h create mode 100644 lib/lwip/include/lwip/sys.h create mode 100644 lib/lwip/include/lwip/tcp.h create mode 100644 lib/lwip/include/lwip/tcpbase.h create mode 100644 lib/lwip/include/lwip/tcpip.h create mode 100644 lib/lwip/include/lwip/timeouts.h create mode 100644 lib/lwip/include/lwip/udp.h create mode 100644 lib/lwip/include/netif/bridgeif.h create mode 100644 lib/lwip/include/netif/bridgeif_opts.h create mode 100644 lib/lwip/include/netif/etharp.h create mode 100644 lib/lwip/include/netif/ethernet.h create mode 100644 lib/lwip/include/netif/ieee802154.h create mode 100644 lib/lwip/include/netif/lowpan6.h create mode 100644 lib/lwip/include/netif/lowpan6_ble.h create mode 100644 lib/lwip/include/netif/lowpan6_common.h create mode 100644 lib/lwip/include/netif/lowpan6_opts.h create mode 100644 lib/lwip/include/netif/ppp/ccp.h create mode 100644 lib/lwip/include/netif/ppp/chap-md5.h create mode 100644 lib/lwip/include/netif/ppp/chap-new.h create mode 100644 lib/lwip/include/netif/ppp/chap_ms.h create mode 100644 lib/lwip/include/netif/ppp/eap.h create mode 100644 lib/lwip/include/netif/ppp/ecp.h create mode 100644 lib/lwip/include/netif/ppp/eui64.h create mode 100644 lib/lwip/include/netif/ppp/fsm.h create mode 100644 lib/lwip/include/netif/ppp/ipcp.h create mode 100644 lib/lwip/include/netif/ppp/ipv6cp.h create mode 100644 lib/lwip/include/netif/ppp/lcp.h create mode 100644 lib/lwip/include/netif/ppp/magic.h create mode 100644 lib/lwip/include/netif/ppp/mppe.h create mode 100644 lib/lwip/include/netif/ppp/polarssl/arc4.h create mode 100644 lib/lwip/include/netif/ppp/polarssl/des.h create mode 100644 lib/lwip/include/netif/ppp/polarssl/md4.h create mode 100644 lib/lwip/include/netif/ppp/polarssl/md5.h create mode 100644 lib/lwip/include/netif/ppp/polarssl/sha1.h create mode 100644 lib/lwip/include/netif/ppp/ppp.h create mode 100644 lib/lwip/include/netif/ppp/ppp_impl.h create mode 100644 lib/lwip/include/netif/ppp/ppp_opts.h create mode 100644 lib/lwip/include/netif/ppp/pppapi.h create mode 100644 lib/lwip/include/netif/ppp/pppcrypt.h create mode 100644 lib/lwip/include/netif/ppp/pppdebug.h create mode 100644 lib/lwip/include/netif/ppp/pppoe.h create mode 100644 lib/lwip/include/netif/ppp/pppol2tp.h create mode 100644 lib/lwip/include/netif/ppp/pppos.h create mode 100644 lib/lwip/include/netif/ppp/upap.h create mode 100644 lib/lwip/include/netif/ppp/vj.h create mode 100644 lib/lwip/include/netif/slipif.h create mode 100644 lib/lwip/include/netif/zepif.h create mode 100644 lib/lwip/netif/ethernet.c create mode 100644 lib/lwip/u-boot/arch/cc.h create mode 100644 lib/lwip/u-boot/arch/sys_arch.h create mode 100644 lib/lwip/u-boot/limits.h create mode 100644 lib/lwip/u-boot/lwipopts.h
lib/Makefile +2 -0
@@ -94,6 +94,8 @@ obj-$(CONFIG_LIBAVB) += libavb/ obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += libfdt/ obj-$(CONFIG_$(SPL_TPL_)OF_REAL) += fdtdec_common.o fdtdec.o +obj-$(CONFIG_NET_LWIP) += lwip/ + ifdef CONFIG_SPL_BUILD obj-$(CONFIG_SPL_YMODEM_SUPPORT) += crc16-ccitt.o obj-$(CONFIG_$(SPL_TPL_)HASH) += crc16-ccitt.o
lib/lwip/Makefile new file +57 -0
57 lines not on this page · raw message
lib/lwip/README new file +6 -0
@@ -0,0 +1,6 @@ +Lightweight IP (lwIP) library + +The source code in this directory was imported from: +http://git.savannah.gnu.org/cgit/lwip.git + +Please see the commit description for details.
lib/lwip/api/api_lib.c new file +1367 -0
1,367 lines not on this page · raw message
lib/lwip/api/api_msg.c new file +2177 -0
1,562 lines not on this page · raw message
lib/lwip/api/err.c new file +115 -0
115 lines not on this page · raw message
lib/lwip/api/if_api.c new file +102 -0
102 lines not on this page · raw message
lib/lwip/api/netbuf.c new file +250 -0
250 lines not on this page · raw message
lib/lwip/api/netdb.c new file +422 -0
422 lines not on this page · raw message
lib/lwip/api/netifapi.c new file +380 -0
380 lines not on this page · raw message
lib/lwip/api/sockets.c new file +4205 -0
4,205 lines not on this page · raw message
lib/lwip/api/tcpip.c new file +706 -0
706 lines not on this page · raw message
lib/lwip/apps/http/http_client.c new file +911 -0
911 lines not on this page · raw message
lib/lwip/apps/tftp/tftp.c new file +548 -0
548 lines not on this page · raw message
lib/lwip/core/altcp.c new file +717 -0
717 lines not on this page · raw message
lib/lwip/core/altcp_alloc.c new file +87 -0
87 lines not on this page · raw message
lib/lwip/core/altcp_tcp.c new file +578 -0
578 lines not on this page · raw message
lib/lwip/core/def.c new file +263 -0
263 lines not on this page · raw message
lib/lwip/core/dns.c new file +1657 -0
1,657 lines not on this page · raw message
lib/lwip/core/inet_chksum.c new file +608 -0
608 lines not on this page · raw message
lib/lwip/core/init.c new file +387 -0
387 lines not on this page · raw message
lib/lwip/core/ip.c new file +167 -0
167 lines not on this page · raw message
lib/lwip/core/ipv4/acd.c new file +557 -0
557 lines not on this page · raw message
lib/lwip/core/ipv4/autoip.c new file +379 -0
379 lines not on this page · raw message
lib/lwip/core/ipv4/dhcp.c new file +1999 -0
1,999 lines not on this page · raw message
lib/lwip/core/ipv4/etharp.c new file +1251 -0
1,251 lines not on this page · raw message
lib/lwip/core/ipv4/icmp.c new file +407 -0
407 lines not on this page · raw message
lib/lwip/core/ipv4/igmp.c new file +801 -0
801 lines not on this page · raw message
lib/lwip/core/ipv4/ip4.c new file +1166 -0
1,166 lines not on this page · raw message
lib/lwip/core/ipv4/ip4_addr.c new file +323 -0
323 lines not on this page · raw message
lib/lwip/core/ipv4/ip4_frag.c new file +894 -0
894 lines not on this page · raw message
lib/lwip/core/ipv6/dhcp6.c new file +821 -0
821 lines not on this page · raw message
lib/lwip/core/ipv6/ethip6.c new file +123 -0
123 lines not on this page · raw message
lib/lwip/core/ipv6/icmp6.c new file +425 -0
425 lines not on this page · raw message
lib/lwip/core/ipv6/inet6.c new file +53 -0
53 lines not on this page · raw message
lib/lwip/core/ipv6/ip6.c new file +1494 -0
1,494 lines not on this page · raw message
lib/lwip/core/ipv6/ip6_addr.c new file +355 -0
355 lines not on this page · raw message
lib/lwip/core/ipv6/ip6_frag.c new file +862 -0
862 lines not on this page · raw message
lib/lwip/core/ipv6/mld6.c new file +626 -0
626 lines not on this page · raw message
lib/lwip/core/ipv6/nd6.c new file +2474 -0
2,474 lines not on this page · raw message
lib/lwip/core/mem.c new file +1017 -0
1,017 lines not on this page · raw message
lib/lwip/core/memp.c new file +447 -0
447 lines not on this page · raw message
lib/lwip/core/netif.c new file +1855 -0
1,855 lines not on this page · raw message
lib/lwip/core/pbuf.c new file +1545 -0
1,545 lines not on this page · raw message
lib/lwip/core/raw.c new file +673 -0
673 lines not on this page · raw message
lib/lwip/core/stats.c new file +168 -0
168 lines not on this page · raw message
lib/lwip/core/sys.c new file +148 -0
148 lines not on this page · raw message
lib/lwip/core/tcp.c new file +2696 -0
2,696 lines not on this page · raw message
lib/lwip/core/tcp_in.c new file +2184 -0
2,184 lines not on this page · raw message
lib/lwip/core/tcp_out.c new file +2257 -0
2,257 lines not on this page · raw message
lib/lwip/core/timeouts.c new file +451 -0
451 lines not on this page · raw message
lib/lwip/core/udp.c new file +1321 -0
1,321 lines not on this page · raw message
lib/lwip/include/compat/posix/arpa/inet.h new file +33 -0
Lines of this file are not shown. View the raw message.
lib/lwip/include/compat/posix/net/if.h new file +36 -0
Lines of this file are not shown. View the raw message.
lib/lwip/include/compat/posix/netdb.h new file +33 -0
Lines of this file are not shown. View the raw message.
lib/lwip/include/compat/posix/sys/socket.h new file +33 -0
Lines of this file are not shown. View the raw message.
lib/lwip/include/compat/stdc/errno.h new file +33 -0
Lines of this file are not shown. View the raw message.
lib/lwip/include/lwip/acd.h new file +109 -0
109 lines not on this page · raw message
lib/lwip/include/lwip/altcp.h new file +207 -0
207 lines not on this page · raw message
lib/lwip/include/lwip/altcp_tcp.h new file +72 -0
72 lines not on this page · raw message
lib/lwip/include/lwip/altcp_tls.h new file +196 -0
196 lines not on this page · raw message
lib/lwip/include/lwip/api.h new file +434 -0
434 lines not on this page · raw message
lib/lwip/include/lwip/apps/FILES new file +2 -0
Lines of this file are not shown. View the raw message.
lib/lwip/include/lwip/apps/altcp_proxyconnect.h new file +79 -0
79 lines not on this page · raw message
lib/lwip/include/lwip/apps/altcp_tls_mbedtls_opts.h new file +111 -0
111 lines not on this page · raw message
lib/lwip/include/lwip/apps/fs.h new file +139 -0
139 lines not on this page · raw message
lib/lwip/include/lwip/apps/http_client.h new file +160 -0
160 lines not on this page · raw message
lib/lwip/include/lwip/apps/httpd.h new file +256 -0
256 lines not on this page · raw message
lib/lwip/include/lwip/apps/httpd_opts.h new file +416 -0
416 lines not on this page · raw message
lib/lwip/include/lwip/apps/lwiperf.h new file +109 -0
109 lines not on this page · raw message
lib/lwip/include/lwip/apps/mdns.h new file +154 -0
154 lines not on this page · raw message
lib/lwip/include/lwip/apps/mdns_domain.h new file +80 -0
80 lines not on this page · raw message
lib/lwip/include/lwip/apps/mdns_opts.h new file +121 -0
121 lines not on this page · raw message
lib/lwip/include/lwip/apps/mdns_out.h new file +138 -0
138 lines not on this page · raw message
lib/lwip/include/lwip/apps/mdns_priv.h new file +237 -0
237 lines not on this page · raw message
lib/lwip/include/lwip/apps/mqtt.h new file +205 -0
205 lines not on this page · raw message
lib/lwip/include/lwip/apps/mqtt_opts.h new file +103 -0
103 lines not on this page · raw message
lib/lwip/include/lwip/apps/mqtt_priv.h new file +104 -0
104 lines not on this page · raw message
lib/lwip/include/lwip/apps/netbiosns.h new file +51 -0
51 lines not on this page · raw message
lib/lwip/include/lwip/apps/netbiosns_opts.h new file +66 -0
66 lines not on this page · raw message
lib/lwip/include/lwip/apps/smtp.h new file +128 -0
128 lines not on this page · raw message
lib/lwip/include/lwip/apps/smtp_opts.h new file +80 -0
80 lines not on this page · raw message
lib/lwip/include/lwip/apps/snmp.h new file +145 -0
145 lines not on this page · raw message
lib/lwip/include/lwip/apps/snmp_core.h new file +377 -0
377 lines not on this page · raw message
lib/lwip/include/lwip/apps/snmp_mib2.h new file +78 -0
78 lines not on this page · raw message
lib/lwip/include/lwip/apps/snmp_opts.h new file +297 -0
297 lines not on this page · raw message
lib/lwip/include/lwip/apps/snmp_scalar.h new file +113 -0
113 lines not on this page · raw message
lib/lwip/include/lwip/apps/snmp_snmpv2_framework.h new file +32 -0
Lines of this file are not shown. View the raw message.
lib/lwip/include/lwip/apps/snmp_snmpv2_usm.h new file +24 -0
Lines of this file are not shown. View the raw message.
lib/lwip/include/lwip/apps/snmp_table.h new file +134 -0
134 lines not on this page · raw message
lib/lwip/include/lwip/apps/snmp_threadsync.h new file +114 -0
114 lines not on this page · raw message
lib/lwip/include/lwip/apps/snmpv3.h new file +114 -0
114 lines not on this page · raw message
lib/lwip/include/lwip/apps/sntp.h new file +81 -0
81 lines not on this page · raw message
lib/lwip/include/lwip/apps/sntp_opts.h new file +215 -0
215 lines not on this page · raw message
lib/lwip/include/lwip/apps/tftp_client.h new file +50 -0
50 lines not on this page · raw message
lib/lwip/include/lwip/apps/tftp_common.h new file +108 -0
108 lines not on this page · raw message
lib/lwip/include/lwip/apps/tftp_opts.h new file +106 -0
106 lines not on this page · raw message
lib/lwip/include/lwip/apps/tftp_server.h new file +42 -0
42 lines not on this page · raw message
lib/lwip/include/lwip/arch.h new file +402 -0
402 lines not on this page · raw message
lib/lwip/include/lwip/autoip.h new file +90 -0
90 lines not on this page · raw message
lib/lwip/include/lwip/debug.h new file +161 -0
161 lines not on this page · raw message
lib/lwip/include/lwip/def.h new file +156 -0
156 lines not on this page · raw message
lib/lwip/include/lwip/dhcp.h new file +155 -0
155 lines not on this page · raw message
lib/lwip/include/lwip/dhcp6.h new file +104 -0
104 lines not on this page · raw message
lib/lwip/include/lwip/dns.h new file +131 -0
131 lines not on this page · raw message
lib/lwip/include/lwip/err.h new file +117 -0
117 lines not on this page · raw message
lib/lwip/include/lwip/errno.h new file +198 -0
198 lines not on this page · raw message
lib/lwip/include/lwip/etharp.h new file +110 -0
110 lines not on this page · raw message
lib/lwip/include/lwip/ethip6.h new file +68 -0
68 lines not on this page · raw message
lib/lwip/include/lwip/icmp.h new file +110 -0
110 lines not on this page · raw message
lib/lwip/include/lwip/icmp6.h new file +72 -0
72 lines not on this page · raw message
lib/lwip/include/lwip/if_api.h new file +70 -0
70 lines not on this page · raw message
lib/lwip/include/lwip/igmp.h new file +115 -0
115 lines not on this page · raw message
lib/lwip/include/lwip/inet.h new file +188 -0
188 lines not on this page · raw message
lib/lwip/include/lwip/inet_chksum.h new file +104 -0
104 lines not on this page · raw message
lib/lwip/include/lwip/init.h new file +100 -0
100 lines not on this page · raw message
lib/lwip/include/lwip/init.h.cmake.in new file +100 -0
100 lines not on this page · raw message
lib/lwip/include/lwip/ip.h new file +339 -0
339 lines not on this page · raw message
lib/lwip/include/lwip/ip4.h new file +109 -0
109 lines not on this page · raw message
lib/lwip/include/lwip/ip4_addr.h new file +225 -0
225 lines not on this page · raw message
lib/lwip/include/lwip/ip4_frag.h new file +100 -0
100 lines not on this page · raw message
lib/lwip/include/lwip/ip6.h new file +93 -0
93 lines not on this page · raw message
lib/lwip/include/lwip/ip6_addr.h new file +372 -0
372 lines not on this page · raw message
lib/lwip/include/lwip/ip6_frag.h new file +144 -0
144 lines not on this page · raw message
lib/lwip/include/lwip/ip6_zone.h new file +306 -0
306 lines not on this page · raw message
lib/lwip/include/lwip/ip_addr.h new file +468 -0
468 lines not on this page · raw message
lib/lwip/include/lwip/mem.h new file +82 -0
82 lines not on this page · raw message
lib/lwip/include/lwip/memp.h new file +155 -0
155 lines not on this page · raw message
lib/lwip/include/lwip/mld6.h new file +99 -0
99 lines not on this page · raw message
lib/lwip/include/lwip/nd6.h new file +90 -0
90 lines not on this page · raw message
lib/lwip/include/lwip/netbuf.h new file +116 -0
116 lines not on this page · raw message
lib/lwip/include/lwip/netdb.h new file +150 -0
150 lines not on this page · raw message
lib/lwip/include/lwip/netif.h new file +698 -0
698 lines not on this page · raw message
lib/lwip/include/lwip/netifapi.h new file +161 -0
161 lines not on this page · raw message
lib/lwip/include/lwip/opt.h new file +3595 -0
3,595 lines not on this page · raw message
lib/lwip/include/lwip/pbuf.h new file +326 -0
326 lines not on this page · raw message
lib/lwip/include/lwip/priv/altcp_priv.h new file +159 -0
159 lines not on this page · raw message
lib/lwip/include/lwip/priv/api_msg.h new file +272 -0
272 lines not on this page · raw message
lib/lwip/include/lwip/priv/mem_priv.h new file +84 -0
84 lines not on this page · raw message
lib/lwip/include/lwip/priv/memp_priv.h new file +161 -0
161 lines not on this page · raw message
lib/lwip/include/lwip/priv/memp_std.h new file +153 -0
153 lines not on this page · raw message
lib/lwip/include/lwip/priv/nd6_priv.h new file +143 -0
143 lines not on this page · raw message
lib/lwip/include/lwip/priv/raw_priv.h new file +69 -0
69 lines not on this page · raw message
lib/lwip/include/lwip/priv/sockets_priv.h new file +175 -0
175 lines not on this page · raw message
lib/lwip/include/lwip/priv/tcp_priv.h new file +523 -0
523 lines not on this page · raw message
lib/lwip/include/lwip/priv/tcpip_priv.h new file +176 -0
176 lines not on this page · raw message
lib/lwip/include/lwip/prot/acd.h new file +91 -0
91 lines not on this page · raw message
lib/lwip/include/lwip/prot/autoip.h new file +65 -0
65 lines not on this page · raw message
lib/lwip/include/lwip/prot/dhcp.h new file +178 -0
178 lines not on this page · raw message
lib/lwip/include/lwip/prot/dhcp6.h new file +138 -0
138 lines not on this page · raw message
lib/lwip/include/lwip/prot/dns.h new file +140 -0
140 lines not on this page · raw message
lib/lwip/include/lwip/prot/etharp.h new file +114 -0
114 lines not on this page · raw message
lib/lwip/include/lwip/prot/ethernet.h new file +127 -0
127 lines not on this page · raw message
lib/lwip/include/lwip/prot/iana.h new file +97 -0
97 lines not on this page · raw message
lib/lwip/include/lwip/prot/icmp.h new file +105 -0
105 lines not on this page · raw message
lib/lwip/include/lwip/prot/icmp6.h new file +172 -0
172 lines not on this page · raw message
lib/lwip/include/lwip/prot/ieee.h new file +91 -0
91 lines not on this page · raw message
lib/lwip/include/lwip/prot/igmp.h new file +90 -0
90 lines not on this page · raw message
lib/lwip/include/lwip/prot/ip.h new file +59 -0
59 lines not on this page · raw message
lib/lwip/include/lwip/prot/ip4.h new file +131 -0
131 lines not on this page · raw message
lib/lwip/include/lwip/prot/ip6.h new file +235 -0
235 lines not on this page · raw message
lib/lwip/include/lwip/prot/mld6.h new file +71 -0
71 lines not on this page · raw message
lib/lwip/include/lwip/prot/nd6.h new file +274 -0
274 lines not on this page · raw message
lib/lwip/include/lwip/prot/tcp.h new file +100 -0
100 lines not on this page · raw message
lib/lwip/include/lwip/prot/udp.h new file +68 -0
68 lines not on this page · raw message
lib/lwip/include/lwip/raw.h new file +143 -0
143 lines not on this page · raw message
lib/lwip/include/lwip/sio.h new file +142 -0
142 lines not on this page · raw message
lib/lwip/include/lwip/snmp.h new file +213 -0
213 lines not on this page · raw message
lib/lwip/include/lwip/sockets.h new file +707 -0
707 lines not on this page · raw message
lib/lwip/include/lwip/stats.h new file +491 -0
491 lines not on this page · raw message
lib/lwip/include/lwip/sys.h new file +575 -0
575 lines not on this page · raw message
lib/lwip/include/lwip/tcp.h new file +500 -0
500 lines not on this page · raw message
lib/lwip/include/lwip/tcpbase.h new file +88 -0
88 lines not on this page · raw message
lib/lwip/include/lwip/tcpip.h new file +114 -0
114 lines not on this page · raw message
lib/lwip/include/lwip/timeouts.h new file +128 -0
128 lines not on this page · raw message
lib/lwip/include/lwip/udp.h new file +195 -0
195 lines not on this page · raw message
lib/lwip/include/netif/bridgeif.h new file +127 -0
127 lines not on this page · raw message
lib/lwip/include/netif/bridgeif_opts.h new file +90 -0
90 lines not on this page · raw message
lib/lwip/include/netif/etharp.h new file +3 -0
Lines of this file are not shown. View the raw message.
lib/lwip/include/netif/ethernet.h new file +77 -0
77 lines not on this page · raw message
lib/lwip/include/netif/ieee802154.h new file +112 -0
112 lines not on this page · raw message
lib/lwip/include/netif/lowpan6.h new file +89 -0
89 lines not on this page · raw message
lib/lwip/include/netif/lowpan6_ble.h new file +78 -0
78 lines not on this page · raw message
lib/lwip/include/netif/lowpan6_common.h new file +82 -0
82 lines not on this page · raw message
lib/lwip/include/netif/lowpan6_opts.h new file +122 -0
122 lines not on this page · raw message
lib/lwip/include/netif/ppp/ccp.h new file +164 -0
164 lines not on this page · raw message
lib/lwip/include/netif/ppp/chap-md5.h new file +36 -0
Lines of this file are not shown. View the raw message.
lib/lwip/include/netif/ppp/chap-new.h new file +200 -0
200 lines not on this page · raw message
lib/lwip/include/netif/ppp/chap_ms.h new file +44 -0
44 lines not on this page · raw message
lib/lwip/include/netif/ppp/eap.h new file +169 -0
169 lines not on this page · raw message
lib/lwip/include/netif/ppp/ecp.h new file +62 -0
62 lines not on this page · raw message
lib/lwip/include/netif/ppp/eui64.h new file +102 -0
102 lines not on this page · raw message
lib/lwip/include/netif/ppp/fsm.h new file +182 -0
182 lines not on this page · raw message
lib/lwip/include/netif/ppp/ipcp.h new file +134 -0
134 lines not on this page · raw message
lib/lwip/include/netif/ppp/ipv6cp.h new file +191 -0
191 lines not on this page · raw message
lib/lwip/include/netif/ppp/lcp.h new file +179 -0
179 lines not on this page · raw message
lib/lwip/include/netif/ppp/magic.h new file +130 -0
130 lines not on this page · raw message
lib/lwip/include/netif/ppp/mppe.h new file +181 -0
181 lines not on this page · raw message
lib/lwip/include/netif/ppp/polarssl/arc4.h new file +81 -0
81 lines not on this page · raw message
lib/lwip/include/netif/ppp/polarssl/des.h new file +92 -0
92 lines not on this page · raw message
lib/lwip/include/netif/ppp/polarssl/md4.h new file +97 -0
97 lines not on this page · raw message
lib/lwip/include/netif/ppp/polarssl/md5.h new file +96 -0
96 lines not on this page · raw message
lib/lwip/include/netif/ppp/polarssl/sha1.h new file +96 -0
96 lines not on this page · raw message
lib/lwip/include/netif/ppp/ppp.h new file +698 -0
698 lines not on this page · raw message
lib/lwip/include/netif/ppp/ppp_impl.h new file +736 -0
736 lines not on this page · raw message
lib/lwip/include/netif/ppp/ppp_opts.h new file +610 -0
610 lines not on this page · raw message
lib/lwip/include/netif/ppp/pppapi.h new file +137 -0
137 lines not on this page · raw message
lib/lwip/include/netif/ppp/pppcrypt.h new file +144 -0
144 lines not on this page · raw message
lib/lwip/include/netif/ppp/pppdebug.h new file +88 -0
88 lines not on this page · raw message
lib/lwip/include/netif/ppp/pppoe.h new file +187 -0
187 lines not on this page · raw message
lib/lwip/include/netif/ppp/pppol2tp.h new file +209 -0
209 lines not on this page · raw message
lib/lwip/include/netif/ppp/pppos.h new file +125 -0
125 lines not on this page · raw message
lib/lwip/include/netif/ppp/upap.h new file +131 -0
131 lines not on this page · raw message
lib/lwip/include/netif/ppp/vj.h new file +169 -0
169 lines not on this page · raw message
lib/lwip/include/netif/slipif.h new file +86 -0
86 lines not on this page · raw message
lib/lwip/include/netif/zepif.h new file +81 -0
81 lines not on this page · raw message
lib/lwip/netif/ethernet.c new file +329 -0
329 lines not on this page · raw message
lib/lwip/u-boot/arch/cc.h new file +43 -0
43 lines not on this page · raw message
lib/lwip/u-boot/arch/sys_arch.h new file +0 -0
lib/lwip/u-boot/limits.h new file +0 -0
lib/lwip/u-boot/lwipopts.h new file +197 -0
197 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.40.1
Part of the diff is not shown here. View the raw message.
PATCH 3/15 net-lwip: add DHCP support and dhcp commmand
In reply to a message not in the archiveAdd what it takes to enable CONFIG_NETDEVICES with CONFIG_NET_LWIP and enable DHCP as well as the dhcp command (CONFIG_CMD_DHCP_LWIP).
- net-lwip/net-lwip.c is mostly empty for now. It will provide functions similar to net/net.c except based on the lwIP stack
- include/net-lwip.h is a replacement for include/net.h which is unused when CONFIG_NET_LWIP is enabled. Declarations from the latter will be transferred to the former as needed when new network commands are ported on top of lwIP.
- CONFIG_CMD_TFTPBOOT_LWIP is introduced due to CONFIG_BOOTMETH_EFI having an implicit dependency on do_tftpb().
--- Makefile | 1 + boot/Kconfig | 2 + boot/bootmeth_efi.c | 3 +- cmd/Kconfig | 26 ++++ cmd/Makefile | 4 + cmd/net-lwip.c | 13 ++ common/board_r.c | 4 +- drivers/dfu/Kconfig | 2 +- drivers/net/Kconfig | 2 +- include/config_distro_bootcmd.h | 2 +- include/net-lwip.h | 85 ++++++++++++ include/net.h | 2 +- net-lwip/Kconfig | 12 +- net-lwip/Makefile | 15 +++ net-lwip/dhcp.c | 105 +++++++++++++++ net-lwip/eth_internal.h | 35 +++++ net-lwip/net-lwip.c | 224 ++++++++++++++++++++++++++++++++ net-lwip/tftp.c | 11 ++ net/eth_bootdev.c | 2 +- 19 files changed, 540 insertions(+), 10 deletions(-) create mode 100644 cmd/net-lwip.c create mode 100644 include/net-lwip.h create mode 100644 net-lwip/Makefile create mode 100644 net-lwip/dhcp.c create mode 100644 net-lwip/eth_internal.h create mode 100644 net-lwip/net-lwip.c create mode 100644 net-lwip/tftp.c
Makefile +1 -0
@@ -860,6 +860,7 @@ libs-y += env/ libs-y += lib/ libs-y += fs/ libs-$(CONFIG_NET) += net/ +libs-$(CONFIG_NET_LWIP) += net-lwip/ libs-y += disk/ libs-y += drivers/ libs-$(CONFIG_SYS_FSL_DDR) += drivers/ddr/fsl/
boot/Kconfig +2 -0
@@ -381,6 +381,7 @@ config BOOT_DEFAULTS_CMDS select CMD_DHCP if CMD_NET select CMD_PING if CMD_NET select CMD_PXE if CMD_NET + select CMD_DHCP_LWIP if CMD_NET_LWIP select CMD_BOOTI if ARM64 select CMD_BOOTZ if ARM && !ARM64 imply CMD_MII if NET
@@ -540,6 +541,7 @@ config BOOTMETH_EXTLINUX_PXE config BOOTMETH_EFILOADER bool "Bootdev support for EFI boot" depends on EFI_BINARY_EXEC + select CMD_TFTPBOOT_LWIP if CMD_NET_LWIP default y help Enables support for EFI boot using bootdevs. This makes the
boot/bootmeth_efi.c +2 -1
@@ -70,7 +70,8 @@ static bool bootmeth_uses_network(struct bootflow *bflow) {const struct udevice *media =dev_get_parent (bflow->dev); -return IS_ENABLED (CONFIG_CMD_DHCP ) && +return (IS_ENABLED (CONFIG_CMD_DHCP ) || +IS_ENABLED (CONFIG_CMD_DHCP_LWIP )) &&device_get_uclass_id (media) ==UCLASS_ETH ; }
cmd/Kconfig +26 -0
@@ -2084,6 +2084,32 @@ config CMD_WOL endif +if NET_LWIP + +menuconfig CMD_NET_LWIP + bool "Network commands (lwIP)" + default y + +if CMD_NET_LWIP + +config CMD_DHCP_LWIP + bool "dhcp" + select PROT_DHCP_LWIP + help + Boot image via network using DHCP/TFTP protocol + +config CMD_TFTPBOOT_LWIP + bool "tftp" + select PROT_UDP_LWIP + default n + help + tftpboot - load file via network using TFTP protocol + Currently a placeholder (not implemented) + +endif + +endif + menu "Misc commands" config CMD_2048
cmd/Makefile +4 -0
@@ -128,6 +128,10 @@ endif obj-$(CONFIG_CMD_MUX) += mux.o obj-$(CONFIG_CMD_NAND) += nand.o obj-$(CONFIG_CMD_NET) += net.o +obj-$(CONFIG_CMD_NET_LWIP) += net-lwip.o +ifdef CONFIG_CMD_NET_LWIP +CFLAGS_net-lwip.o := -I$(srctree)/lib/lwip/include -I$(srctree)/lib/lwip/u-boot +endif obj-$(CONFIG_ENV_SUPPORT) += nvedit.o obj-$(CONFIG_CMD_NVEDIT_EFI) += nvedit_efi.o obj-$(CONFIG_CMD_ONENAND) += onenand.o
cmd/net-lwip.c new file +13 -0
@@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* Copyright (C) 2024 Linaro Ltd. */ + +#include <command.h> +#include <net-lwip.h> + +#if defined(CONFIG_CMD_DHCP_LWIP ) +U_BOOT_CMD ( + dhcp,3 ,1 , do_dhcp, +"boot image via network using DHCP/TFTP protocol" , +"[loadAddress] [[hostIPaddr:]bootfilename]" +); +#endif
common/board_r.c +2 -2
@@ -472,7 +472,7 @@ static int initr_status_led(void) }#endif -#ifdef CONFIG_CMD_NET +#if defined(CONFIG_CMD_NET ) || defined(CONFIG_CMD_NET_LWIP )static int initr_net (void ) {puts ("Net: " );
@@ -727,7 +727,7 @@ static init_fnc_t init_sequence_r[] = {#ifdef CONFIG_PCI_ENDPOINT pci_ep_init,#endif -#ifdef CONFIG_CMD_NET +#if defined(CONFIG_CMD_NET ) || defined(CONFIG_CMD_NET_LWIP ) INIT_FUNC_WATCHDOG_RESET initr_net,#endif
drivers/dfu/Kconfig +1 -1
@@ -19,7 +19,7 @@ config DFU_WRITE_ALT config DFU_TFTP bool "DFU via TFTP" - depends on NETDEVICES + depends on NETDEVICES && !NET_LWIP select UPDATE_COMMON select DFU_OVER_TFTP help
drivers/net/Kconfig +1 -1
@@ -96,7 +96,7 @@ config DSA_SANDBOX menuconfig NETDEVICES bool "Network device support" - depends on NET + depends on NET || NET_LWIP select DM_ETH help You must select Y to enable any network device support
include/config_distro_bootcmd.h +1 -1
@@ -345,7 +345,7 @@ BOOT_TARGET_DEVICES_references_VIRTIO_without_CONFIG_CMD_VIRTIO#endif -#if defined(CONFIG_CMD_DHCP ) +#if defined(CONFIG_CMD_DHCP ) || defined(CONFIG_CMD_DHCP_LWIP )#if defined(CONFIG_EFI_LOADER )/* http://www.iana.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml */ #if defined(CONFIG_ARM64 ) || defined(__aarch64__)
include/net-lwip.h new file +85 -0
85 lines not on this page · raw message
include/net.h +1 -1
@@ -914,7 +914,7 @@ static inline struct in_addr env_get_ip(char *var)*/ void reset_phy (void ); -#if CONFIG_IS_ENABLED (NET ) +#if CONFIG_IS_ENABLED (NET ) ||CONFIG_IS_ENABLED (NET_LWIP )/** * eth_set_enable_bootdevs() - Enable or disable binding of Ethernet bootdevs *
net-lwip/Kconfig +10 -2
@@ -4,6 +4,7 @@ menuconfig NET_LWIP bool "Networking support (lwIP stack) -- EXPERIMENTAL" + imply NETDEVICES help Include networking support based on the lwIP (lightweight IP) TCP/IP stack (https://nongnu.org/lwip). This is a replacement for
@@ -12,8 +13,6 @@ menuconfig NET_LWIP 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 currently only builds the lwIP library but does not add - any functionality to U-Boot. if NET_LWIP
@@ -50,4 +49,13 @@ config PROT_UDP_LWIP help Enable support for the User Datagram Protocol in lwIP. +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. + endif
net-lwip/Makefile new file +15 -0
@@ -0,0 +1,15 @@ +ccflags-y += -I$(srctree)/lib/lwip/include -I$(srctree)/lib/lwip/u-boot + +obj-$(CONFIG_$(SPL_TPL_)BOOTDEV_ETH) += ../net/eth_bootdev.o +obj-$(CONFIG_DM_MDIO) += ../net/mdio-uclass.o +obj-$(CONFIG_DM_MDIO_MUX) += ../net/mdio-mux-uclass.o +obj-$(CONFIG_$(SPL_)DM_ETH) += ../net/eth_common.o +obj-$(CONFIG_$(SPL_)DM_ETH) += ../net/eth-uclass.o +obj-$(CONFIG_$(SPL_)DM_ETH) += net-lwip.o +obj-$(CONFIG_CMD_DHCP_LWIP) += dhcp.o +obj-$(CONFIG_CMD_TFTPBOOT_LWIP) += tftp.o + +# Disable this warning as it is triggered by: +# sprintf(buf, index ? "foo%d" : "foo", index) +# and this is intentional usage. +CFLAGS_eth_common.o += -Wno-format-extra-args
net-lwip/dhcp.c new file +105 -0
105 lines not on this page · raw message
net-lwip/eth_internal.h new file +35 -0
@@ -0,0 +1,35 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* (C) Copyright 2001-2015 +* Wolfgang Denk, DENX Software Engineering, [email protected]. +* Joe Hershberger, National Instruments +*/ + +#ifndef __ETH_INTERNAL_H +#define __ETH_INTERNAL_H + +/* Do init that is common to driver model and legacy networking */ +void eth_common_init (void ); + +/** +* eth_env_set_enetaddr_by_index() - set the MAC address environment variable +* +* This sets up an environment variable with the given MAC address (@enetaddr). +* The environment variable to be set is defined by <@base_name><@index>addr. +* If @index is 0 it is omitted. For common Ethernet this means ethaddr, +* eth1addr, etc. +* +* @base_name: Base name for variable, typically "eth" +* @index: Index of interface being updated (>=0) +* @enetaddr: Pointer to MAC address to put into the variable +* Return: 0 if OK, other value on error +*/ +int eth_env_set_enetaddr_by_index (const char *base_name,int index, +uchar *enetaddr); + +int eth_mac_skip (int index); +void eth_current_changed (void ); +void eth_set_dev (struct udevice *dev); +void eth_set_current_to_next (void ); + +#endif
net-lwip/net-lwip.c new file +224 -0
224 lines not on this page · raw message
net-lwip/tftp.c new file +11 -0
@@ -0,0 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* Copyright (C) 2024 Linaro Ltd. */ + +#include <command.h> +#include <net-lwip.h> + +int do_tftpb (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) +{ +/* Not implemented */ +return CMD_RET_FAILURE ; +}
net/eth_bootdev.c +1 -1
@@ -85,7 +85,7 @@ static int eth_bootdev_hunt(struct bootdev_hunter *info, bool show)* enumerated already. If something like 'bootflow scan dhcp' is used * then the user will need to run 'usb start' first. */ -if (IS_ENABLED (CONFIG_CMD_DHCP )) { +if (IS_ENABLED (CONFIG_CMD_DHCP ) ||IS_ENABLED (CONFIG_CMD_DHCP_LWIP )) { ret =dhcp_run (0 ,NULL , false);if (ret)return -EINVAL ;
Signature · 1 line
2.40.1
Re: [PATCH 10/15] test: dm: dsa, eth: disable tests when CONFIG_NET_LWIP=y
In reply to Jerome ForissierHi Jerome,
Quoted 6 lines · Jerome Forissier
Some sandbox tests make strong assumptions on how the network stack is implemented. For example, the ping tests assume that ARP resolution occurs upon sending out the ICMP packet. This is not always the case with the lwIP stack which can cache ARP information. Therefore, disable these tests when
CONFIG_NET_LWIPis enabled.
Is the ARP Caching the only issue?
U-Boot isn't supposed to use the network stack that much, so it might be a better idea to disable arp-caching in LWIP (assuming it's doable). We might even get a few size of bytes back
Cheers
/Ilias
Quoted 63 lines
Signed-off-by Jerome Forissier <[email protected]>--- test/dm/dsa.c | 2 ++ test/dm/eth.c | 4 ++++ 2 files changed, 6 insertions(+)test/dm/dsa.c +2
-0@@ -59,6 +59,7 @@ static int dm_test_dsa_probe(struct unit_test_state *uts)DM_TEST (dm_test_dsa_probe,UT_TESTF_SCAN_FDT ); +#if !defined(CONFIG_NET_LWIP )/* This test sends ping requests with the local address through each DSA port * via the sandbox DSA master Eth. */ @@ -80,3 +81,4 @@ static int dm_test_dsa(struct unit_test_state *uts) }DM_TEST (dm_test_dsa,UT_TESTF_SCAN_FDT ); +#endif /* !defined(CONFIG_NET_LWIP) */ test/dm/eth.c +4
-1@@ -170,6 +170,7 @@ static int dm_test_ip6_make_lladdr(struct unit_test_state *uts)DM_TEST (dm_test_ip6_make_lladdr,UT_TESTF_SCAN_FDT );#endif +#if !defined(CONFIG_NET_LWIP )static int dm_test_eth (struct unit_test_state *uts) { net_ping_ip =string_to_ip ("1.1.2.2" );@@ -298,6 +299,7 @@ static int dm_test_eth_act(struct unit_test_state *uts) return 0; }DM_TEST (dm_test_eth_act,UT_TESTF_SCAN_FDT ); +#endif /* !CONFIG_NET_LWIP */ /* Ensure that all addresses are loaded properly */ static int dm_test_ethaddr (struct unit_test_state *uts)@@ -332,6 +334,7 @@ static int dm_test_ethaddr(struct unit_test_state *uts) }DM_TEST (dm_test_ethaddr,UT_TESTF_SCAN_FDT ); +#if !defined(CONFIG_NET_LWIP )/* The asserts include a return on fail; cleanup in the caller */ static int _dm_test_eth_rotate1 (struct unit_test_state *uts) {@@ -616,6 +619,7 @@ static int dm_test_eth_async_ping_reply(struct unit_test_state *uts) }DM_TEST (dm_test_eth_async_ping_reply,UT_TESTF_SCAN_FDT ); +#endif /* !CONFIG_NET_LWIP */ #if IS_ENABLED (CONFIG_IPV6_ROUTER_DISCOVERY ) --2.40.1
Re: [PATCH 09/15] net-lwip: add support for EFI_HTTP_BOOT
In reply to Jerome ForissierHi Jerome,
Quoted 39 lines · Jerome Forissier
Implement the
wget_with_dns()function which is needed byCONFIG_EFI_HTTP_BOOT=y. Note that there is no dependency added onCONFIG_CMD_DNS_LWIPbecauseCONFIG_CMD_WGET_LWIPnatively supports hostname resolution.Signed-off-by Jerome Forissier <[email protected]>--- lib/efi_loader/Kconfig | 5 +++-- net-lwip/wget.c | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-)lib/efi_loader/Kconfig +3
-2@@ -505,8 +505,9 @@ config EFI_RISCV_BOOT_PROTOCOL config EFI_HTTP_BOOT bool "EFI HTTP Boot support" - select CMD_DNS - select CMD_WGET + select CMD_DNS if NET + select CMD_WGET if NET + select CMD_WGET_LWIP if NET_LWIP select BLKMAP help Enabling this option adds EFI HTTP Boot support. It allows tonet-lwip/wget.c +3
-0@@ -166,3 +166,19 @@ int do_wget(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])return CMD_RET_FAILURE ; } + +#if defined(CONFIG_EFI_HTTP_BOOT ) +int wget_with_dns (ulong dst_addr,char *uri)
net-lwip/wget.c int do_wget(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]) · line 181
Quoted 10 lines
net-lwip/wget.c +10
-0+{ +char addr_str[11 ]; +struct cmd_tbl cmdtp = {}; +char *argv[] = {"wget" , addr_str, uri }; + +snprintf (addr_str,sizeof (addr_str),"0x%lx" , dst_addr); + +if (do_wget (&cmdtp,0 ,ARRAY_SIZE (argv), argv) ==CMD_RET_SUCCESS ) +return 0 ; +
Calling a command directly feels a bit weird.
Can we do this instead:
- Split do_wget in patch #7 and carve out 2 functions. The first will prepare the arguments and the second will call httpc_get_file_dns() and run the loop
- Once that's split you can use the newly split function here and avoid calling a command
Thanks
/Ilias
Quoted 6 lines
net-lwip/wget.c +3
-1+ return -1; +} +#endif --2.40.1
Re: [PATCH 14/15] MAINTAINERS: net-lwip: add myself as a maintainer
In reply to Jerome ForissierQuoted 34 lines · Jerome Forissier
Add myself as a maintainer for the lwIP network stack integration code and network commands. The library code itself (i.e., most files under
lib/lwip/except README,Makefileand integration files in u-boot) is unmodified from upstream and therefore does not need a maintainer.Signed-off-by Jerome Forissier <[email protected]>--- MAINTAINERS | 11 +++++++++++ 1 file changed, 11 insertions(+)MAINTAINERS +11
-1@@ -1311,6 +1311,17 @@ F: drivers/net/ F: include/net.h F: net/ +NETWORK (LWIP) +M: Jerome Forissier <[email protected]> +S: Maintained +F: cmd/net-lwip.c +F: configs/qemu_arm64_lwip_defconfig +F: include/net-lwip.h +F: lib/lwip/Makefile +F: lib/lwip/README +F: lib/lwip/u-boot/ +F: net-lwip/ + NIOS M: Thomas Chou <[email protected]> S: Maintained --
Quoted 2 lines
2.40.1
Re: [PATCH 10/15] test: dm: dsa, eth: disable tests when CONFIG_NET_LWIP=y
In reply to Ilias ApalodimasQuoted 5 lines · Ilias Apalodimas
Hi Jerome,
Quoted 1 line · Jerome Forissier
Quoted 7 lines
Quoted 5 lines
Some sandbox tests make strong assumptions on how the network stack is implemented. For example, the ping tests assume that ARP resolution occurs upon sending out the ICMP packet. This is not always the case with the lwIP stack which can cache ARP information. Therefore, disable these tests when
CONFIG_NET_LWIPis enabled.Is the ARP Caching the only issue?
No, but I don't recall exactly what was wrong in addition to that.
Quoted 3 lines
U-Boot isn't supposed to use the network stack that much, so it might be a better idea to disable arp-caching in LWIP (assuming it's doable). We might even get a few size of bytes back
If ARP_TABLE_SIZE is 0, there is no caching but in addition to that the lwIP stack does not work well. For example when requested to send an ICMP packet to an unknown IP (unknown as in "not yet resolved at the ethernet level" i.e., ARP) and assuming ARP_TABLE_SIZE is 1, it will automatically do the ARP request/response then proceed with ICMP send. However if ARP_TABLE_SIZE is 0, only the ARP resolution occurs and the ICMP packet won't go out. So I am not sure that 0 is a valid value.
Quoted 66 lines
Cheers
/IliasQuoted 63 lines
Signed-off-by Jerome Forissier <[email protected]>--- test/dm/dsa.c | 2 ++ test/dm/eth.c | 4 ++++ 2 files changed, 6 insertions(+)test/dm/dsa.c +2
-0@@ -59,6 +59,7 @@ static int dm_test_dsa_probe(struct unit_test_state *uts)DM_TEST (dm_test_dsa_probe,UT_TESTF_SCAN_FDT ); +#if !defined(CONFIG_NET_LWIP )/* This test sends ping requests with the local address through each DSA port * via the sandbox DSA master Eth. */ @@ -80,3 +81,4 @@ static int dm_test_dsa(struct unit_test_state *uts) }DM_TEST (dm_test_dsa,UT_TESTF_SCAN_FDT ); +#endif /* !defined(CONFIG_NET_LWIP) */ test/dm/eth.c +4
-1@@ -170,6 +170,7 @@ static int dm_test_ip6_make_lladdr(struct unit_test_state *uts)DM_TEST (dm_test_ip6_make_lladdr,UT_TESTF_SCAN_FDT );#endif +#if !defined(CONFIG_NET_LWIP )static int dm_test_eth (struct unit_test_state *uts) { net_ping_ip =string_to_ip ("1.1.2.2" );@@ -298,6 +299,7 @@ static int dm_test_eth_act(struct unit_test_state *uts) return 0; }DM_TEST (dm_test_eth_act,UT_TESTF_SCAN_FDT ); +#endif /* !CONFIG_NET_LWIP */ /* Ensure that all addresses are loaded properly */ static int dm_test_ethaddr (struct unit_test_state *uts)@@ -332,6 +334,7 @@ static int dm_test_ethaddr(struct unit_test_state *uts) }DM_TEST (dm_test_ethaddr,UT_TESTF_SCAN_FDT ); +#if !defined(CONFIG_NET_LWIP )/* The asserts include a return on fail; cleanup in the caller */ static int _dm_test_eth_rotate1 (struct unit_test_state *uts) {@@ -616,6 +619,7 @@ static int dm_test_eth_async_ping_reply(struct unit_test_state *uts) }DM_TEST (dm_test_eth_async_ping_reply,UT_TESTF_SCAN_FDT ); +#endif /* !CONFIG_NET_LWIP */ #if IS_ENABLED (CONFIG_IPV6_ROUTER_DISCOVERY ) --2.40.1
Re: [PATCH 10/15] test: dm: dsa, eth: disable tests when CONFIG_NET_LWIP=y
In reply to Jerome ForissierQuoted 58 lines · Jerome Forissier
Some sandbox tests make strong assumptions on how the network stack is implemented. For example, the ping tests assume that ARP resolution occurs upon sending out the ICMP packet. This is not always the case with the lwIP stack which can cache ARP information. Therefore, disable these tests when
CONFIG_NET_LWIPis enabled.Signed-off-by Jerome Forissier <[email protected]>--- test/dm/dsa.c | 2 ++ test/dm/eth.c | 4 ++++ 2 files changed, 6 insertions(+)test/dm/dsa.c +2
-0@@ -59,6 +59,7 @@ static int dm_test_dsa_probe(struct unit_test_state *uts)DM_TEST (dm_test_dsa_probe,UT_TESTF_SCAN_FDT ); +#if !defined(CONFIG_NET_LWIP )/* This test sends ping requests with the local address through each DSA port * via the sandbox DSA master Eth. */ @@ -80,3 +81,4 @@ static int dm_test_dsa(struct unit_test_state *uts) }DM_TEST (dm_test_dsa,UT_TESTF_SCAN_FDT ); +#endif /* !defined(CONFIG_NET_LWIP) */ test/dm/eth.c +3
-0@@ -170,6 +170,7 @@ static int dm_test_ip6_make_lladdr(struct unit_test_state *uts)DM_TEST (dm_test_ip6_make_lladdr,UT_TESTF_SCAN_FDT );#endif +#if !defined(CONFIG_NET_LWIP )static int dm_test_eth (struct unit_test_state *uts) { net_ping_ip =string_to_ip ("1.1.2.2" );@@ -298,6 +299,7 @@ static int dm_test_eth_act(struct unit_test_state *uts) return 0; }DM_TEST (dm_test_eth_act,UT_TESTF_SCAN_FDT ); +#endif /* !CONFIG_NET_LWIP */ /* Ensure that all addresses are loaded properly */ static int dm_test_ethaddr (struct unit_test_state *uts)@@ -332,6 +334,7 @@ static int dm_test_ethaddr(struct unit_test_state *uts) }DM_TEST (dm_test_ethaddr,UT_TESTF_SCAN_FDT ); +#if !defined(CONFIG_NET_LWIP )/* The asserts include a return on fail; cleanup in the caller */ static int _dm_test_eth_rotate1 (struct unit_test_state *uts) {
test/dm/eth.c static int dm_test_eth_async_ping_reply(struct unit_test_state *uts) · line 624
Quoted 6 lines
test/dm/eth.c +1
-0@@ -616,6 +619,7 @@ static int dm_test_eth_async_ping_reply(struct unit_test_state *uts) }DM_TEST (dm_test_eth_async_ping_reply,UT_TESTF_SCAN_FDT ); +#endif /* !CONFIG_NET_LWIP */ #if IS_ENABLED (CONFIG_IPV6_ROUTER_DISCOVERY )
This seems like a lot of test disabling to me. And since a medium term goal would be to then drop the old network stack, a more nuanced approach is needed here. If not if/else'ing within the test, rewriting tests to cover the concept being tested needs to be done I think.
Signature · 1 line
Tom
Re: [PATCH 10/15] test: dm: dsa, eth: disable tests when CONFIG_NET_LWIP=y
In reply to Ilias ApalodimasQuoted 12 lines · Ilias Apalodimas
Hi Jerome,
Quoted 6 lines · Jerome Forissier
Some sandbox tests make strong assumptions on how the network stack is implemented. For example, the ping tests assume that ARP resolution occurs upon sending out the ICMP packet. This is not always the case with the lwIP stack which can cache ARP information. Therefore, disable these tests when
CONFIG_NET_LWIPis enabled.
Quoted 4 lines
Is the ARP Caching the only issue?
U-Boot isn't supposed to use the network stack that much, so it might be a better idea to disable arp-caching in LWIP (assuming it's doable). We might even get a few size of bytes back
You end up hitting an arp cache a lot because of references to say DNS, IP GW or server end point for downloading, so while at first it doesn't appear you'd need it you also don't want to do ARP for every packet sent.
Peter
Quoted 65 lines
Cheers
/IliasQuoted 63 lines
Signed-off-by Jerome Forissier <[email protected]>--- test/dm/dsa.c | 2 ++ test/dm/eth.c | 4 ++++ 2 files changed, 6 insertions(+)test/dm/dsa.c +2
-0@@ -59,6 +59,7 @@ static int dm_test_dsa_probe(struct unit_test_state *uts)DM_TEST (dm_test_dsa_probe,UT_TESTF_SCAN_FDT ); +#if !defined(CONFIG_NET_LWIP )/* This test sends ping requests with the local address through each DSA port * via the sandbox DSA master Eth. */ @@ -80,3 +81,4 @@ static int dm_test_dsa(struct unit_test_state *uts) }DM_TEST (dm_test_dsa,UT_TESTF_SCAN_FDT ); +#endif /* !defined(CONFIG_NET_LWIP) */ test/dm/eth.c +4
-1@@ -170,6 +170,7 @@ static int dm_test_ip6_make_lladdr(struct unit_test_state *uts)DM_TEST (dm_test_ip6_make_lladdr,UT_TESTF_SCAN_FDT );#endif +#if !defined(CONFIG_NET_LWIP )static int dm_test_eth (struct unit_test_state *uts) { net_ping_ip =string_to_ip ("1.1.2.2" );@@ -298,6 +299,7 @@ static int dm_test_eth_act(struct unit_test_state *uts) return 0; }DM_TEST (dm_test_eth_act,UT_TESTF_SCAN_FDT ); +#endif /* !CONFIG_NET_LWIP */ /* Ensure that all addresses are loaded properly */ static int dm_test_ethaddr (struct unit_test_state *uts)@@ -332,6 +334,7 @@ static int dm_test_ethaddr(struct unit_test_state *uts) }DM_TEST (dm_test_ethaddr,UT_TESTF_SCAN_FDT ); +#if !defined(CONFIG_NET_LWIP )/* The asserts include a return on fail; cleanup in the caller */ static int _dm_test_eth_rotate1 (struct unit_test_state *uts) {@@ -616,6 +619,7 @@ static int dm_test_eth_async_ping_reply(struct unit_test_state *uts) }DM_TEST (dm_test_eth_async_ping_reply,UT_TESTF_SCAN_FDT ); +#endif /* !CONFIG_NET_LWIP */ #if IS_ENABLED (CONFIG_IPV6_ROUTER_DISCOVERY ) --2.40.1
Re: [PATCH 09/15] net-lwip: add support for EFI_HTTP_BOOT
In reply to Ilias ApalodimasQuoted 54 lines · Ilias Apalodimas
Hi Jerome,
Quoted 39 lines · Jerome Forissier
Implement the
wget_with_dns()function which is needed byCONFIG_EFI_HTTP_BOOT=y. Note that there is no dependency added onCONFIG_CMD_DNS_LWIPbecauseCONFIG_CMD_WGET_LWIPnatively supports hostname resolution.Signed-off-by Jerome Forissier <[email protected]>--- lib/efi_loader/Kconfig | 5 +++-- net-lwip/wget.c | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-)lib/efi_loader/Kconfig +3
-2@@ -505,8 +505,9 @@ config EFI_RISCV_BOOT_PROTOCOL config EFI_HTTP_BOOT bool "EFI HTTP Boot support" - select CMD_DNS - select CMD_WGET + select CMD_DNS if NET + select CMD_WGET if NET + select CMD_WGET_LWIP if NET_LWIP select BLKMAP help Enabling this option adds EFI HTTP Boot support. It allows tonet-lwip/wget.c +3
-0@@ -166,3 +166,19 @@ int do_wget(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])return CMD_RET_FAILURE ; } + +#if defined(CONFIG_EFI_HTTP_BOOT ) +int wget_with_dns (ulong dst_addr,char *uri)net-lwip/wget.c int do_wget(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]) · line 181
Quoted 10 lines
net-lwip/wget.c +10
-0+{ +char addr_str[11 ]; +struct cmd_tbl cmdtp = {}; +char *argv[] = {"wget" , addr_str, uri }; + +snprintf (addr_str,sizeof (addr_str),"0x%lx" , dst_addr); + +if (do_wget (&cmdtp,0 ,ARRAY_SIZE (argv), argv) ==CMD_RET_SUCCESS ) +return 0 ; +
Quoted 7 lines
Calling a command directly feels a bit weird.
Can we do this instead:
- Splitdo_wgetin patch #7 and carve out 2 functions. The first will prepare the arguments and the second will callhttpc_get_file_dns()and run the loop
- Once that's split you can use the newly split function here and avoid calling a command
Addressed in next version. I have implemented wget_with_dns() in patch #7 to that #9 doesn't need to add any code. And do_wget() simply calls wget_with_dns().
Thanks.
Signature · 1 line
Jerome
Quoted 9 lines
Thanks
/IliasQuoted 6 lines
net-lwip/wget.c +3
-1+ return -1; +} +#endif --2.40.1
Re: [PATCH 02/15] net-lwip: import lwIP library under lib/lwip
In reply to Jerome ForissierQuoted 23 lines · Jerome Forissier
Import the Lightweight IP (lwIP) library as lib/lwip. The code is built when
CONFIG_NET_LWIP=y.The lwIP code was imported with the following commands:
(cd /tmp && git clone https://git.savannah.gnu.org/git/lwip.git -b STABLE-2_2_0_RELEASE) mkdir -p lib/lwip
cp -R/tmp/lwip/src/{api,core,include}lib/lwip/
mkdir -plib/lwip/netif&& cp/tmp/lwip/src/netif/ethernet.clib/lwip/netif/mkdir -plib/lwip/apps/tftp&& cp/tmp/lwip/src/apps/tftp/tftp.clib/lwip/apps/tftp/mkdir -plib/lwip/apps/http&& cp/tmp/lwip/src/apps/http/http_client.clib/lwip/apps/http/The list of object files added to
lib/liwip/Makefilewas given by:(cd lib/lwip && find . -name \*.c | sort | sed 's@\./@\t@' | sed 's/\.c$/.o \\/') >>lib/liwip/Makefile
These files are adaptation layers written specially for U-Boot:
lib/lwip/u-boot/arch/cc.h
lib/lwip/u-boot/arch/sys_arch.h(empty)
lib/lwip/u-boot/limits.h(empty)
lib/lwip/u-boot/lwipopts.h
Quoted 5 lines
They were initially contributed by Maxim in a previous RFC patch series.
Signed-off-by Jerome Forissier <[email protected]>Co-developed-by Maxim Uvarov <[email protected]>Cc Maxim Uvarov <[email protected]>
As I believe I've said before, this needs to be a subtree moving forward.
Signature · 1 line
Tom
Re: [PATCH 12/15] configs: add qemu_arm64_lwip_defconfig
In reply to Jerome ForissierQuoted 15 lines · Jerome Forissier
Add
qemu_arm64_lwip_defconfigwhich was created fromqemu_arm64_defconfigwithCONFIG_NET_LWIPenabled.Signed-off-by Jerome Forissier <[email protected]>--- configs/qemu_arm64_lwip_defconfig | 70 +++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 configs/qemu_arm64_lwip_defconfigconfigs/qemu_arm64_lwip_defconfig new file +0
-0
configs/qemu_arm64_lwip_defconfig line 3
Quoted 3 lines
configs/qemu_arm64_lwip_defconfig new file +3
-0@@ -0,0 +1,70 @@ +CONFIG_ARM=y +CONFIG_POSITION_INDEPENDENT=y +CONFIG_ARCH_QEMU=y
Setting aside that I would like lwip to default to y, at least in the first few iterations (so that testing is easier), this should be using the #include method rather than duplicating the whole config.
Signature · 1 line
Tom
Re: [PATCH 11/15] cmd: bdinfo: enable -e when CONFIG_CMD_NET_LWIP=y
In reply to Jerome ForissierQuoted 3 lines · Jerome Forissier
Support "bdinfo -e" when lwIP is selected.
Signed-off-by Jerome Forissier <[email protected]>
Signature · 1 line
Tom
Re: [PATCH 03/15] net-lwip: add DHCP support and dhcp commmand
In reply to Jerome ForissierQuoted 11 lines · Jerome Forissier
Add what it takes to enable
CONFIG_NETDEVICESwithCONFIG_NET_LWIPand enable DHCP as well as the dhcp command (CONFIG_CMD_DHCP_LWIP).
-net-lwip/net-lwip.cis mostly empty for now. It will provide functions similar tonet/net.cexcept based on the lwIP stack
-include/net-lwip.his a replacement forinclude/net.hwhich is unused whenCONFIG_NET_LWIPis enabled. Declarations from the latter will be transferred to the former as needed when new network commands are ported on top of lwIP.
-CONFIG_CMD_TFTPBOOT_LWIPis introduced due toCONFIG_BOOTMETH_EFIhaving an implicit dependency ondo_tftpb().
Quoted 1 line
Signed-off-by Jerome Forissier <[email protected]>
I don't like a new symbol for re-implementing each command. To me, the user should pick lwIP or traditional stack, and CMD_DHCP gives the DHCP command and so forth, and so the Makefile gets reworked as needed.
Signature · 1 line
Tom
Re: [PATCH 08/15] net-lwip: import net command from cmd/net.c
In reply to Jerome ForissierQuoted 35 lines · Jerome Forissier
Add support for "net list" and "net stats" to net-lwip/ by copying the code from
cmd/net.c.Signed-off-by Jerome Forissier <[email protected]>--- cmd/net-lwip.c | 98 ++++++++++++++++++++++++++++++++++++++++++++++ include/net-lwip.h | 50 +++++++++++++++++++++++ 2 files changed, 148 insertions(+)cmd/net-lwip.c +10
-0@@ -2,6 +2,10 @@/* Copyright (C) 2024 Linaro Ltd. */ #include <command.h> +#include <dm/device.h> +#include <dm/uclass.h> +#include <linux/compat.h> +#include <linux/ethtool.h> #include <net-lwip.h> #if defined(CONFIG_CMD_DHCP_LWIP )@@ -43,3 +47,97 @@ U_BOOT_CMD("[loadAddress] URL" );#endif + +static int do_net_list (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) +{ +const struct udevice *current =eth_get_dev (); +unsigned char env_enetaddr[ARP_HLEN ]; +const struct udevice *dev;
cmd/net-lwip.c U_BOOT_CMD( · line 65
Quoted 10 lines
cmd/net-lwip.c +10
-0+struct uclass *uc; + + uclass_id_foreach_dev(UCLASS_ETH, dev, uc) { +eth_env_get_enetaddr_by_index ("eth" ,dev_seq (dev), env_enetaddr); +printf ("eth%d : %s %pM %s\n" ,dev_seq (dev), dev->name, env_enetaddr, + current == dev ?"active" :"" ); + } +return CMD_RET_SUCCESS ; +} +
Some of these functions seem to be a c/p from cmd/net.c Carve the common ones out in cmd/net-common.c and reuse them please
[...]
Cheers
/Ilias
Re: [PATCH 12/15] configs: add qemu_arm64_lwip_defconfig
In reply to Tom RiniQuoted 11 lines · Tom Rini
Quoted 9 lines · Jerome Forissier
Add
qemu_arm64_lwip_defconfigwhich was created fromqemu_arm64_defconfigwithCONFIG_NET_LWIPenabled.Signed-off-by Jerome Forissier <[email protected]>--- configs/qemu_arm64_lwip_defconfig | 70 +++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 configs/qemu_arm64_lwip_defconfig
Quoted 12 lines
configs/qemu_arm64_lwip_defconfig line 3
Quoted 9 lines
configs/qemu_arm64_lwip_defconfig new file +3
-0@@ -0,0 +1,70 @@ +CONFIG_ARM=y +CONFIG_POSITION_INDEPENDENT=y +CONFIG_ARCH_QEMU=ySetting aside that I would like lwip to default to y, at least in the first few iterations (so that testing is easier),
I could certainly do this. By creating a new defconfig, my goal was to minimize the impacts on existing use cases.
Quoted 2 lines
this should be using
the #include method rather than duplicating the whole config.
I've done that for v2. Let me know if you still prefer I change qemu_arm64_defconfig instead.
Thanks,
Signature · 1 line
Jerome
Re: [PATCH 10/15] test: dm: dsa, eth: disable tests when CONFIG_NET_LWIP=y
In reply to Peter Robinsonчт, 23 мая 2024 г. в 16:40, Peter Robinson <[email protected]>:
Quoted 20 lines
Quoted 12 lines · Ilias Apalodimas
Hi Jerome,
Quoted 6 lines · Jerome Forissier
Some sandbox tests make strong assumptions on how the network stack is implemented. For example, the ping tests assume that ARP resolution occurs upon sending out the ICMP packet. This is not always the case with the lwIP stack which can cache ARP information. Therefore, disable these tests when
CONFIG_NET_LWIPis enabled.Quoted 4 lines
Is the ARP Caching the only issue?
U-Boot isn't supposed to use the network stack that much, so it might be a better idea to disable arp-caching in LWIP (assuming it's doable). We might even get a few size of bytes back
Quoted 7 lines
You end up hitting an arp cache a lot because of references to say DNS, IP GW or server end point for downloading, so while at first it doesn't appear you'd need it you also don't want to do ARP for every packet sent.
Peter
Caching has to be in the network stack. At least for 5-10 entries. There are 2 ways:
or change the test or add flush/delete arp entries. Flushing and printing ARPs are useful
for debugging and can go to the special Kconfig option.
BR,
Maxim.
Quoted 65 lines
Quoted 65 lines
Cheers
/IliasQuoted 63 lines
Signed-off-by Jerome Forissier <[email protected]>--- test/dm/dsa.c | 2 ++ test/dm/eth.c | 4 ++++ 2 files changed, 6 insertions(+)test/dm/dsa.c +2
-0@@ -59,6 +59,7 @@ static int dm_test_dsa_probe(struct unit_test_state *uts)DM_TEST (dm_test_dsa_probe,UT_TESTF_SCAN_FDT ); +#if !defined(CONFIG_NET_LWIP )/* This test sends ping requests with the local address through each DSA port * via the sandbox DSA master Eth. */ @@ -80,3 +81,4 @@ static int dm_test_dsa(struct unit_test_state *uts) }DM_TEST (dm_test_dsa,UT_TESTF_SCAN_FDT ); +#endif /* !defined(CONFIG_NET_LWIP) */ test/dm/eth.c +4
-1@@ -170,6 +170,7 @@ static int dm_test_ip6_make_lladdr(struct unit_test_state *uts)DM_TEST (dm_test_ip6_make_lladdr,UT_TESTF_SCAN_FDT );#endif +#if !defined(CONFIG_NET_LWIP )static int dm_test_eth (struct unit_test_state *uts) { net_ping_ip =string_to_ip ("1.1.2.2" );@@ -298,6 +299,7 @@ static int dm_test_eth_act(struct unit_test_state *uts) return 0; }DM_TEST (dm_test_eth_act,UT_TESTF_SCAN_FDT ); +#endif /* !CONFIG_NET_LWIP */ /* Ensure that all addresses are loaded properly */ static int dm_test_ethaddr (struct unit_test_state *uts)@@ -332,6 +334,7 @@ static int dm_test_ethaddr(struct unit_test_state *uts) }DM_TEST (dm_test_ethaddr,UT_TESTF_SCAN_FDT ); +#if !defined(CONFIG_NET_LWIP )/* The asserts include a return on fail; cleanup in the caller */ static int _dm_test_eth_rotate1 (struct unit_test_state *uts) {@@ -616,6 +619,7 @@ static int dm_test_eth_async_ping_reply(struct unit_test_state *uts) }DM_TEST (dm_test_eth_async_ping_reply,UT_TESTF_SCAN_FDT ); +#endif /* !CONFIG_NET_LWIP */ #if IS_ENABLED (CONFIG_IPV6_ROUTER_DISCOVERY ) --2.40.1
Signature · 2 lines
Best regards, Maxim Uvarov
Re: [PATCH 03/15] net-lwip: add DHCP support and dhcp commmand
In reply to Tom RiniQuoted 13 lines · Tom Rini
Quoted 11 lines · Jerome Forissier
Add what it takes to enable
CONFIG_NETDEVICESwithCONFIG_NET_LWIPand enable DHCP as well as the dhcp command (CONFIG_CMD_DHCP_LWIP).
-net-lwip/net-lwip.cis mostly empty for now. It will provide functions similar tonet/net.cexcept based on the lwIP stack
-include/net-lwip.his a replacement forinclude/net.hwhich is unused whenCONFIG_NET_LWIPis enabled. Declarations from the latter will be transferred to the former as needed when new network commands are ported on top of lwIP.
-CONFIG_CMD_TFTPBOOT_LWIPis introduced due toCONFIG_BOOTMETH_EFIhaving an implicit dependency ondo_tftpb().
Quoted 5 lines
Quoted 1 line
Signed-off-by Jerome Forissier <[email protected]>I don't like a new symbol for re-implementing each command. To me, the user should pick lwIP or traditional stack, and
CMD_DHCPgives the DHCP command and so forth, and so theMakefilegets reworked as needed.
Done for v2, thanks.
Signature · 1 line
Jerome
Re: [PATCH 08/15] net-lwip: import net command from cmd/net.c
In reply to Ilias ApalodimasQuoted 42 lines · Ilias Apalodimas
Quoted 40 lines · Jerome Forissier
Add support for "net list" and "net stats" to net-lwip/ by copying the code from
cmd/net.c.Signed-off-by Jerome Forissier <[email protected]>--- cmd/net-lwip.c | 98 ++++++++++++++++++++++++++++++++++++++++++++++ include/net-lwip.h | 50 +++++++++++++++++++++++ 2 files changed, 148 insertions(+)cmd/net-lwip.c +15
-0@@ -2,6 +2,10 @@/* Copyright (C) 2024 Linaro Ltd. */ #include <command.h> +#include <dm/device.h> +#include <dm/uclass.h> +#include <linux/compat.h> +#include <linux/ethtool.h> #include <net-lwip.h> #if defined(CONFIG_CMD_DHCP_LWIP )@@ -43,3 +47,97 @@ U_BOOT_CMD("[loadAddress] URL" );#endif + +static int do_net_list (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) +{ +const struct udevice *current =eth_get_dev (); +unsigned char env_enetaddr[ARP_HLEN ]; +const struct udevice *dev; +struct uclass *uc; + + uclass_id_foreach_dev(UCLASS_ETH, dev, uc) { +eth_env_get_enetaddr_by_index ("eth" ,dev_seq (dev), env_enetaddr); + printf("eth%d : %s %pM %s\n", dev_seq(dev), dev->name, env_enetaddr,
Quoted 8 lines
cmd/net-lwip.c U_BOOT_CMD( · line 65
Quoted 5 lines
cmd/net-lwip.c +5
-0+ current == dev ? "active" : ""); + } +return CMD_RET_SUCCESS ; +} +Some of these functions seem to be a c/p from
cmd/net.cCarve the common ones out incmd/net-common.cand reuse them please
Totally makes sense. Done in upcoming v2.
Signature · 1 line
Jerome
Quoted 5 lines
[...]
Cheers
/Ilias
Re: [PATCH 02/15] net-lwip: import lwIP library under lib/lwip
In reply to Tom RiniQuoted 25 lines · Tom Rini
Quoted 23 lines · Jerome Forissier
Import the Lightweight IP (lwIP) library as lib/lwip. The code is built when
CONFIG_NET_LWIP=y.The lwIP code was imported with the following commands:
(cd /tmp && git clone https://git.savannah.gnu.org/git/lwip.git -b STABLE-2_2_0_RELEASE) mkdir -p lib/lwip
cp -R/tmp/lwip/src/{api,core,include}lib/lwip/
mkdir -plib/lwip/netif&& cp/tmp/lwip/src/netif/ethernet.clib/lwip/netif/mkdir -plib/lwip/apps/tftp&& cp/tmp/lwip/src/apps/tftp/tftp.clib/lwip/apps/tftp/mkdir -plib/lwip/apps/http&& cp/tmp/lwip/src/apps/http/http_client.clib/lwip/apps/http/The list of object files added to
lib/liwip/Makefilewas given by:(cd lib/lwip && find . -name \*.c | sort | sed 's@\./@\t@' | sed 's/\.c$/.o \\/') >>lib/liwip/Makefile
These files are adaptation layers written specially for U-Boot:
lib/lwip/u-boot/arch/cc.h
lib/lwip/u-boot/arch/sys_arch.h(empty)
lib/lwip/u-boot/limits.h(empty)
lib/lwip/u-boot/lwipopts.h
Quoted 9 lines
Quoted 5 lines
They were initially contributed by Maxim in a previous RFC patch series.
Signed-off-by Jerome Forissier <[email protected]>Co-developed-by Maxim Uvarov <[email protected]>Cc Maxim Uvarov <[email protected]>As I believe I've said before, this needs to be a subtree moving forward.
Done in upcoming v2. TBH I don't quite like it because (1) it introduces a merge commit, (2) interactive rebase becomes difficult (I had to pass --rebase-merges or the rebase will fail), and (3) I found no way to record the command I used in the patch description. FYI the command was:
git subtree add --squash --prefix lib/lwip/lwip \
https://git.savannah.gnu.org/git/lwip.git STABLE-2_2_0_RELEASEThanks,
Signature · 1 line
Jerome
Re: [PATCH 02/15] net-lwip: import lwIP library under lib/lwip
Quoted 38 lines · Jerome Forissier
Quoted 25 lines · Tom Rini
Quoted 23 lines · Jerome Forissier
Import the Lightweight IP (lwIP) library as lib/lwip. The code is built when
CONFIG_NET_LWIP=y.The lwIP code was imported with the following commands:
(cd /tmp && git clone https://git.savannah.gnu.org/git/lwip.git -b STABLE-2_2_0_RELEASE) mkdir -p lib/lwip
cp -R/tmp/lwip/src/{api,core,include}lib/lwip/
mkdir -plib/lwip/netif&& cp/tmp/lwip/src/netif/ethernet.clib/lwip/netif/mkdir -plib/lwip/apps/tftp&& cp/tmp/lwip/src/apps/tftp/tftp.clib/lwip/apps/tftp/mkdir -plib/lwip/apps/http&& cp/tmp/lwip/src/apps/http/http_client.clib/lwip/apps/http/The list of object files added to
lib/liwip/Makefilewas given by:(cd lib/lwip && find . -name \*.c | sort | sed 's@\./@\t@' | sed 's/\.c$/.o \\/') >>lib/liwip/Makefile
These files are adaptation layers written specially for U-Boot:
lib/lwip/u-boot/arch/cc.h
lib/lwip/u-boot/arch/sys_arch.h(empty)
lib/lwip/u-boot/limits.h(empty)
lib/lwip/u-boot/lwipopts.hQuoted 9 lines
Quoted 5 lines
They were initially contributed by Maxim in a previous RFC patch series.
Signed-off-by Jerome Forissier <[email protected]>Co-developed-by Maxim Uvarov <[email protected]>Cc Maxim Uvarov <[email protected]>As I believe I've said before, this needs to be a subtree moving forward.
Quoted 6 lines
Done in upcoming v2. TBH I don't quite like it because (1) it introduces a merge commit, (2) interactive rebase becomes difficult (I had to pass --rebase-merges or the rebase will fail), and (3) I found no way to record the command I used in the patch description. FYI the command was:
git subtree add --squash --prefix lib/lwip/lwip \ https://git.savannah.gnu.org/git/lwip.git STABLE-2_2_0_RELEASE
Thanks. It does make things differently challenging on the initial merge but there's dts/update-dts-subtree.sh as an example script on how to make subsequent updates easier. And then in the cover letter we just say a pre-req is to do the above to get the initial import of the code.
Signature · 1 line
Tom
Re: [PATCH 12/15] configs: add qemu_arm64_lwip_defconfig
In reply to Jerome ForissierQuoted 27 lines · Jerome Forissier
Quoted 11 lines · Tom Rini
Quoted 9 lines · Jerome Forissier
Add
qemu_arm64_lwip_defconfigwhich was created fromqemu_arm64_defconfigwithCONFIG_NET_LWIPenabled.Signed-off-by Jerome Forissier <[email protected]>--- configs/qemu_arm64_lwip_defconfig | 70 +++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 configs/qemu_arm64_lwip_defconfigQuoted 12 lines
configs/qemu_arm64_lwip_defconfig line 3
Quoted 9 lines
configs/qemu_arm64_lwip_defconfig new file +3
-0@@ -0,0 +1,70 @@ +CONFIG_ARM=y +CONFIG_POSITION_INDEPENDENT=y +CONFIG_ARCH_QEMU=ySetting aside that I would like lwip to default to y, at least in the first few iterations (so that testing is easier),
Quoted 2 lines
I could certainly do this. By creating a new defconfig, my goal was to minimize the impacts on existing use cases.
Yes but then it makes it harder to out of the box see what the deltas are.
Quoted 5 lines
Quoted 2 lines
this should be using
the #include method rather than duplicating the whole config.I've done that for v2. Let me know if you still prefer I change
qemu_arm64_defconfiginstead.
This is fine for v2, yeah. Once that's posted I'll grab everything and:
- Throw it at the small HW lab I have
- Enable it by default for everyone and throw it at CI
- Also throw it at my script for world build before/after and using buildman's bloat checker to see what grew how much where.
Signature · 1 line
Tom
Re: [PATCH 12/15] configs: add qemu_arm64_lwip_defconfig
Quoted 37 lines · Tom Rini
Quoted 27 lines · Jerome Forissier
Quoted 11 lines · Tom Rini
Quoted 9 lines · Jerome Forissier
Add
qemu_arm64_lwip_defconfigwhich was created fromqemu_arm64_defconfigwithCONFIG_NET_LWIPenabled.Signed-off-by Jerome Forissier <[email protected]>--- configs/qemu_arm64_lwip_defconfig | 70 +++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 configs/qemu_arm64_lwip_defconfigQuoted 12 lines
configs/qemu_arm64_lwip_defconfig line 3
Quoted 9 lines
configs/qemu_arm64_lwip_defconfig new file +3
-0@@ -0,0 +1,70 @@ +CONFIG_ARM=y +CONFIG_POSITION_INDEPENDENT=y +CONFIG_ARCH_QEMU=ySetting aside that I would like lwip to default to y, at least in the first few iterations (so that testing is easier),
Quoted 2 lines
I could certainly do this. By creating a new defconfig, my goal was to minimize the impacts on existing use cases.
Yes but then it makes it harder to out of the box see what the deltas are.
Quoted 3 lines
Quoted 2 lines
this should be using
the #include method rather than duplicating the whole config.
Quoted 6 lines
Quoted 2 lines
I've done that for v2. Let me know if you still prefer I change
qemu_arm64_defconfiginstead.This is fine for v2, yeah. Once that's posted I'll grab everything and:
- Throw it at the small HW lab I have
- Enable it by default for everyone and throw it at CI
At this point you can expect quite a few failures (unresolved symbols to begin with) because so many parts of the network-related code peek & poke various parts of the net implementation without formally depending on NET (i.e., !NET_LWIP). Some more work is clearly needed to port to lwIP, how much is probably something the CI run will help understand.
Thanks,
Signature · 1 line
Jerome
Quoted 2 lines
- Also throw it at my script for world build before/after and using buildman's bloat checker to see what grew how much where.
Re: [PATCH 12/15] configs: add qemu_arm64_lwip_defconfig
Quoted 47 lines · Jerome Forissier
Quoted 37 lines · Tom Rini
Quoted 27 lines · Jerome Forissier
Quoted 11 lines · Tom Rini
Quoted 9 lines · Jerome Forissier
Add
qemu_arm64_lwip_defconfigwhich was created fromqemu_arm64_defconfigwithCONFIG_NET_LWIPenabled.Signed-off-by Jerome Forissier <[email protected]>--- configs/qemu_arm64_lwip_defconfig | 70 +++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 configs/qemu_arm64_lwip_defconfigQuoted 12 lines
configs/qemu_arm64_lwip_defconfig line 3
Quoted 9 lines
configs/qemu_arm64_lwip_defconfig new file +3
-0@@ -0,0 +1,70 @@ +CONFIG_ARM=y +CONFIG_POSITION_INDEPENDENT=y +CONFIG_ARCH_QEMU=ySetting aside that I would like lwip to default to y, at least in the first few iterations (so that testing is easier),
Quoted 2 lines
I could certainly do this. By creating a new defconfig, my goal was to minimize the impacts on existing use cases.
Yes but then it makes it harder to out of the box see what the deltas are.
Quoted 3 lines
Quoted 2 lines
this should be using
the #include method rather than duplicating the whole config.Quoted 6 lines
Quoted 2 lines
I've done that for v2. Let me know if you still prefer I change
qemu_arm64_defconfiginstead.This is fine for v2, yeah. Once that's posted I'll grab everything and:
- Throw it at the small HW lab I have
- Enable it by default for everyone and throw it at CI
Quoted 5 lines
At this point you can expect quite a few failures (unresolved symbols to begin with) because so many parts of the network-related code peek & poke various parts of the net implementation without formally depending on NET (i.e., !NET_LWIP). Some more work is clearly needed to port to lwIP, how much is probably something the CI run will help understand.
OK, thanks for setting expectations. And FYI if you hadn't seen:
https://docs.u-boot.org/en/latest/develop/ci_testing.html you can trigger them yourself, but Azure sometimes just has issues if we get a slow runner sometimes.
Signature · 1 line
Tom