[PATCH 0/2] efi_loader: provide media ID

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Thu Sep 15 22:02:40 CEST 2022


The medium a device like 'mmc 0' or 'usb 0' points to may change over
time. Hence device type and number are not sufficient to identify the
inserted medium. The same is true for the device path generated for
such a device. This is why the EFI_BLOCK_IO_PROTOCOL provides a field
MediaId.

Whenever a removable medium is changed or a new block device with a
previously used device path is created we should provide a different
MediaID.

This series adds a field media_id to the block device descriptor and fills
it after probing. The value of the field is then copied to the
EFI_BLOCK_IO_PROTOCOL.

With future patches we can refine this in sub-systems like USB, MMC, SCSI
to indicate media changes

Heinrich Schuchardt (2):
  dm: blk: assign media ID to block devices
  efi_loader: fill media_id from block device descriptor

 drivers/block/blk-uclass.c | 16 +++++++++++++++-
 include/blk.h              | 11 +++++++++++
 lib/efi_loader/efi_disk.c  |  6 +-----
 3 files changed, 27 insertions(+), 6 deletions(-)

-- 
2.37.2



More information about the U-Boot mailing list