diff options
author | Lihua Zhao <lihua.zhao@windriver.com> | 2019-11-15 00:21:17 -0800 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-12-03 08:43:23 -0500 |
commit | 1e26f648885719cb6a105ae3562e8d840e75a6b8 (patch) | |
tree | da6eb468bce859e1fe827858172f134f5089005b /common/bootm_os.c | |
parent | 9a94a8994aa9f3722a832cd5c84af24c5eaab5e8 (diff) | |
download | u-boot-1e26f648885719cb6a105ae3562e8d840e75a6b8.zip u-boot-1e26f648885719cb6a105ae3562e8d840e75a6b8.tar.gz u-boot-1e26f648885719cb6a105ae3562e8d840e75a6b8.tar.bz2 |
bootm: vxworks: Support Linux compatible standard DTB for ARM and PPC
Enhance do_bootm_vxworks() to support Linux compatible standard DTB
for ARM and PPC, when the least significant bit of flags in VxWorks
bootargs is set. Otherwise it falls back to the existing bootm flow
which is now legacy.
Signed-off-by: Lihua Zhao <lihua.zhao@windriver.com>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'common/bootm_os.c')
-rw-r--r-- | common/bootm_os.c | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/common/bootm_os.c b/common/bootm_os.c index de0709f..d89ddc3 100644 --- a/common/bootm_os.c +++ b/common/bootm_os.c @@ -319,8 +319,8 @@ static void do_bootvx_fdt(bootm_headers_t *images) puts("## vxWorks terminated\n"); } -int do_bootm_vxworks(int flag, int argc, char * const argv[], - bootm_headers_t *images) +static int do_bootm_vxworks_legacy(int flag, int argc, char * const argv[], + bootm_headers_t *images) { if (flag != BOOTM_STATE_OS_GO) return 0; @@ -336,6 +336,41 @@ int do_bootm_vxworks(int flag, int argc, char * const argv[], return 1; } + +int do_bootm_vxworks(int flag, int argc, char * const argv[], + bootm_headers_t *images) +{ + char *bootargs; + int pos; + unsigned long vxflags; + bool std_dtb = false; + + /* get bootargs env */ + bootargs = env_get("bootargs"); + + if (bootargs != NULL) { + for (pos = 0; pos < strlen(bootargs); pos++) { + /* find f=0xnumber flag */ + if ((bootargs[pos] == '=') && (pos >= 1) && + (bootargs[pos - 1] == 'f')) { + vxflags = simple_strtoul(&bootargs[pos + 1], + NULL, 16); + if (vxflags & VXWORKS_SYSFLG_STD_DTB) + std_dtb = true; + } + } + } + + if (std_dtb) { + if (flag & BOOTM_STATE_OS_PREP) + printf(" Using standard DTB\n"); + return do_bootm_linux(flag, argc, argv, images); + } else { + if (flag & BOOTM_STATE_OS_PREP) + printf(" !!! WARNING !!! Using legacy DTB\n"); + return do_bootm_vxworks_legacy(flag, argc, argv, images); + } +} #endif #if defined(CONFIG_CMD_ELF) |