Skip to content
Snippets Groups Projects
  1. Aug 11, 2022
  2. Jul 08, 2022
    • Mattijs Korpershoek's avatar
      HACK: board: vim3: reset usb controller upon system reset · d58a0133
      Mattijs Korpershoek authored
      
      On the VIM3L board, with some USB cables/hosts, there is a long (5s)
      delay before between "fastboot reboot" and the host detecting a USB
      reset.
      
      This breaks tools relying on "fastboot reboot fastboot" which assume
      that 1s after the command send, the board should disconnect on usb.
      
      To reproduce, enable fastboot in U-Boot console:
      => fastboot usb 0
      
      Then, on the host, run:
        # echo "running fastboot reboot bootloader" > /dev/kmsg && fastboot reboot bootloader
        Rebooting into bootloader                          OKAY [  0.003s]
        Finished. Total time: 3.033s
      
        [54074.251551] running fastboot reboot bootloader
        ... there is a delay of 5s before we detect a disconnection ...
        [54079.041238] usb 1-7.4: USB disconnect, device number 72
        [54079.239625] usb 1-7.4: new high-speed USB device number 73 using xhci_hcd
        [54079.359103] usb 1-7.4: New USB device found, idVendor=1b8e, idProduct=fada, bcdDevice= 2.27
        [54079.359110] usb 1-7.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
        [54079.359112] usb 1-7.4: Product: USB download gadget
        [54079.359114] usb 1-7.4: Manufacturer: U-Boot
        [54079.359116] usb 1-7.4: SerialNumber: C8631470CC41
      
      Note: this does not happen when we use the RST button on the board, nor in linux.
      
      Resetting the usb controller before psci_reset fixes this.
      
      Signed-off-by: default avatarMattijs Korpershoek <mkorpershoek@baylibre.com>
      d58a0133
    • 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
  3. Jul 05, 2022
  4. Apr 04, 2022
  5. Apr 01, 2022
  6. Mar 31, 2022
  7. Mar 28, 2022
Loading