Skip to content
Snippets Groups Projects
  1. Jul 08, 2022
    • Mattijs Korpershoek's avatar
      HACK: fastboot: mmc: switch back to userdata hwpart after · 14657373
      Mattijs Korpershoek authored
      
      To erase/flash hwpartitions, we first change hwpart from
      EMMC_USER (0) to EMMC_BOOT{1,2} by calling raw_part_get_info_by_name().
      
      However, we don't switch back to EMMC_USER at the end of an erase.
      Therefore, all other fastboot commands are ran on the EMMC_BOOT{1,2}
      hwpart instead of the EMMC_USER hwpart.
      
      For example, the following sequence is broken:
      
      $ fastboot erase bootenv # switch to hwpart 2
      $ fastboot reboot bootloader  # attempts to read GPT from hwpart 2
      
      The GPT being stored in EMMC_USER, the above command generates
      this error:
      
      >  writing 128 blocks starting at 8064...
      >  ........ wrote 65536 bytes to 'bootenv'
      >  GUID Partition Table Header signature is wrong: 0xFB4EC30FC5B7E5B2 != 0x5452415020494645
      >  find_valid_gpt: *** ERROR: Invalid GPT ***
      >  GUID Partition Table Header signature is wrong: 0x0 != 0x5452415020494645
      >  find_valid_gpt: *** ERROR: Invalid Backup GPT ***
      >  Error: mmc 2:misc read failed (-2)
      
      Fix it by switching back to EMMC_USER at the end of mmc_boot_ops().
      
      Note: this is more visible since commit a362ce21 ("fastboot: Implement generic fastboot_set_reboot_flag")
      because "fastboot reboot bootloader" will access the "misc" partition.
      
      Signed-off-by: default avatarMattijs Korpershoek <mkorpershoek@baylibre.com>
      14657373
  2. Jul 05, 2022
  3. Apr 04, 2022
  4. Apr 01, 2022
  5. Mar 31, 2022
  6. Mar 28, 2022
  7. Mar 27, 2022
  8. Mar 26, 2022
Loading