Commit e3271c96 authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Ingo Molnar
Browse files

efi/arm*: Wire up 'struct screen_info' to efi-framebuffer platform device

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: default avatarArd Biesheuvel <>
Signed-off-by: default avatarMatt Fleming <>
Cc: Borislav Petkov <>
Cc: David Herrmann <>
Cc: Mark Rutland <>
Cc: Peter Jones <>
Cc: Peter Zijlstra <>
Cc: Thomas Gleixner <>
Cc: Will Deacon <>

Signed-off-by: default avatarIngo Molnar <>
parent f0827e18
......@@ -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>
......@@ -78,6 +79,10 @@ static void __init init_screen_info(void)
screen_info.orig_video_cols = 80;
screen_info.orig_video_lines = 25;
if (screen_info.orig_video_isVGA == VIDEO_TYPE_EFI &&
memblock_mark_nomap(screen_info.lfb_base, screen_info.lfb_size);
static int __init uefi_init(void)
......@@ -256,3 +261,16 @@ void __init efi_init(void)
static int __init register_gop_device(void)
void *pd;
if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI)
return 0;
pd = platform_device_register_data(NULL, "efi-framebuffer", 0,
&screen_info, sizeof(screen_info));
return PTR_ERR_OR_ZERO(pd);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment