From: Heinrich Schuchardt Date: Thu, 11 Jan 2018 09:07:05 +0100 Subject: [U-Boot] [PATCH 14/17] efi_loader: provide links between devices EFI handles In-Reply-To: <20180111080708.18367-1-xypron.debian@gmx.de> References: <20180111080708.18367-1-xypron.debian@gmx.de> Message-ID: <20180111080708.18367-15-xypron.debian@gmx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Heinrich Schuchardt U-Boot devices and EFI handles can be related, e.g. an IDE disk relates to a handle with the EFI_BLOCK_IO_PROTOCOL. Provide pointers to store these links. Signed-off-by: Heinrich Schuchardt --- include/dm/device.h | 4 ++++ include/efi_loader.h | 2 ++ lib/efi_loader/efi_boottime.c | 1 + 3 files changed, 7 insertions(+) diff --git a/include/dm/device.h b/include/dm/device.h index 813e49f330..e5c54fe7b6 100644 --- a/include/dm/device.h +++ b/include/dm/device.h @@ -11,6 +11,7 @@ #ifndef _DM_DEVICE_H #define _DM_DEVICE_H +#include #include #include #include @@ -144,6 +145,9 @@ struct udevice { uint32_t flags; int req_seq; int seq; +#ifdef EFI_LOADER + efi_handle_t handle; +#endif #ifdef CONFIG_DEVRES struct list_head devres_head; #endif diff --git a/include/efi_loader.h b/include/efi_loader.h index 4060348695..711c901eda 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -139,6 +139,8 @@ struct efi_object { struct list_head protocols; /* The object spawner can either use this for data or as identifier */ void *handle; + /* Device */ + struct udevice *dev; }; /** diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index 5a3349ecb2..4b3b63e39a 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -362,6 +362,7 @@ efi_status_t efi_create_handle(efi_handle_t *handle) (void **)&obj); if (r != EFI_SUCCESS) return r; + obj->dev = NULL; efi_add_handle(obj); *handle = obj->handle; return r; -- 2.14.2