Skip to content
  • Xavier Drudis Ferran's avatar
    cmd: usb: Prevent reset in usb tree/info command · 7a875a8e
    Xavier Drudis Ferran authored and Marek Vasut's avatar Marek Vasut committed
       Commands causing reset in some configs:
    
    When bootflow scan is run, this will cause a UCLASS_BOOTDEV device to
    be added as sibling of those UCLASS_BLK devices found in the search
    chain defined in environment variable "boot_targets", until boot
    succeeds from some device. This can happen automatically as part of
    the default boot process on some boards (example: Rock Pi 4) depending
    on the board configuration (DISTRO_DEFAULTS, BOOTSTD, BOOTCOMMAND,
    etc.) because they have bootcmd=bootflow scan.
    
    If boot doesn't succeed from any device, and usb is in boot_targets,
    and an usb storage device is plugged to some usb port at boot time,
    its UCLASS_MASS_STORAGE device will have a UCLASS_BOOTDEV device as
    child, besides a UCLASS_BLK child.
    
    If once the boot fails the user enters at the U-Boot shell prompt:
    
    usb info
    
    or
    
    usb tree
    
    The code in cmd/usb.c will eventually recurse into the UCLASS_BOOTDEV
    device and pass a null usb_device pointer to usb_show_tree_graph() ...
    7a875a8e