summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/cmd_fastboot.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/common/cmd_fastboot.c b/common/cmd_fastboot.c
index ab512bb..ef37f8e 100644
--- a/common/cmd_fastboot.c
+++ b/common/cmd_fastboot.c
@@ -1732,10 +1732,15 @@ int do_booti(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
#endif /*CONFIG_SECURE_BOOT*/
#ifdef CONFIG_CMDLINE_TAG
- /* XXX: in production, you should always use boot.img 's cmdline !!! */
- char *commandline = (char *)hdr->cmdline;
- setenv("bootargs", commandline);
+ char *commandline = getenv("bootargs");
+
+ /* If no bootargs env, just use hdr command line */
+ if (!commandline) {
+ commandline = (char *)hdr->cmdline;
+ setenv("bootargs", commandline);
+ }
+ /* XXX: in production, you should always use boot.img 's cmdline !!! */
printf("kernel cmdline:\n");
printf("\tuse boot.img ");
printf("command line:\n\t%s\n", commandline);
@@ -1757,8 +1762,11 @@ int do_booti(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
/*use secondary fields for fdt, second_size= fdt size, second_addr= fdt addr*/
images.ft_addr = (char *)(hdr->second_addr);
images.ft_len = (ulong)(hdr->second_size);
+ set_working_fdt_addr(images.ft_addr);
#endif /*CONFIG_OF_LIBFDT*/
+ arch_preboot_os();
+
do_bootm_linux(0, 0, NULL, &images);
puts("booti: Control returned to monitor - resetting...\n");