diff options
author | Bin Meng <bmeng.cn@gmail.com> | 2018-06-12 08:36:21 -0700 |
---|---|---|
committer | Bin Meng <bmeng.cn@gmail.com> | 2018-06-17 21:16:04 +0800 |
commit | d1fe9927465c3df03c7c0c8f62bd8468d24f66bc (patch) | |
tree | 824da8a88dd2c1f993bc82564fa395341a0a510b /lib/efi | |
parent | 252d41f1ae59974c8a9120c994c0688fb9cec2b7 (diff) | |
download | u-boot-d1fe9927465c3df03c7c0c8f62bd8468d24f66bc.tar.gz u-boot-d1fe9927465c3df03c7c0c8f62bd8468d24f66bc.tar.bz2 u-boot-d1fe9927465c3df03c7c0c8f62bd8468d24f66bc.zip |
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 'lib/efi')
-rw-r--r-- | lib/efi/efi_stub.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/efi/efi_stub.c b/lib/efi/efi_stub.c index 9deffe220f..262fc56562 100644 --- a/lib/efi/efi_stub.c +++ b/lib/efi/efi_stub.c @@ -275,6 +275,9 @@ efi_status_t EFIAPI efi_main(efi_handle_t image, struct efi_boot_services *boot = sys_table->boottime; struct efi_mem_desc *desc; struct efi_entry_memmap map; + struct efi_gop *gop; + struct efi_entry_gopmode mode; + efi_guid_t efi_gop_guid = EFI_GOP_GUID; efi_uintn_t key, desc_size, size; efi_status_t ret; u32 version; @@ -313,6 +316,18 @@ efi_status_t EFIAPI efi_main(efi_handle_t image, if (ret) return ret; + ret = boot->locate_protocol(&efi_gop_guid, NULL, (void **)&gop); + if (ret) { + puts(" GOP unavailable\n"); + } else { + mode.fb_base = gop->mode->fb_base; + mode.fb_size = gop->mode->fb_size; + mode.info_size = gop->mode->info_size; + add_entry_addr(priv, EFIET_GOP_MODE, &mode, sizeof(mode), + gop->mode->info, + sizeof(struct efi_gop_mode_info)); + } + ret = boot->get_memory_map(&size, desc, &key, &desc_size, &version); if (ret) { printhex2(ret); |