From patchwork Fri Apr 1 16:05:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 64884 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp820347lbc; Fri, 1 Apr 2016 09:08:46 -0700 (PDT) X-Received: by 10.182.135.230 with SMTP id pv6mr5628941obb.61.1459526926179; Fri, 01 Apr 2016 09:08:46 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id 95si7919768oti.38.2016.04.01.09.08.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Apr 2016 09:08:46 -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 1am1bq-0005zF-SM; Fri, 01 Apr 2016 16:07:42 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1am1ao-00057Q-7w for linux-arm-kernel@bombadil.infradead.org; Fri, 01 Apr 2016 16:06:38 +0000 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]) by merlin.infradead.org with esmtps (Exim 4.85 #2 (Red Hat Linux)) id 1am1am-00077d-Na for linux-arm-kernel@lists.infradead.org; Fri, 01 Apr 2016 16:06:37 +0000 Received: by mail-wm0-x231.google.com with SMTP id p65so31995049wmp.1 for ; Fri, 01 Apr 2016 09:06:14 -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=s0bcEtRoGhTFQGLb4O15rm+qbAK5X+4XknG9YmiWvjQ=; b=fw9kIirncij0lHzXTWanyoQV6BOh5nt7PH+x5sJPoGrRpO6Uz2wBYiNsKUamLNEa3a DoW4huQkPvRng7cct3pc7qWaod3XY76m90TnKn7AtWc7e1wgthiDSQlNe3Az6tfpEaRJ zOtyA7qpQiMDBNapbBKDilYkG6gdT5tXDTEgY= 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=s0bcEtRoGhTFQGLb4O15rm+qbAK5X+4XknG9YmiWvjQ=; b=iA0nF6CUAogYB1FO9l/Kq3nRzqeuUjgs8A1AbGzDdgROJyDZzV1rPGgkwQfy4ShVQg uMS5o0ckWNbVGWeX5y5r+bG2B3j1crxJ+5jA9ICAglaFTtSTkAtqiIUdl1T43Gn71x88 jJYoJHhHVaYS7J3Ht+/y1xuw9g18j7IHrouoFb6waCluLL1v4ASLX0CJL5DqvL06FsA1 OnVgR5lwJd0scHOFryFW8PV5+qxGw1eOatXVIgBz3Ux5YH83P54Mb6/V/wnQH0WuA2GZ 2LVC852b4vfjPUQ0nf/XShmJ9Fgi68VSUaNtE8CrhOFHq6Dg3Pnnn1w1DolJH28BPwSG 44CQ== X-Gm-Message-State: AD7BkJKfdQh6wh/lWvl0hdBdcz+mQWpPWo8BmSmtLXXa7oYKm0XcBdwIcBNPNIdxJhAAvBe2 X-Received: by 10.194.21.197 with SMTP id x5mr9792460wje.90.1459526772824; Fri, 01 Apr 2016 09:06:12 -0700 (PDT) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id g3sm14698567wjw.31.2016.04.01.09.06.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 01 Apr 2016 09:06:12 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, matt@codeblueprint.co.uk Subject: [PATCH v3 7/9] efi/arm*: libstub: wire up GOP protocol to struct screen_info Date: Fri, 1 Apr 2016 18:05:33 +0200 Message-Id: <1459526735-24936-8-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_120636_995941_D7C87A10 X-CRM114-Status: GOOD ( 14.22 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.1 on merlin.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:231 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 the code to the ARM and arm64 versions of the UEFI stub to populate struct screen_info based on the information received from the firmware via the GOP protocol. Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/libstub/arm-stub.c | 23 ++++++++++++++++++++ 1 file changed, 23 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/libstub/arm-stub.c b/drivers/firmware/efi/libstub/arm-stub.c index 128632508fc6..993aa56755f6 100644 --- a/drivers/firmware/efi/libstub/arm-stub.c +++ b/drivers/firmware/efi/libstub/arm-stub.c @@ -169,6 +169,25 @@ void efi_char16_printk(efi_system_table_t *sys_table_arg, out->output_string(out, str); } +static struct screen_info *setup_graphics(efi_system_table_t *sys_table_arg) +{ + efi_guid_t gop_proto = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID; + efi_status_t status; + unsigned long size; + void **gop_handle = NULL; + struct screen_info *si = NULL; + + size = 0; + status = efi_call_early(locate_handle, EFI_LOCATE_BY_PROTOCOL, + &gop_proto, NULL, &size, gop_handle); + if (status == EFI_BUFFER_TOO_SMALL) { + si = alloc_screen_info(sys_table_arg); + if (!si) + return NULL; + efi_setup_gop(sys_table_arg, si, &gop_proto, size); + } + return si; +} /* * This function handles the architcture specific differences between arm and @@ -208,6 +227,7 @@ unsigned long efi_entry(void *handle, efi_system_table_t *sys_table, unsigned long reserve_addr = 0; unsigned long reserve_size = 0; int secure_boot = 0; + struct screen_info *si; /* Check if we were booted by the EFI firmware */ if (sys_table->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) @@ -260,6 +280,8 @@ unsigned long efi_entry(void *handle, efi_system_table_t *sys_table, __nokaslr = true; } + si = setup_graphics(sys_table); + status = handle_kernel_image(sys_table, image_addr, &image_size, &reserve_addr, &reserve_size, @@ -341,6 +363,7 @@ fail_free_image: efi_free(sys_table, image_size, *image_addr); efi_free(sys_table, reserve_size, reserve_addr); fail_free_cmdline: + free_screen_info(sys_table, si); efi_free(sys_table, cmdline_size, (unsigned long)cmdline_ptr); fail: return EFI_ERROR;