Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755715AbcCUNxS (ORCPT ); Mon, 21 Mar 2016 09:53:18 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:32853 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754583AbcCUNxN (ORCPT ); Mon, 21 Mar 2016 09:53:13 -0400 MIME-Version: 1.0 In-Reply-To: <1458319661-19762-9-git-send-email-ard.biesheuvel@linaro.org> References: <1458319661-19762-1-git-send-email-ard.biesheuvel@linaro.org> <1458319661-19762-9-git-send-email-ard.biesheuvel@linaro.org> Date: Mon, 21 Mar 2016 14:53:11 +0100 Message-ID: Subject: Re: [PATCH v2 8/9] efi/arm*: wire up struct screen_info to efi-framebuffer platform device From: David Herrmann To: Ard Biesheuvel Cc: linux-kernel , linux-efi@vger.kernel.org, "linux-arm-kernel@lists.infradead.org" , Matt Fleming , Catalin Marinas , Will Deacon , Russell King - ARM Linux , Peter Jones , leif.lindholm@linaro.org, Mark Rutland , "the arch/x86 maintainers" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2120 Lines: 60 Hi On Fri, Mar 18, 2016 at 5:47 PM, Ard Biesheuvel wrote: > 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 > --- > 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 > #include > #include > +#include > #include > > #include > @@ -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); I'd really appreciate if you pass "screen_info" as data, just like x86 does. Sure, we still use the global screen_info variable from efifb, but we should try to reduce the number of global variables and rather make drivers use the platform-data of the platform device. Thanks David