From 76b5adb221c479d6cbf4c21b8dd086e213680cf0 Mon Sep 17 00:00:00 2001 From: "Ye.Li" Date: Tue, 14 Jan 2014 17:09:07 +0800 Subject: ENGR00295163 ARM:imx6 Fix kernel halt when upgrading android to 3.10.17 The function "arch_preboot_os" is missed in booti, so ldo is not bypassed and fb is not shutdown, those cause kernel halt in booting. Meanwhile, modify the booti use "bootargs" environment to overwrite commandline in bootimg. Signed-off-by: Ye.Li --- common/cmd_fastboot.c | 14 +++++++++++--- 1 file 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"); -- cgit v1.1