summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorfaqiang.zhu <faqiang.zhu@nxp.com>2018-12-06 20:06:56 +0800
committerfaqiang.zhu <faqiang.zhu@nxp.com>2018-12-06 20:37:47 +0800
commit4495a7a7319df596ef328360209e72988dcc9956 (patch)
tree778a976685794c412256696445cc1b67494d5544 /drivers
parent1d19996259592176d21e2c393180027d571fb658 (diff)
MA-13715 Alway return UNLOCK state for uboot boot from USB
Now "is_boot_from_usb()" can work for imx6, imx7 and imx8, use this function to judge whether boot from USB, and then return FASTBOOT_UNLOCK. This can save some time for imx8 to flash images if the board is locked. Change-Id: Iaa63f326f33400f2fdf13bf2e175cd9ac7d60317 Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/gadget/f_fastboot.c29
-rw-r--r--drivers/usb/gadget/fastboot_lock_unlock.c3
2 files changed, 16 insertions, 16 deletions
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index 2898d71af4..f853527345 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -3862,24 +3862,21 @@ static void cb_flash(struct usb_ep *ep, struct usb_request *req)
/* Always enable image flash for Android Things. */
#if defined(CONFIG_FASTBOOT_LOCK) && !defined(CONFIG_AVB_ATX)
- /* 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();
+ 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;
+ 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");
diff --git a/drivers/usb/gadget/fastboot_lock_unlock.c b/drivers/usb/gadget/fastboot_lock_unlock.c
index 2a377f9ebd..06d21e73b8 100644
--- a/drivers/usb/gadget/fastboot_lock_unlock.c
+++ b/drivers/usb/gadget/fastboot_lock_unlock.c
@@ -385,6 +385,9 @@ FbLockState fastboot_get_lock_stat(void) {
unsigned char *bdata;
int mmc_id;
FbLockState ret;
+ /* uboot used by uuu will boot from USB, always return UNLOCK state */
+ if (is_boot_from_usb())
+ return g_lockstat;
bdata = (unsigned char *)memalign(ARCH_DMA_MINALIGN, SECTOR_SIZE);
if (bdata == NULL)