[U-Boot] [RFC] Design of UEFI drivers

Heinrich Schuchardt xypron.glpk at gmx.de
Tue Dec 12 19:57:33 UTC 2017


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

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.

Looking forward to your ideas.

Best regards

Heinrich


More information about the U-Boot mailing list