summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2011-10-24 18:00:08 +0000
committerSimon Glass <sjg@chromium.org>2011-11-17 18:22:24 -0800
commitdd3672e273fa0912ccc6cb7790ca0d13ed86b315 (patch)
tree92d970fadcf653c3b18fb053078ea3d8adbc825d /common
parentfe7d3087da24434a3be435cedaca4f5790257a1d (diff)
UPSTREAM: net: tftpput: add tftpput command
This adds the tftpput command to U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org> (cherry picked from commit 2d46cf291eae29a42bb5ca3d280d2b136339686b) Change-Id: I7d0dc1fd78d9269ed932899cb1c301771ee24fbf Reviewed-on: https://gerrit.chromium.org/gerrit/11802 Commit-Ready: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common')
-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 a6d28e5f5e3..f74f4048ce3 100644
--- a/common/cmd_net.c
+++ b/common/cmd_net.c
@@ -57,6 +57,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[])
{
@@ -208,6 +224,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);