From patchwork Thu Mar 10 05:40:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 63735 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp244695lbc; Wed, 9 Mar 2016 21:45:05 -0800 (PST) X-Received: by 10.66.122.135 with SMTP id ls7mr2321844pab.59.1457588705076; Wed, 09 Mar 2016 21:45:05 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id t29si926852pfi.43.2016.03.09.21.45.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Mar 2016 21:45:05 -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 1adtNY-0000WG-5P; Thu, 10 Mar 2016 05:43:20 +0000 Received: from mail-pa0-x22d.google.com ([2607:f8b0:400e:c03::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1adtLO-0007RI-Cd for linux-arm-kernel@lists.infradead.org; Thu, 10 Mar 2016 05:41:09 +0000 Received: by mail-pa0-x22d.google.com with SMTP id fl4so58379660pad.0 for ; Wed, 09 Mar 2016 21:40:45 -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=/jSGf+i3wJB81LENFgOu+0j/q1ejzSwyNavUAiMGpuA=; b=WeMisMqWBquIkT86HYVvHtz67/wY82Z8s2nqD6JY4IujcjAjFbkqqOC1KrxJjQbBrw MoYdCWB/3jrH/eYptfRYniBy8xqek2vgU5P7B6lxCeWVFvXZw9Jw3TQ6YybSRbxZqAVk Z5zGU+O9W/gRAFtToAxagQZfzZGQVZ+ANq09o= 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=/jSGf+i3wJB81LENFgOu+0j/q1ejzSwyNavUAiMGpuA=; b=GZC4dxo/BXxxHnXan4zQ8t1Qb08OuOPEd9akzlz5WLDqzuxe4Y0Wkkqvz+XWwXswwd U9sKgabW8dNBrKICy/5VJavPbIogz1sFSydub1Ldoq1iNK9+FKHZjM+pmKiUXmebc8fU dCt/n9GC3ya0Yhib9hft/UAb3DL5qD9/vK3zkxqj2a2uc7jrJPsi3TkmIqoM5xRkKOS5 j3E/OCoiHB2BpJ3RxRDnVc1MWKacfK6kAqOOvEQeRedcN36cH/I7wy2PwIoT8ENwXUBn cT6oJt/h2PWPgxVfmEXW5o07RIqfV6VFaIdYN+p1F+dHjE6oFwMswai/0EGOAE/Ndy5G PxMw== X-Gm-Message-State: AD7BkJI7CiVjBnorAURAnVUI5BzLuf0YqJuBPqtTh00c4ZtQ7zdFpNtZypvMq77ILULd90So X-Received: by 10.66.97.8 with SMTP id dw8mr2386274pab.28.1457588445530; Wed, 09 Mar 2016 21:40:45 -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.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 09 Mar 2016 21:40:44 -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 8/8] efi/arm: populate screen_info based on data provided by the UEFI stub Date: Thu, 10 Mar 2016 12:40:08 +0700 Message-Id: <1457588408-19309-9-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_214106_743572_971A19A3 X-CRM114-Status: GOOD ( 12.35 ) 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:22d 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 Unlike on arm64, where we can simply access the screen_info struct directly, ARM requires an intermediate step to get the information discovered by the GOP code in the UEFI stub into the screen_info struct. So retrieve the dedicated config table we invented for this purpose, and put its contents into the core kernel's copy of struct screen_info. Signed-off-by: Ard Biesheuvel --- arch/arm/kernel/efi.c | 24 ++++++++++++++++++++ drivers/firmware/efi/arm-init.c | 6 +++++ 2 files changed, 30 insertions(+) -- 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/kernel/efi.c b/arch/arm/kernel/efi.c index ff8a9d8acfac..8d1119259654 100644 --- a/arch/arm/kernel/efi.c +++ b/arch/arm/kernel/efi.c @@ -6,11 +6,35 @@ * published by the Free Software Foundation. */ +#define pr_fmt(fmt) "efi: " fmt + #include +#include #include #include #include +static const efi_guid_t __initconst si_tbl = LINUX_ARM32_SCREEN_INFO_TABLE_GUID; + +void __init efi_find_screen_info(efi_config_table_t *tbl, u32 num_tables) +{ + struct screen_info *si; + + while (num_tables--) { + if (efi_guidcmp(tbl->guid, si_tbl) == 0) { + si = early_memremap_ro(tbl->table, sizeof(*si)); + if (!si) { + pr_warn("Failed to remap screen_info config table\n"); + return; + } + screen_info = *si; + early_memunmap(si, sizeof(*si)); + break; + } + tbl++; + } +} + int __init efi_create_mapping(struct mm_struct *mm, efi_memory_desc_t *md) { struct map_desc desc = { diff --git a/drivers/firmware/efi/arm-init.c b/drivers/firmware/efi/arm-init.c index eca9b4f826ee..689bf65f8ddf 100644 --- a/drivers/firmware/efi/arm-init.c +++ b/drivers/firmware/efi/arm-init.c @@ -112,6 +112,12 @@ static int __init uefi_init(void) retval = efi_config_parse_tables(config_tables, efi.systab->nr_tables, sizeof(efi_config_table_t), NULL); + if (IS_ENABLED(CONFIG_ARM)) { + extern void efi_find_screen_info(efi_config_table_t *, u32); + + efi_find_screen_info(config_tables, efi.systab->nr_tables); + } + early_memunmap(config_tables, table_size); out: early_memunmap(efi.systab, sizeof(efi_system_table_t));