public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 0/2] efi_loader: fix device-path for USB devices
@ 2023-03-19 15:18 Heinrich Schuchardt
  2023-03-19 15:18 ` [PATCH 1/2] efi_loader: support for Ctrl() device path node Heinrich Schuchardt
  2023-03-19 15:18 ` [PATCH 2/2] efi_loader: fix device-path for USB devices Heinrich Schuchardt
  0 siblings, 2 replies; 13+ messages in thread
From: Heinrich Schuchardt @ 2023-03-19 15:18 UTC (permalink / raw)
  To: Ilias Apalodimas; +Cc: u-boot, Heinrich Schuchardt

EFI device paths for block devices must be unique. If a non-unique device
path is discovered, probing of the block device fails.

Currently we use UsbClass() device path nodes. As multiple devices may
have the same vendor and product id these are non-unique. Instead we
should use Usb() device path nodes. They include the USB port on the
parent hub and hence are unique.

A USB storage device may contain multiple logical units. These can be
modeled as Ctrl() nodes.

Given a driver model tree

    root       0 root_driver   root_driver
    usb        0 ehci_generic  |-- usb@1c1a000
    usb_hub    0 usb_hub          `-- usb_hub
    usb_hub    1 usb_hub              `-- usb_hub
    usb_mass_s 2 usb_mass_storage         `-- usb_mass_storage
    blk        4 usb_storage_blk              |-- usb_mass_storage.lun0

where the USB mass storage device is connected to port 4 of the 2nd hub,
the device path for LUN 0 will be:

    /VenHw()/USB(0x0,0x0)/USB(0x1,0x0)/USB(0x4,0x0)/Ctrl(0x0)

Heinrich Schuchardt (2):
  efi_loader: support for Ctrl() device path node
  efi_loader: fix device-path for USB devices

 include/efi_api.h                        |  6 ++++
 lib/efi_loader/efi_device_path.c         | 45 +++++++++++++++++-------
 lib/efi_loader/efi_device_path_to_text.c |  7 ++++
 3 files changed, 46 insertions(+), 12 deletions(-)

-- 
2.39.2


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-03-27  8:26 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-19 15:18 [PATCH 0/2] efi_loader: fix device-path for USB devices Heinrich Schuchardt
2023-03-19 15:18 ` [PATCH 1/2] efi_loader: support for Ctrl() device path node Heinrich Schuchardt
2023-03-19 19:29   ` Simon Glass
2023-03-20  7:39   ` Ilias Apalodimas
2023-03-19 15:18 ` [PATCH 2/2] efi_loader: fix device-path for USB devices Heinrich Schuchardt
2023-03-19 19:29   ` Simon Glass
2023-03-19 20:58     ` Heinrich Schuchardt
2023-03-20 18:39       ` Simon Glass
2023-03-21 13:21         ` Heinrich Schuchardt
2023-03-27  4:00           ` Simon Glass
2023-03-27  5:30             ` Heinrich Schuchardt
2023-03-27  8:24               ` Simon Glass
2023-03-20  7:58   ` Ilias Apalodimas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox