diff options
author | fang hui <hui.fang@nxp.com> | 2016-12-16 13:52:42 +0800 |
---|---|---|
committer | fang hui <hui.fang@nxp.com> | 2016-12-16 14:09:25 +0800 |
commit | 9d285f932afa427e057dd073a7b81cace734e503 (patch) | |
tree | c7fe3272bfc2019803f4829998cbade123e07fa6 | |
parent | bc0dca204a1b38566a4960408904649747f8a61b (diff) | |
download | u-boot-imx-9d285f932afa427e057dd073a7b81cace734e503.zip u-boot-imx-9d285f932afa427e057dd073a7b81cace734e503.tar.gz u-boot-imx-9d285f932afa427e057dd073a7b81cace734e503.tar.bz2 |
MA-9116 - [IOT] iot-flashall-imx6ul.sh some times blocked
after flash "gpt" partition.
The issue occurs when slot is ok but gpt partiton is damaged.
After "fastboot flash gpt", the partition table in memory still
has just two entries(gpt and bootloader).
When run "fastboot reboot bootloader", the command should write to
the "misc" partiton. But no entry in the partition table in memory.
After "fastboot flash gpt", Re-load the partition table to memory
can fix it.
Change-Id: I5d3664962aaba12f718e4d7be58e7a223db47746
Signed-off-by: fang hui <hui.fang@nxp.com>
-rw-r--r-- | drivers/usb/gadget/f_fastboot.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c index e18a819..31969d8 100644 --- a/drivers/usb/gadget/f_fastboot.c +++ b/drivers/usb/gadget/f_fastboot.c @@ -3094,11 +3094,18 @@ static void cb_flash(struct usb_ep *ep, struct usb_request *req) rx_process_flash(cmd, response); #ifdef CONFIG_FASTBOOT_LOCK - /* If gpt invalid -> valid, write unlock status, also wipe data. */ 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(); } #endif #else |