mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-20 22:21:41 +00:00
net: tftpput: add tftpput command
This adds the tftpput command to U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
1fb7cd498e
commit
2d46cf291e
1 changed files with 23 additions and 0 deletions
|
@ -52,6 +52,22 @@ U_BOOT_CMD(
|
||||||
"[loadAddress] [[hostIPaddr:]bootfilename]"
|
"[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
|
#ifdef CONFIG_CMD_TFTPSRV
|
||||||
static int do_tftpsrv(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
|
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;
|
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:
|
default:
|
||||||
show_boot_progress (-80);
|
show_boot_progress (-80);
|
||||||
return cmd_usage(cmdtp);
|
return cmd_usage(cmdtp);
|
||||||
|
|
Loading…
Add table
Reference in a new issue