Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1360791
| From | Ard Biesheuvel <ard.biesheuvel@linaro.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v2 8/9] efi/arm*: wire up struct screen_info to efi-framebuffer platform device |
| Date | 2016-03-18 17:50 +0100 |
| Message-ID | <re5L5-23u-33@gated-at.bofh.it> (permalink) |
| References | <re5L4-23u-19@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
This adds code to the ARM and arm64 EFI init routines to expose a platform
device of type 'efi-framebuffer' if struct screen_info has been populated
appropriately from the GOP protocol by the stub. Since the framebuffer may
potentially be located in system RAM, make sure that the region is reserved
and marked MEMBLOCK_NOMAP.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
drivers/firmware/efi/arm-init.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/firmware/efi/arm-init.c b/drivers/firmware/efi/arm-init.c
index acd44de30504..f5f13b871d42 100644
--- a/drivers/firmware/efi/arm-init.c
+++ b/drivers/firmware/efi/arm-init.c
@@ -19,6 +19,7 @@
#include <linux/mm_types.h>
#include <linux/of.h>
#include <linux/of_fdt.h>
+#include <linux/platform_device.h>
#include <linux/screen_info.h>
#include <asm/efi.h>
@@ -76,6 +77,10 @@ static void __init init_screen_info(void)
screen_info = *si;
early_memunmap(si, sizeof(*si));
}
+
+ if (screen_info.orig_video_isVGA == VIDEO_TYPE_EFI &&
+ memblock_is_map_memory(screen_info.lfb_base))
+ memblock_mark_nomap(screen_info.lfb_base, screen_info.lfb_size);
}
static int __init uefi_init(void)
@@ -235,3 +240,16 @@ void __init efi_init(void)
init_screen_info();
}
+
+static int __init register_gop_device(void)
+{
+ void *pd;
+
+ if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI)
+ return 0;
+
+ /* the efifb driver accesses screen_info directly, no need to pass it */
+ pd = platform_device_register_simple("efi-framebuffer", 0, NULL, 0);
+ return PTR_ERR_OR_ZERO(pd);
+}
+subsys_initcall(register_gop_device);
--
2.5.0
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2 0/9] EFI framebuffer support for ARM and arm64 Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-03-18 17:50 +0100
[PATCH v2 4/9] efi: efifb: use builtin_platform_driver and drop unused includes Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-03-18 17:50 +0100
[PATCH v2 8/9] efi/arm*: wire up struct screen_info to efi-framebuffer platform device Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-03-18 17:50 +0100
Re: [PATCH v2 8/9] efi/arm*: wire up struct screen_info to efi-framebuffer platform device David Herrmann <dh.herrmann@gmail.com> - 2016-03-21 15:00 +0100
[PATCH v2 3/9] efi/x86: efifb: move DMI based quirks handling out of generic code Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-03-18 17:50 +0100
Re: [PATCH v2 3/9] efi/x86: efifb: move DMI based quirks handling out of generic code David Herrmann <dh.herrmann@gmail.com> - 2016-03-21 15:00 +0100
[PATCH v2 5/9] efi/arm64: libstub: make screen_info accessible to the UEFI stub Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-03-18 17:50 +0100
[PATCH v2 9/9] efifb: enable the efi-framebuffer platform driver for ARM and arm64 Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-03-18 17:50 +0100
[PATCH v2 1/9] efi/x86: prepare GOP handling code for reuse as generic code Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-03-18 17:50 +0100
[PATCH v2 2/9] efi: libstub: move Graphics Output Protocol handling to generic code Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-03-18 18:00 +0100
[PATCH v2 7/9] efi/arm*: libstub: wire up GOP protocol to struct screen_info Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-03-18 18:00 +0100
[PATCH v2 6/9] efi/arm: libstub: make screen_info accessible to the UEFI stub Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-03-18 18:00 +0100
csiph-web