summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2018-08-07 23:45:28 -0700
committerYe Li <ye.li@nxp.com>2018-08-08 01:58:14 -0700
commit46283bf0895462b746bdca864794d5fba8230693 (patch)
tree2b5302cd8e0afd5e4dbd2354e86cabe1bb66bebc
parent42d21af47e86aa821f50f44ace26a15a93fad73a (diff)
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 <ye.li@nxp.com> (cherry picked from commit e64a0eedb1ea84fbdbb67630fba88b92d1b49ed2)
-rw-r--r--drivers/usb/gadget/f_fastboot.c8
1 files 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;
}