diff options
author | guoyin.chen <guoyin.chen@nxp.com> | 2017-09-12 19:22:59 +0800 |
---|---|---|
committer | guoyin.chen <guoyin.chen@nxp.com> | 2017-09-12 19:28:54 +0800 |
commit | 2f355e42f80666d465bd2320f12826830b5fb3b9 (patch) | |
tree | 98cb3ddb9959595921cec5f2d64bcf903f182952 | |
parent | 9ba5c8eb96fca3eb3665a9fff5727aec68bc8310 (diff) |
MA-10217 bootloader mode not function if there is a unknown cmd in misc
System cannot run into bootloader/recovery mode once there is unknown cmd
in misc partition as:
1. uboot will never clean the unknown cmd.
2. init will never overwrite the unknown cmd.
arm2_8q:/ # reboot bootloader
init: [libfs_mgr]fs_mgr_read_fstab_dt(): failed to read fstab from dt
init: reboot-bootloader: Error writing bootloader_message: Bootloader command pending.
init: Reboot start, reason: reboot,bootloader, rebootTarget: bootloader
Change-Id: I51043e7cbde3f3e508c5fe99e9dba27e5f99f443
Signed-off-by: guoyin.chen <guoyin.chen@nxp.com>
-rwxr-xr-x | drivers/usb/gadget/f_fastboot.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c index ce8ea9bdd7..8d2996d0c7 100755 --- a/drivers/usb/gadget/f_fastboot.c +++ b/drivers/usb/gadget/f_fastboot.c @@ -1909,17 +1909,18 @@ static FbBootMode fastboot_get_bootmode(void) return boot_mode; } if (!strcmp(command, FASTBOOT_BCB_CMD)) { - memset(command, 0, 32); - bcb_write_command(command); boot_mode = BOOTMODE_FASTBOOT_BCB_CMD; } #ifdef CONFIG_ANDROID_RECOVERY else if (!strcmp(command, RECOVERY_BCB_CMD)) { - memset(command, 0, 32); - bcb_write_command(command); boot_mode = BOOTMODE_RECOVERY_BCB_CMD; } #endif + + /* Clean the mode once its read out, + no matter what in the mode string */ + memset(command, 0, 32); + bcb_write_command(command); return boot_mode; } |