summaryrefslogtreecommitdiff
path: root/include/efi.h
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2018-06-12 18:36:21 +0300
committerBin Meng <bmeng.cn@gmail.com>2018-06-17 16:16:04 +0300
commitd1fe9927465c3df03c7c0c8f62bd8468d24f66bc (patch)
tree824da8a88dd2c1f993bc82564fa395341a0a510b /include/efi.h
parent252d41f1ae59974c8a9120c994c0688fb9cec2b7 (diff)
downloadu-boot-d1fe9927465c3df03c7c0c8f62bd8468d24f66bc.tar.xz
efi: stub: Pass EFI GOP information to U-Boot payload
If UEFI BIOS has the graphics output protocol (GOP), let's pass its information to U-Boot payload so that U-Boot can utilize it (eg: an EFI framebuffer driver). Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/efi.h')
-rw-r--r--include/efi.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/include/efi.h b/include/efi.h
index e30a3c51c6..2448dde3fe 100644
--- a/include/efi.h
+++ b/include/efi.h
@@ -241,6 +241,7 @@ struct efi_open_protocol_info_entry {
enum efi_entry_t {
EFIET_END, /* Signals this is the last (empty) entry */
EFIET_MEMORY_MAP,
+ EFIET_GOP_MODE,
/* Number of entries */
EFIET_MEMORY_COUNT,
@@ -297,6 +298,40 @@ struct efi_entry_memmap {
struct efi_mem_desc desc[];
};
+/**
+ * struct efi_entry_gopmode - a GOP mode table passed to U-Boot
+ *
+ * @fb_base: EFI's framebuffer base address
+ * @fb_size: EFI's framebuffer size
+ * @info_size: GOP mode info structure size
+ * @info: Start address of the GOP mode info structure
+ */
+struct efi_entry_gopmode {
+ efi_physical_addr_t fb_base;
+ /*
+ * Not like the ones in 'struct efi_gop_mode' which are 'unsigned
+ * long', @fb_size and @info_size have to be 'u64' here. As the EFI
+ * stub codes may have different bit size from the U-Boot payload,
+ * using 'long' will cause mismatch between the producer (stub) and
+ * the consumer (payload).
+ */
+ u64 fb_size;
+ u64 info_size;
+ /*
+ * We cannot directly use 'struct efi_gop_mode_info info[]' here as
+ * it causes compiler to complain: array type has incomplete element
+ * type 'struct efi_gop_mode_info'.
+ */
+ struct /* efi_gop_mode_info */ {
+ u32 version;
+ u32 width;
+ u32 height;
+ u32 pixel_format;
+ u32 pixel_bitmask[4];
+ u32 pixels_per_scanline;
+ } info[];
+};
+
static inline struct efi_mem_desc *efi_get_next_mem_desc(
struct efi_entry_memmap *map, struct efi_mem_desc *desc)
{