[U-Boot] [RFC] Design of UEFI drivers
Simon Glass
sjg at chromium.org
Tue Dec 19 15:41:38 UTC 2017
Hi Heinrich,
On 12 December 2017 at 12:57, Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
> 2a92080d8c4 [PATCH] efi_loader: add file/filesys support
> implemented the EFI_SIMPLE_FILE_SYSTEM_PROTOCOL.
>
> Unfortunately it assumes that the available media are constant.
>
> iPXE offers the possibility to attach iSCSI targets. On the handle for
> the attached target the EFI_BLOCK_IO_PROTOCOL and the
> EFI_DEVICE_PATH_PROTOCOL are installed.
>
> Afterwards the ConnectController boot service is called to connect
> drivers to the iSCSI target. This relates to the following statement in
> the UEFI spec:
>
> The firmware automatically creates handles for any block device that
> supports the following file system formats:
> - FAT12
> - FAT16
> - FAT32
Doesn't it have to probe the device to do this? Can this be done in a
lazy fashion, or must it be done up front?
>
> iPXE expects that the driver for the EFI_SIMPLE_FILE_SYSTEM_PROTOCOL
> gets installed to a child handle representing the partitions of the
> attached iSCSI target.
>
> So I think we have to rewrite the EFI_SIMPLE_FILE_SYSTEM_PROTOCOL
> implementation as an UEFI driver. The driver handle shall implement the
> EFI_DRIVER_BINDING_PROTOCOL. For each attached disk we shall call the
> ConnectController boot service. It will call the supported() service for
> the driver binding protocol and in case of success the start() service.
> The driver will in turn install the EFI_SIMPLE_FILE_SYSTEM_PROTOCOL on
> the block io device.
>
> The same pattern could be applied to the simple
> EFI_SIMPLE_NETWORK_PROTOCOL and the EFI_GRAPHICS_OUTPUT_PROTOCOL.
>
> I now wonder what would be the best design. Should we have a uclass
> comprising all UEFI drivers? This would allow generating the UEFI driver
> handles by iterating the members of the uclass.
One idea is to attach a UEFI device (in a UEFI uclass) to each U-Boot
device that supports UEFI, as a child. Then you can iterate through
the uclass and find all the UEFI devices, plus you can look at the
parent device to get information about it.
That would also help to make UEFI support more consistent with driver model.
>
> Looking forward to your ideas.
>
> Best regards
>
> Heinrich
Regards,
Simon
More information about the U-Boot
mailing list