net: lwip: add TFTP support and tftpboot command
Implement do_tftpb(). This implementation of the tftp command
supports an optional port number. For example:
tftp 192.168.0.30:9069:file.bin
It also supports taking the server IP from ${tftpserverip} if
defined, before falling back to ${serverip}.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 211be39..7173f3d 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -2110,10 +2110,9 @@
config CMD_TFTPBOOT
bool "tftp"
select PROT_UDP_LWIP if NET_LWIP
- default n
+ default y
help
tftpboot - load file via network using TFTP protocol
- Currently a placeholder (not implemented) when NET_LWIP=y.
endif # if CMD_NET
diff --git a/cmd/net-lwip.c b/cmd/net-lwip.c
index 82edb5f..80f0872 100644
--- a/cmd/net-lwip.c
+++ b/cmd/net-lwip.c
@@ -11,3 +11,11 @@
"[loadAddress] [[hostIPaddr:]bootfilename]"
);
#endif
+
+#if defined(CONFIG_CMD_TFTPBOOT)
+U_BOOT_CMD(
+ tftpboot, 3, 0, do_tftpb,
+ "boot image via network using TFTP protocol\n",
+ "[loadAddress] [[hostIPaddr:]bootfilename]"
+);
+#endif