Commit 358efa24b714738ce145fa60f0b4d194b68c4c49

Authored by faqiang.zhu
Committed by Ye Li
1 parent 5eb328e3f0

MA-16954 set partition type to efi after flash gpt partition

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)

Showing 1 changed file with 12 additions and 0 deletions Side-by-side Diff

drivers/fastboot/fb_fsl/fb_fsl_command.c
... ... @@ -831,6 +831,18 @@
831 831 #if defined(CONFIG_FASTBOOT_LOCK)
832 832 if (strncmp(cmd, "gpt", 3) == 0) {
833 833 int gpt_valid = 0;
  834 + int status, mmc_no;
  835 + struct blk_desc *dev_desc;
  836 + mmc_no = fastboot_devinfo.dev_id;
  837 + dev_desc = blk_get_dev("mmc", mmc_no);
  838 + if (dev_desc) {
  839 + if (dev_desc->part_type != PART_TYPE_EFI)
  840 + dev_desc->part_type = PART_TYPE_EFI;
  841 + }
  842 + else {
  843 + fastboot_fail("", response);
  844 + return;
  845 + }
834 846 gpt_valid = partition_table_valid();
835 847 /* If gpt is valid, load partitons table into memory.
836 848 So if the next command is "fastboot reboot bootloader",