Commit 4495a7a7319df596ef328360209e72988dcc9956
1 parent
1d19996259
Exists in
smarc-imx_v2018.03_4.14.78_1.0.0_ga
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>
Showing 2 changed files with 16 additions and 16 deletions Side-by-side Diff
drivers/usb/gadget/f_fastboot.c
... | ... | @@ -3862,24 +3862,21 @@ |
3862 | 3862 | |
3863 | 3863 | /* Always enable image flash for Android Things. */ |
3864 | 3864 | #if defined(CONFIG_FASTBOOT_LOCK) && !defined(CONFIG_AVB_ATX) |
3865 | - /* for imx8 boot from USB, lock status can be ignored for uuu.*/ | |
3866 | - if (!(is_imx8() || is_imx8m()) || !(is_boot_from_usb())) { | |
3867 | - int status; | |
3868 | - status = fastboot_get_lock_stat(); | |
3865 | + int status; | |
3866 | + status = fastboot_get_lock_stat(); | |
3869 | 3867 | |
3870 | - if (status == FASTBOOT_LOCK) { | |
3871 | - pr_err("device is LOCKed!\n"); | |
3872 | - strcpy(response, "FAIL device is locked."); | |
3873 | - fastboot_tx_write_str(response); | |
3874 | - return; | |
3868 | + if (status == FASTBOOT_LOCK) { | |
3869 | + pr_err("device is LOCKed!\n"); | |
3870 | + strcpy(response, "FAIL device is locked."); | |
3871 | + fastboot_tx_write_str(response); | |
3872 | + return; | |
3875 | 3873 | |
3876 | - } else if (status == FASTBOOT_LOCK_ERROR) { | |
3877 | - pr_err("write lock status into device!\n"); | |
3878 | - fastboot_set_lock_stat(FASTBOOT_LOCK); | |
3879 | - strcpy(response, "FAILdevice is locked."); | |
3880 | - fastboot_tx_write_str(response); | |
3881 | - return; | |
3882 | - } | |
3874 | + } else if (status == FASTBOOT_LOCK_ERROR) { | |
3875 | + pr_err("write lock status into device!\n"); | |
3876 | + fastboot_set_lock_stat(FASTBOOT_LOCK); | |
3877 | + strcpy(response, "FAILdevice is locked."); | |
3878 | + fastboot_tx_write_str(response); | |
3879 | + return; | |
3883 | 3880 | } |
3884 | 3881 | #endif |
3885 | 3882 | fastboot_fail("no flash device defined"); |
drivers/usb/gadget/fastboot_lock_unlock.c
... | ... | @@ -385,6 +385,9 @@ |
385 | 385 | unsigned char *bdata; |
386 | 386 | int mmc_id; |
387 | 387 | FbLockState ret; |
388 | + /* uboot used by uuu will boot from USB, always return UNLOCK state */ | |
389 | + if (is_boot_from_usb()) | |
390 | + return g_lockstat; | |
388 | 391 | |
389 | 392 | bdata = (unsigned char *)memalign(ARCH_DMA_MINALIGN, SECTOR_SIZE); |
390 | 393 | if (bdata == NULL) |