From patchwork Fri Apr 1 16:05:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 64885 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp820507lbc; Fri, 1 Apr 2016 09:09:05 -0700 (PDT) X-Received: by 10.66.154.233 with SMTP id vr9mr32261060pab.66.1459526945740; Fri, 01 Apr 2016 09:09:05 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id kl11si3839669pab.36.2016.04.01.09.09.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Apr 2016 09:09:05 -0700 (PDT) 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; dkim=neutral (body hash did not verify) header.i=@linaro.org; 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; dmarc=fail (p=NONE dis=NONE) header.from=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 1am1cD-0006NO-VZ; Fri, 01 Apr 2016 16:08:05 +0000 Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1am1ap-0004rD-Me for linux-arm-kernel@lists.infradead.org; Fri, 01 Apr 2016 16:06:42 +0000 Received: by mail-wm0-x22d.google.com with SMTP id f198so32012928wme.0 for ; Fri, 01 Apr 2016 09:06:19 -0700 (PDT) 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=4Jfl7yNWVsnysKtGd1gbSVdlM2j9+Ckw0XAWfZZXw+I=; b=YMrkXidfihZtIg7cfihrMbI9GsAAlCk7F5o9X0ing6NI3qleb/kfRl4izp8MMww6jq +rDrWFfhofI7TXbiHWy/rVn3zUvAUe1ba+pIV9UcJV/gPUoJ+T8CbxucUWeQC/QgTs6U uZHOwjV3x6/MEy7hBVxcqq4uXoba5YZNqGnno= 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=4Jfl7yNWVsnysKtGd1gbSVdlM2j9+Ckw0XAWfZZXw+I=; b=L9i5Ln4+CBb3Mt7T2MnJrug5EX9u7Na4sv4XVlcudkf9G7Ueutj/ZKOEDKILa8F9el 7/yOsjdGW0zlzBxjAgBJBDFHu8ZJ3lBWJcUj292D51nhGTyvdJnp/xSu4xDFPS9ENQhX EY/vOD/MHDbp63i8QSbzbMrswVEg/TzmGuxDF89G95sUA6H+arieShDWmr/x7Nev5ZhA vh364qZzJYwvpdlt10vaJrvC7283Rt/eSnD5hf8Eob4TWwGZEz15l56JbtCbtW0Osu8F pOui3sXl9iNGshSp0Mf/avM4A3YwYM7rOMKow3YmKwmr5/1ann8d6JVZo3lNCuobQ8KU PKtw== X-Gm-Message-State: AD7BkJK9mkx1D+h15iZ/tBGcnpETL9Il5kfpHcZR/oJaSn1to7bESZLCQpreHHJCho8XzBuY X-Received: by 10.28.189.70 with SMTP id n67mr4627876wmf.45.1459526778245; Fri, 01 Apr 2016 09:06:18 -0700 (PDT) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id g3sm14698567wjw.31.2016.04.01.09.06.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 01 Apr 2016 09:06:17 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, matt@codeblueprint.co.uk Subject: [PATCH v3 8/9] efi/arm*: wire up struct screen_info to efi-framebuffer platform device Date: Fri, 1 Apr 2016 18:05:34 +0200 Message-Id: <1459526735-24936-9-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1459526735-24936-1-git-send-email-ard.biesheuvel@linaro.org> References: <1459526735-24936-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160401_090640_050737_08EE972C X-CRM114-Status: GOOD ( 13.20 ) 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 [2a00:1450:400c:c09: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_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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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, pjones@redhat.com, will.deacon@arm.com, Ard Biesheuvel , dh.herrmann@gmail.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org 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(+) -- 2.5.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/drivers/firmware/efi/arm-init.c b/drivers/firmware/efi/arm-init.c index 34bbad23da86..7c5a38c60037 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 @@ -80,6 +81,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) @@ -241,3 +246,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);