If the target device have DOS partition, uboot will save the partition
type as dos partition at early stage when the driver bind the device.
After the gpt partition is flashed, uboot will try to reload the DOS
partition, instead of the the EFI partition.
In this commit, if the GPT partition is successfully flashed, set the
partition type to be PART_TYPE_EFI if necessary, so the EFI partitions
will be reloaded.
Change-Id: I6095cb56c73aecee24f76d169db89daba3783e29
Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
(cherry picked from commit
62becd667e5f3ebbefef796818eda78f4d0e167b)
(cherry picked from commit
358efa24b714738ce145fa60f0b4d194b68c4c49)
#if defined(CONFIG_FASTBOOT_LOCK)
if (strncmp(cmd, "gpt", 3) == 0) {
int gpt_valid = 0;
+ int mmc_no;
+ struct blk_desc *dev_desc;
+ mmc_no = fastboot_devinfo.dev_id;
+ dev_desc = blk_get_dev("mmc", mmc_no);
+ if (dev_desc) {
+ if (dev_desc->part_type != PART_TYPE_EFI)
+ dev_desc->part_type = PART_TYPE_EFI;
+ }
+ else {
+ fastboot_fail("", response);
+ return;
+ }
gpt_valid = partition_table_valid();
/* If gpt is valid, load partitons table into memory.
So if the next command is "fastboot reboot bootloader",