diff options
Diffstat (limited to 'drivers/usb/gadget/f_fastboot.c')
-rw-r--r-- | drivers/usb/gadget/f_fastboot.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c index e1e027be1c..a9e92d4225 100644 --- a/drivers/usb/gadget/f_fastboot.c +++ b/drivers/usb/gadget/f_fastboot.c @@ -3426,21 +3426,24 @@ static void cb_flash(struct usb_ep *ep, struct usb_request *req) fb_response_str = response; #ifdef CONFIG_FASTBOOT_LOCK - int status; - status = fastboot_get_lock_stat(); - - if (status == FASTBOOT_LOCK) { - pr_err("device is LOCKed!\n"); - strcpy(response, "FAIL device is locked."); - fastboot_tx_write_str(response); - return; + /* for imx8 boot from USB, lock status can be ignored for uuu.*/ + if (!(is_imx8() || is_imx8m()) || !(is_boot_from_usb())) { + int status; + status = fastboot_get_lock_stat(); + + if (status == FASTBOOT_LOCK) { + pr_err("device is LOCKed!\n"); + strcpy(response, "FAIL device is locked."); + fastboot_tx_write_str(response); + return; - } else if (status == FASTBOOT_LOCK_ERROR) { - pr_err("write lock status into device!\n"); - fastboot_set_lock_stat(FASTBOOT_LOCK); - strcpy(response, "FAILdevice is locked."); - fastboot_tx_write_str(response); - return; + } else if (status == FASTBOOT_LOCK_ERROR) { + pr_err("write lock status into device!\n"); + fastboot_set_lock_stat(FASTBOOT_LOCK); + strcpy(response, "FAILdevice is locked."); + fastboot_tx_write_str(response); + return; + } } #endif fastboot_fail("no flash device defined"); |