summaryrefslogtreecommitdiff
path: root/common/cmd_net.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2011-10-24 18:00:08 +0000
committerWolfgang Denk <wd@denx.de>2011-10-26 21:36:46 +0200
commit2d46cf291eae29a42bb5ca3d280d2b136339686b (patch)
tree60c49f5f5e2f69b16eb2a24a3d43a19cc83cec59 /common/cmd_net.c
parent1fb7cd498e6a5a7e14e1ac5518262a35ed293f3e (diff)
downloadu-boot-imx-2d46cf291eae29a42bb5ca3d280d2b136339686b.zip
u-boot-imx-2d46cf291eae29a42bb5ca3d280d2b136339686b.tar.gz
u-boot-imx-2d46cf291eae29a42bb5ca3d280d2b136339686b.tar.bz2
net: tftpput: add tftpput command
This adds the tftpput command to U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/cmd_net.c')
-rw-r--r--common/cmd_net.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/common/cmd_net.c b/common/cmd_net.c
index f610385..f89a24b 100644
--- a/common/cmd_net.c
+++ b/common/cmd_net.c
@@ -52,6 +52,22 @@ U_BOOT_CMD(
"[loadAddress] [[hostIPaddr:]bootfilename]"
);
+#ifdef CONFIG_CMD_TFTPPUT
+int do_tftpput(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+ int ret;
+
+ ret = netboot_common(TFTPPUT, cmdtp, argc, argv);
+ return ret;
+}
+
+U_BOOT_CMD(
+ tftpput, 4, 1, do_tftpput,
+ "TFTP put command, for uploading files to a server",
+ "Address Size [[hostIPaddr:]filename]"
+);
+#endif
+
#ifdef CONFIG_CMD_TFTPSRV
static int do_tftpsrv(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
{
@@ -203,6 +219,13 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,
break;
+#ifdef CONFIG_CMD_TFTPPUT
+ case 4:
+ save_addr = strict_strtoul(argv[1], NULL, 16);
+ save_size = strict_strtoul(argv[2], NULL, 16);
+ copy_filename(BootFile, argv[3], sizeof(BootFile));
+ break;
+#endif
default:
show_boot_progress (-80);
return cmd_usage(cmdtp);