From 46283bf0895462b746bdca864794d5fba8230693 Mon Sep 17 00:00:00 2001 From: Ye Li Date: Tue, 7 Aug 2018 23:45:28 -0700 Subject: MLK-19132-1 fastboot: Use CONFIG_BCB_SUPPORT to control bcb relevant operations BSP u-boot has enabled fastboot for uuu. But the BCB is not needed. It will gives some errors during u-boot boot up. This patch uses CONFIG_BCB_SUPPORT to control bcb codes, so that BSP u-boot can disable it. Signed-off-by: Ye Li (cherry picked from commit e64a0eedb1ea84fbdbb67630fba88b92d1b49ed2) --- drivers/usb/gadget/f_fastboot.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c index c838d46f22..9f4c11b34e 100644 --- a/drivers/usb/gadget/f_fastboot.c +++ b/drivers/usb/gadget/f_fastboot.c @@ -1764,23 +1764,26 @@ void fastboot_setup(void) /* Write the bcb with fastboot bootloader commands */ static void enable_fastboot_command(void) { +#ifdef CONFIG_BCB_SUPPORT char fastboot_command[32] = {0}; strncpy(fastboot_command, FASTBOOT_BCB_CMD, 31); bcb_write_command(fastboot_command); +#endif } /* Get the Boot mode from BCB cmd or Key pressed */ static FbBootMode fastboot_get_bootmode(void) { - int ret = 0; int boot_mode = BOOTMODE_NORMAL; - char command[32]; #ifdef CONFIG_ANDROID_RECOVERY if(is_recovery_key_pressing()) { boot_mode = BOOTMODE_RECOVERY_KEY_PRESSED; return boot_mode; } #endif +#ifdef CONFIG_BCB_SUPPORT + int ret = 0; + char command[32]; ret = bcb_read_command(command); if (ret < 0) { printf("read command failed\n"); @@ -1799,6 +1802,7 @@ static FbBootMode fastboot_get_bootmode(void) no matter what in the mode string */ memset(command, 0, 32); bcb_write_command(command); +#endif return boot_mode; } -- cgit v1.2.3