From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753128AbcD1KkT (ORCPT ); Thu, 28 Apr 2016 06:40:19 -0400 Received: from terminus.zytor.com ([198.137.202.10]:47944 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752376AbcD1KkR (ORCPT ); Thu, 28 Apr 2016 06:40:17 -0400 Date: Thu, 28 Apr 2016 03:39:11 -0700 From: tip-bot for Ard Biesheuvel Message-ID: Cc: matt@codeblueprint.co.uk, pjones@redhat.com, bp@alien8.de, mingo@kernel.org, mark.rutland@arm.com, linux-kernel@vger.kernel.org, hpa@zytor.com, dh.herrmann@gmail.com, ard.biesheuvel@linaro.org, will.deacon@arm.com, peterz@infradead.org, tglx@linutronix.de Reply-To: matt@codeblueprint.co.uk, bp@alien8.de, pjones@redhat.com, mingo@kernel.org, hpa@zytor.com, mark.rutland@arm.com, linux-kernel@vger.kernel.org, dh.herrmann@gmail.com, ard.biesheuvel@linaro.org, tglx@linutronix.de, will.deacon@arm.com, peterz@infradead.org In-Reply-To: <1461614832-17633-24-git-send-email-matt@codeblueprint.co.uk> References: <1461614832-17633-24-git-send-email-matt@codeblueprint.co.uk> To: linux-tip-commits@vger.kernel.org Subject: [tip:efi/core] efi/arm*: Wire up 'struct screen_info' to efi-framebuffer platform device Git-Commit-ID: e3271c96ca7d01957b03b5f1e2bdc00e08fd7160 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: e3271c96ca7d01957b03b5f1e2bdc00e08fd7160 Gitweb: http://git.kernel.org/tip/e3271c96ca7d01957b03b5f1e2bdc00e08fd7160 Author: Ard Biesheuvel AuthorDate: Mon, 25 Apr 2016 21:06:55 +0100 Committer: Ingo Molnar CommitDate: Thu, 28 Apr 2016 11:34:01 +0200 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: Ard Biesheuvel Signed-off-by: Matt Fleming Cc: Borislav Petkov Cc: David Herrmann Cc: Mark Rutland Cc: Peter Jones Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Will Deacon Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/1461614832-17633-24-git-send-email-matt@codeblueprint.co.uk Signed-off-by: Ingo Molnar --- 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 ac95dd8..7a3318d 100644 --- a/drivers/firmware/efi/arm-init.c +++ b/drivers/firmware/efi/arm-init.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -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_is_map_memory(screen_info.lfb_base)) + 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) init_screen_info(); } + +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); +} +subsys_initcall(register_gop_device);