summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfang hui <hui.fang@nxp.com>2016-12-19 14:02:02 +0800
committerfang hui <hui.fang@nxp.com>2016-12-19 14:02:02 +0800
commit442f6237f6d0ca9c45a18d9a2e2cf88a362d619d (patch)
tree358368e55211e75fe7dfee5a1a3fc2b19493818b
parent9d285f932afa427e057dd073a7b81cace734e503 (diff)
downloadu-boot-imx-442f6237f6d0ca9c45a18d9a2e2cf88a362d619d.zip
u-boot-imx-442f6237f6d0ca9c45a18d9a2e2cf88a362d619d.tar.gz
u-boot-imx-442f6237f6d0ca9c45a18d9a2e2cf88a362d619d.tar.bz2
MA-9119 - [IOT] iot-flashall-imx6ul.sh some times exit as
"ERROR: device is LOCKed!" The issue occurs when the "fbmisc" partition is empty. So the decode data is not same as plain text, then goto lock status. When "gpt" change from invalid to valid, set unlock status can fix it. When set unlock status, will fist check current status, if unlock, do nothing. In the previous code, when check lock status, since not re-load partition table to memory, fail to find "fbmisc" partition, So just return unlock status. To fix it, when "gpt" change from invalid to valid, fisrt re-load partition table, then set unlock status. Change-Id: Iec6cfe6bf1030b986d2b839f9c81a3e048d91dcd Signed-off-by: fang hui <hui.fang@nxp.com>
-rwxr-xr-x[-rw-r--r--]drivers/usb/gadget/f_fastboot.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index 31969d8..b1382dd 100644..100755
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -3097,15 +3097,16 @@ static void cb_flash(struct usb_ep *ep, struct usb_request *req)
if (strncmp(cmd, "gpt", 3) == 0) {
gpt_valid_pst = partition_table_valid();
- /* If gpt invalid -> valid, write unlock status, also wipe data. */
- if ((gpt_valid_pre == 0) && (gpt_valid_pst == 1))
- do_fastboot_unlock();
-
/* If gpt is valid, load partitons table into memory.
So if the next command is "fastboot reboot bootloader",
it can find the "misc" partition to r/w. */
if(gpt_valid_pst)
_fastboot_load_partitions();
+
+ /* If gpt invalid -> valid, write unlock status, also wipe data. */
+ if ((gpt_valid_pre == 0) && (gpt_valid_pst == 1)) {
+ do_fastboot_unlock();
+ }
}
#endif
#else