bootvx: Exit if bootline address is not specified

Exit the 'bootvx' command if bootline address is not specified.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
Bin Meng 2018-04-11 22:02:21 -07:00
parent 7824ad6ad4
commit ced71a2f72

View File

@ -304,13 +304,14 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
tmp = env_get("bootaddr");
if (!tmp) {
printf("## VxWorks bootline address not specified\n");
} else {
return 1;
}
bootaddr = simple_strtoul(tmp, NULL, 16);
/*
* Check to see if the bootline is defined in the 'bootargs'
* parameter. If it is not defined, we may be able to
* construct the info.
* Check to see if the bootline is defined in the 'bootargs' parameter.
* If it is not defined, we may be able to construct the info.
*/
bootline = env_get("bootargs");
if (!bootline) {
@ -318,16 +319,15 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
if (tmp) {
strcpy(build_buf, tmp);
ptr = strlen(tmp);
} else
} else {
printf("## VxWorks boot device not specified\n");
}
tmp = env_get("bootfile");
if (tmp)
ptr += sprintf(build_buf + ptr,
"host:%s ", tmp);
ptr += sprintf(build_buf + ptr, "host:%s ", tmp);
else
ptr += sprintf(build_buf + ptr,
"host:vxWorks ");
ptr += sprintf(build_buf + ptr, "host:vxWorks ");
/*
* The following parameters are only needed if 'bootdev'
@ -367,12 +367,9 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
bootline = build_buf;
}
memcpy((void *)bootaddr, bootline,
max(strlen(bootline), (size_t)255));
memcpy((void *)bootaddr, bootline, max(strlen(bootline), (size_t)255));
flush_cache(bootaddr, max(strlen(bootline), (size_t)255));
printf("## Using bootline (@ 0x%lx): %s\n", bootaddr,
(char *)bootaddr);
}
printf("## Using bootline (@ 0x%lx): %s\n", bootaddr, (char *)bootaddr);
#ifdef CONFIG_X86
/*