summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMiao Yan <miao.yan@windriver.com>2013-11-04 11:18:14 +0800
committerTom Rini <trini@ti.com>2013-11-08 09:41:37 -0500
commit5b629319cf58101b4d623017503d2437714e788a (patch)
tree4a55bc6a2027f480c5b035b8ebb68fe8d06e46f0 /common
parentbb02c5366052f8aa619961e98cd2ef74631ce8f6 (diff)
downloadu-boot-imx-5b629319cf58101b4d623017503d2437714e788a.zip
u-boot-imx-5b629319cf58101b4d623017503d2437714e788a.tar.gz
u-boot-imx-5b629319cf58101b4d623017503d2437714e788a.tar.bz2
common/cmd_bootm.c: fix subcommand processing in OS specific do_bootm_xxx() functions
In commit "5c427e4: use BOOTM_STATE_OS_CMDLINE flag for plain bootm" and "3d187b3: Only pass BOOTM_STATE_OS_CMDLINE on PowerPC/MIPS", BOOTM_STATE_OS_CMDLINE was added to do_bootm for PowerPC and MIPS. This breaks other OSes (vxworks, netbsd, plan9,...) that don't support subcommand processing, e.g. they all contain the following code in their do_bootm_xxx(): if (flag & BOOTM_STATE_OS_PREP) return 0; if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) return 1; which will result a "subcommand not supported" error. This patch changes the above logic to: /* if not go command, pretend everything to be OK */ if (flag != BOOTM_STATE_OS_GO) return 0; Signed-off-by: Miao Yan <miao.yan@windriver.com>
Diffstat (limited to 'common')
-rw-r--r--common/cmd_bootm.c32
1 files changed, 8 insertions, 24 deletions
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 166b901..ba73f57 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -1469,10 +1469,8 @@ static int do_bootm_netbsd(int flag, int argc, char * const argv[],
char *consdev;
char *cmdline;
- if (flag & BOOTM_STATE_OS_PREP)
+ if (flag != BOOTM_STATE_OS_GO)
return 0;
- if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
- return 1;
#if defined(CONFIG_FIT)
if (!images->legacy_hdr_valid) {
@@ -1550,10 +1548,8 @@ static int do_bootm_lynxkdi(int flag, int argc, char * const argv[],
{
image_header_t *hdr = &images->legacy_hdr_os_copy;
- if (flag & BOOTM_STATE_OS_PREP)
+ if (flag != BOOTM_STATE_OS_GO)
return 0;
- if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
- return 1;
#if defined(CONFIG_FIT)
if (!images->legacy_hdr_valid) {
@@ -1574,10 +1570,8 @@ static int do_bootm_rtems(int flag, int argc, char * const argv[],
{
void (*entry_point)(bd_t *);
- if (flag & BOOTM_STATE_OS_PREP)
+ if (flag != BOOTM_STATE_OS_GO)
return 0;
- if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
- return 1;
#if defined(CONFIG_FIT)
if (!images->legacy_hdr_valid) {
@@ -1609,10 +1603,8 @@ static int do_bootm_ose(int flag, int argc, char * const argv[],
{
void (*entry_point)(void);
- if (flag & BOOTM_STATE_OS_PREP)
+ if (flag != BOOTM_STATE_OS_GO)
return 0;
- if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
- return 1;
#if defined(CONFIG_FIT)
if (!images->legacy_hdr_valid) {
@@ -1645,10 +1637,8 @@ static int do_bootm_plan9(int flag, int argc, char * const argv[],
void (*entry_point)(void);
char *s;
- if (flag & BOOTM_STATE_OS_PREP)
+ if (flag != BOOTM_STATE_OS_GO)
return 0;
- if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
- return 1;
#if defined(CONFIG_FIT)
if (!images->legacy_hdr_valid) {
@@ -1694,10 +1684,8 @@ static int do_bootm_vxworks(int flag, int argc, char * const argv[],
{
char str[80];
- if (flag & BOOTM_STATE_OS_PREP)
+ if (flag != BOOTM_STATE_OS_GO)
return 0;
- if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
- return 1;
#if defined(CONFIG_FIT)
if (!images->legacy_hdr_valid) {
@@ -1719,10 +1707,8 @@ static int do_bootm_qnxelf(int flag, int argc, char * const argv[],
char *local_args[2];
char str[16];
- if (flag & BOOTM_STATE_OS_PREP)
+ if (flag != BOOTM_STATE_OS_GO)
return 0;
- if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
- return 1;
#if defined(CONFIG_FIT)
if (!images->legacy_hdr_valid) {
@@ -1746,10 +1732,8 @@ static int do_bootm_integrity(int flag, int argc, char * const argv[],
{
void (*entry_point)(void);
- if (flag & BOOTM_STATE_OS_PREP)
+ if (flag != BOOTM_STATE_OS_GO)
return 0;
- if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
- return 1;
#if defined(CONFIG_FIT)
if (!images->legacy_hdr_valid) {