projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tiny-printf: Support %i
[oweals/u-boot.git]
/
cmd
/
net.c
diff --git
a/cmd/net.c
b/cmd/net.c
index 67888d4e184add6a53531ff17ff758cfad41869b..1b724cc57090e7ab81eecf750c48157d1fa57ce8 100644
(file)
--- a/
cmd/net.c
+++ b/
cmd/net.c
@@
-1,8
+1,7
@@
+// SPDX-License-Identifier: GPL-2.0+
/*
* (C) Copyright 2000
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
/*
* (C) Copyright 2000
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * SPDX-License-Identifier: GPL-2.0+
*/
/*
*/
/*
@@
-10,6
+9,8
@@
*/
#include <common.h>
#include <command.h>
*/
#include <common.h>
#include <command.h>
+#include <env.h>
+#include <image.h>
#include <net.h>
static int netboot_common(enum proto_t, cmd_tbl_t *, int, char * const []);
#include <net.h>
static int netboot_common(enum proto_t, cmd_tbl_t *, int, char * const []);
@@
-184,13
+185,18
@@
static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,
int size;
ulong addr;
int size;
ulong addr;
- /* pre-set load_addr */
+ net_boot_file_name_explicit = false;
+
+ /* pre-set image_load_addr */
s = env_get("loadaddr");
if (s != NULL)
s = env_get("loadaddr");
if (s != NULL)
- load_addr = simple_strtoul(s, NULL, 16);
+
image_
load_addr = simple_strtoul(s, NULL, 16);
switch (argc) {
case 1:
switch (argc) {
case 1:
+ /* refresh bootfile name from env */
+ copy_filename(net_boot_file_name, env_get("bootfile"),
+ sizeof(net_boot_file_name));
break;
case 2: /*
break;
case 2: /*
@@
-200,15
+206,21
@@
static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,
* mis-interpreted as a valid number.
*/
addr = simple_strtoul(argv[1], &end, 16);
* mis-interpreted as a valid number.
*/
addr = simple_strtoul(argv[1], &end, 16);
- if (end == (argv[1] + strlen(argv[1])))
- load_addr = addr;
- else
+ if (end == (argv[1] + strlen(argv[1]))) {
+ image_load_addr = addr;
+ /* refresh bootfile name from env */
+ copy_filename(net_boot_file_name, env_get("bootfile"),
+ sizeof(net_boot_file_name));
+ } else {
+ net_boot_file_name_explicit = true;
copy_filename(net_boot_file_name, argv[1],
sizeof(net_boot_file_name));
copy_filename(net_boot_file_name, argv[1],
sizeof(net_boot_file_name));
+ }
break;
case 3:
break;
case 3:
- load_addr = simple_strtoul(argv[1], NULL, 16);
+ image_load_addr = simple_strtoul(argv[1], NULL, 16);
+ net_boot_file_name_explicit = true;
copy_filename(net_boot_file_name, argv[2],
sizeof(net_boot_file_name));
copy_filename(net_boot_file_name, argv[2],
sizeof(net_boot_file_name));
@@
-216,11
+228,12
@@
static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,
#ifdef CONFIG_CMD_TFTPPUT
case 4:
#ifdef CONFIG_CMD_TFTPPUT
case 4:
- if (strict_strtoul(argv[1], 16, &save_addr) < 0 ||
- strict_strtoul(argv[2], 16, &save_size) < 0) {
+ if (strict_strtoul(argv[1], 16, &
image_
save_addr) < 0 ||
+ strict_strtoul(argv[2], 16, &
image_
save_size) < 0) {
printf("Invalid address/size\n");
return CMD_RET_USAGE;
}
printf("Invalid address/size\n");
return CMD_RET_USAGE;
}
+ net_boot_file_name_explicit = true;
copy_filename(net_boot_file_name, argv[3],
sizeof(net_boot_file_name));
break;
copy_filename(net_boot_file_name, argv[3],
sizeof(net_boot_file_name));
break;