提交 ced71a2f 编写于 作者: B Bin Meng

bootvx: Exit if bootline address is not specified

Exit the 'bootvx' command if bootline address is not specified.
Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
上级 7824ad6a
......@@ -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
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册