Guide for fixing boot issues from u-boot USB stack causing boot delays or hangs

USB is a very complex stack that requires interrupts and device matching to handle quirks from various devices. Generic enumeration can sometimes result in hangs due to device misbehavior.

Libre Computer boards have built-in u-boot and the behavior can be customized to work around some device issues. These specific environment variables can be set via boot.ini to adjust the runtime probing of devices.

  1. boot_targets=mmc0

By default, bootstd will scan all devices for bootable targets. This include scanning all USB devices, which may hang or have issues enumerating. By setting boot_targets to mmc0, bootstd only scans eMMC (mmc0) and avoids probing issues.

  1. preboot=

By default, our boards run DFU update over USB and USB probing by default. If there is a device on the USB bus that cause an stack issue, this cause delay or hang the system. By avoiding USB enumeration completely, we can bypass this and let Linux handle it with its more advanced USB stack.

  1. stdin=serial

Standard input is set to USB keyboard and serial stdin=usbkbd,serial. By removing the USB keyboard, we avoid probing the USB bus.

  1. bootdelay=0

By default, there’s an one second delay during boot to enter the bootmenu. To avoid the boot delay, set the environment variable to 0.