aboutsummaryrefslogtreecommitdiffstats
path: root/include/efi_loader.h
diff options
context:
space:
mode:
authorMasahisa Kojima <masahisa.kojima@linaro.org>2022-07-22 11:39:10 +0900
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2022-08-13 11:09:49 +0200
commitee576662947330748b4cca1890d0e1d826d870f4 (patch)
tree2e37da6b72602d31c044db1670d4068caf7d539b /include/efi_loader.h
parente7496e57a045af70fd453f25c827f7c0522a3a71 (diff)
downloadu-boot-ee576662947330748b4cca1890d0e1d826d870f4.tar.gz
efi_loader: move udevice pointer into struct efi_object
This is a preparation patch to provide the unified method to access udevice pointer associated with the EFI handle by adding udevice pointer into struct efi_object. The patch also introduces a helper function efi_link_dev() to link the udevice and EFI handle. The EFI handles of both EFI block io driver implemented in lib/efi_loader/efi_disk.c and EFI block io driver implemented as EFI payload can access the udevice pointer in the struct efi_object. We can use this udevice pointer to get the U-Boot friendly block device name(e.g. mmc 0:1, nvme 0:1) through EFI handle. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'include/efi_loader.h')
-rw-r--r--include/efi_loader.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/efi_loader.h b/include/efi_loader.h
index 3a63a1f75fd..b0d6fff67c5 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -375,6 +375,7 @@ enum efi_object_type {
* @protocols: linked list with the protocol interfaces installed on this
* handle
* @type: image type if the handle relates to an image
+ * @dev: pointer to the DM device which is associated with this EFI handle
*
* UEFI offers a flexible and expandable object model. The objects in the UEFI
* API are devices, drivers, and loaded images. struct efi_object is our storage
@@ -392,6 +393,7 @@ struct efi_object {
/* The list of protocols */
struct list_head protocols;
enum efi_object_type type;
+ struct udevice *dev;
};
enum efi_image_auth_status {
@@ -690,6 +692,8 @@ struct efi_device_path *efi_get_dp_from_boot(const efi_guid_t guid);
const char *guid_to_sha_str(const efi_guid_t *guid);
int algo_to_len(const char *algo);
+int efi_link_dev(efi_handle_t handle, struct udevice *dev);
+
/**
* efi_size_in_pages() - convert size in bytes to size in pages
*