From patchwork Thu Mar 10 05:40:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 63734 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp244525lbc; Wed, 9 Mar 2016 21:44:33 -0800 (PST) X-Received: by 10.98.17.78 with SMTP id z75mr2430817pfi.40.1457588673536; Wed, 09 Mar 2016 21:44:33 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id zo2si3443642pac.221.2016.03.09.21.44.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Mar 2016 21:44:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1adtN3-00008m-EO; Thu, 10 Mar 2016 05:42:49 +0000 Received: from mail-pa0-x22e.google.com ([2607:f8b0:400e:c03::22e]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1adtLK-0007Qm-OJ for linux-arm-kernel@lists.infradead.org; Thu, 10 Mar 2016 05:41:05 +0000 Received: by mail-pa0-x22e.google.com with SMTP id tt10so58608085pab.3 for ; Wed, 09 Mar 2016 21:40:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JyUrT+EeLehXGBzTuKSKdQoh6YNmTsqjT3ZY6uOqB/g=; b=beoeEZQkcmODtJXEhl6RE72jxe2UqJOtdOYZcp2ZRukg+fu26+J1Jw3ThSgjUioUKb TzTKUURCxMMTeW5epogfoNLyjtU4K97rejYn+eumJZ7C4/X3cf8V25wPtZm+HtlFpxdU 7M/kQnrtHbLJgsPumPBTGlhadv14wC8m0l4HI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=JyUrT+EeLehXGBzTuKSKdQoh6YNmTsqjT3ZY6uOqB/g=; b=diGIu8AjXKu/NyDbMKJeVbr6eE4hdbiYamJloOD6+hJ7Sf4wOnB1ceNcKpIOPnzHgX qp7+FB8BJ6uJjziRKhDahzwJOiIQNpToyFmbs149g8IBFZEYN2vrYa9TFEEElAcA7Z74 PrppOkvKknZRKm2fjNyxEBOZYzGdEc85UX2Wrv7uu/E7FwAjJED5/QCOw5dpY8c4HJg7 7lS0cSOmAlND/yBmVlpfV5oTTTLwAHGMYnMiYHkt16OE4R/W7vOFh+ywqTnT/yeYa+Lq yhMj+r/mF9JNLkiprn6vrKD+ho6XdoH6xrusCCFUAd8Fs3lbi4IOQMIDoDbatOIzslOM BKdg== X-Gm-Message-State: AD7BkJL2Dei6OXNzBlIk1Z+tcc1x+IOdoX1um3Pbc30B2wpeX5v2J0gVrECFf+ZnPxwSfgC3 X-Received: by 10.66.118.7 with SMTP id ki7mr2350961pab.152.1457588441959; Wed, 09 Mar 2016 21:40:41 -0800 (PST) Received: from ards-macbook-pro.cgcwfunction (110-170-137-253.static.asianet.co.th. [110.170.137.253]) by smtp.gmail.com with ESMTPSA id r5sm2127864pap.7.2016.03.09.21.40.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 09 Mar 2016 21:40:41 -0800 (PST) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, matt@codeblueprint.co.uk, linux@arm.linux.org.uk, catalin.marinas@arm.com, will.deacon@arm.com Subject: [PATCH 7/8] efi/arm*: efifb: expose efifb platform device if GOP is available Date: Thu, 10 Mar 2016 12:40:07 +0700 Message-Id: <1457588408-19309-8-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1457588408-19309-1-git-send-email-ard.biesheuvel@linaro.org> References: <1457588408-19309-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160309_214103_129060_31F41733 X-CRM114-Status: GOOD ( 16.42 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:400e:c03:0:0:0:22e listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, x86@kernel.org, leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org This allows the efifb driver to be built for ARM and arm64, and adds the registration of a "efi-framebuffer" platform device if the GOP code in the stub has populated screen_info appropriately. Signed-off-by: Ard Biesheuvel --- arch/arm/include/asm/efi.h | 4 ++++ arch/arm64/include/asm/efi.h | 4 ++++ drivers/firmware/efi/arm-init.c | 19 +++++++++++++++++++ drivers/video/fbdev/Kconfig | 2 +- 4 files changed, 28 insertions(+), 1 deletion(-) -- 1.9.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm/include/asm/efi.h b/arch/arm/include/asm/efi.h index 6329b5be1eca..9b6d441b08fd 100644 --- a/arch/arm/include/asm/efi.h +++ b/arch/arm/include/asm/efi.h @@ -66,6 +66,10 @@ void efi_virtmap_unload(void); struct screen_info *alloc_screen_info(efi_system_table_t *sys_table_arg); void free_screen_info(efi_system_table_t *sys_table, struct screen_info *si); +static inline void efifb_setup_from_dmi(struct screen_info *si, const char *opt) +{ +} + /* * This GUID is used to pass to the kernel proper the struct screen_info * structure that was populated by the stub based on the GOP protocol instance diff --git a/arch/arm64/include/asm/efi.h b/arch/arm64/include/asm/efi.h index a6c14f29b970..00e9d7099a8f 100644 --- a/arch/arm64/include/asm/efi.h +++ b/arch/arm64/include/asm/efi.h @@ -57,6 +57,10 @@ int efi_create_mapping(struct mm_struct *mm, efi_memory_desc_t *md); #define alloc_screen_info(x...) &screen_info #define free_screen_info(x...) +static inline void efifb_setup_from_dmi(struct screen_info *si, const char *opt) +{ +} + #define EFI_ALLOC_ALIGN SZ_64K /* diff --git a/drivers/firmware/efi/arm-init.c b/drivers/firmware/efi/arm-init.c index 9e15d571b53c..eca9b4f826ee 100644 --- a/drivers/firmware/efi/arm-init.c +++ b/drivers/firmware/efi/arm-init.c @@ -17,6 +17,8 @@ #include #include #include +#include +#include #include @@ -206,4 +208,21 @@ void __init efi_init(void) memblock_mark_nomap(params.mmap & PAGE_MASK, PAGE_ALIGN(params.mmap_size + (params.mmap & ~PAGE_MASK))); + + 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 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); diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig index 8ea45a5cd806..ccbaa25aad76 100644 --- a/drivers/video/fbdev/Kconfig +++ b/drivers/video/fbdev/Kconfig @@ -761,7 +761,7 @@ config FB_VESA config FB_EFI bool "EFI-based Framebuffer Support" - depends on (FB = y) && X86 && EFI + depends on (FB = y) && !IA64 && EFI select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT