summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2016-03-15 18:38:21 +0100
committerTom Rini <trini@konsulko.com>2016-03-27 09:12:12 -0400
commitbe8d324191f3cd2f4861629ccf69106d58aaa70f (patch)
tree440530288dbfb18f9bdd4d7b1294e37a7a00112e /include
parent705c506e4faa7c22b492a1c560f7de86fcbcc913 (diff)
downloadtalos-obmc-uboot-be8d324191f3cd2f4861629ccf69106d58aaa70f.tar.gz
talos-obmc-uboot-be8d324191f3cd2f4861629ccf69106d58aaa70f.zip
efi_loader: Add GOP support
The EFI standard defines a simple boot protocol that an EFI payload can use to access video output. This patch adds support to expose exactly that one (and the mode already in use) as possible graphical configuration to an EFI payload. With this, I can successfully run grub2 with graphical output. Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'include')
-rw-r--r--include/efi_api.h47
-rw-r--r--include/efi_loader.h2
2 files changed, 49 insertions, 0 deletions
diff --git a/include/efi_api.h b/include/efi_api.h
index 03f6687aae..696044850b 100644
--- a/include/efi_api.h
+++ b/include/efi_api.h
@@ -365,4 +365,51 @@ struct efi_console_control_protocol
uint16_t *password);
};
+#define EFI_GOP_GUID \
+ EFI_GUID(0x9042a9de, 0x23dc, 0x4a38, \
+ 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a)
+
+#define EFI_GOT_RGBA8 0
+#define EFI_GOT_BGRA8 1
+#define EFI_GOT_BITMASK 2
+
+struct efi_gop_mode_info
+{
+ u32 version;
+ u32 width;
+ u32 height;
+ u32 pixel_format;
+ u32 pixel_bitmask[4];
+ u32 pixels_per_scanline;
+};
+
+struct efi_gop_mode
+{
+ u32 max_mode;
+ u32 mode;
+ struct efi_gop_mode_info *info;
+ unsigned long info_size;
+ efi_physical_addr_t fb_base;
+ unsigned long fb_size;
+};
+
+#define EFI_BLT_VIDEO_FILL 0
+#define EFI_BLT_VIDEO_TO_BLT_BUFFER 1
+#define EFI_BLT_BUFFER_TO_VIDEO 2
+#define EFI_BLT_VIDEO_TO_VIDEO 3
+
+struct efi_gop
+{
+ efi_status_t (EFIAPI *query_mode)(struct efi_gop *this, u32 mode_number,
+ unsigned long *size_of_info,
+ struct efi_gop_mode_info **info);
+ efi_status_t (EFIAPI *set_mode)(struct efi_gop *this, u32 mode_number);
+ efi_status_t (EFIAPI *blt)(struct efi_gop *this, void *buffer,
+ unsigned long operation, unsigned long sx,
+ unsigned long sy, unsigned long dx,
+ unsigned long dy, unsigned long width,
+ unsigned long height, unsigned long delta);
+ struct efi_gop_mode *mode;
+};
+
#endif
diff --git a/include/efi_loader.h b/include/efi_loader.h
index 74bed26662..9f61fc4b12 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -89,6 +89,8 @@ extern struct list_head efi_obj_list;
/* Called by bootefi to make all disk storage accessible as EFI objects */
int efi_disk_register(void);
+/* Called by bootefi to make GOP (graphical) interface available */
+int efi_gop_register(void);
/*
* Stub implementation for a protocol opener that just returns the handle as
* interface
OpenPOWER on IntegriCloud