From patchwork Fri Apr 1 16:05:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 64880 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp819710lbc; Fri, 1 Apr 2016 09:07:35 -0700 (PDT) X-Received: by 10.182.126.198 with SMTP id na6mr3415554obb.3.1459526854906; Fri, 01 Apr 2016 09:07:34 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id 10si7895465oto.225.2016.04.01.09.07.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Apr 2016 09:07:34 -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 1am1ab-0004w5-CC; Fri, 01 Apr 2016 16:06:25 +0000 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1am1aW-0004YM-52 for linux-arm-kernel@lists.infradead.org; Fri, 01 Apr 2016 16:06:21 +0000 Received: by mail-wm0-x233.google.com with SMTP id p65so28762903wmp.0 for ; Fri, 01 Apr 2016 09:05:59 -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=SuUb9D/Iy/RXy6pKRQr7/bTbhVW2+L4jjiurFTjiuH4=; b=fqvNFi0XXJs3GTz17T8vx8icRO8S7SH5X7Qm84Ia2OWm2Wv/idcyX9MrMh9ABLdlpP Je1GfUuNClKPMNS4AAXPPbcPLRYvPXxsnMkpEqOGkFk6yX0W0LHNKgliPZELJ1VOsst/ og+qg4e1/CBJ4HWcH0Ax/280lywOlw1sNZ98Y= 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=SuUb9D/Iy/RXy6pKRQr7/bTbhVW2+L4jjiurFTjiuH4=; b=UKZ6q6ZowBOIAChRqIXvRG9O4T9rxg6ZhNMIg9nAZG93Nfowe5GXrUacRTElx8ffSa gT7PFX/2dTDwHCDi7b828+XjPTbyrjf7kLB8nYrtNRtjt+clPdOzALe+J4XfWMgMw/78 +LF5YUq41JCUVIXv3k/uuY59rVYCL/xMNQY/17u7cI9KLgOtP6jpPdtZfHibjLaj2PKB KQRuddMDh4YCGAv3o0I81XC0JLMxeFuMrsV1qb1lCT6OXNE+AGSJDglYlhKTmNwxq1Sg ESBCuCK9y6Jkq3PIwtenOrHhmdh9Mr6U5KcBu/xRJvbJiKep2H4ssKefGxQxH0QEFX9m VUQg== X-Gm-Message-State: AD7BkJIQYTMmFC+2GqIgOZZSlN/IHSNUnuSoe93kf1ydKul1PKoeN3B0EY2FsfTDHbB5AYBi X-Received: by 10.194.76.161 with SMTP id l1mr5804812wjw.108.1459526758628; Fri, 01 Apr 2016 09:05:58 -0700 (PDT) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id g3sm14698567wjw.31.2016.04.01.09.05.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 01 Apr 2016 09:05:57 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, matt@codeblueprint.co.uk Subject: [PATCH v3 3/9] efi/x86: efifb: move DMI based quirks handling out of generic code Date: Fri, 1 Apr 2016 18:05:29 +0200 Message-Id: <1459526735-24936-4-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_090620_452436_F3818B80 X-CRM114-Status: GOOD ( 16.34 ) 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:233 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 The efifb quirks handling based on DMI identification of the platform is specific to x86, so move it to x86 arch code. Acked-by: David Herrmann Acked-By: Peter Jones Signed-off-by: Ard Biesheuvel --- arch/x86/include/asm/efi.h | 2 ++ arch/x86/kernel/sysfb_efi.c | 15 +++++++++++++++ drivers/video/fbdev/efifb.c | 15 ++++----------- 3 files changed, 21 insertions(+), 11 deletions(-) -- 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/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h index 10e440770371..8747abe8872f 100644 --- a/arch/x86/include/asm/efi.h +++ b/arch/x86/include/asm/efi.h @@ -180,6 +180,8 @@ static inline bool efi_runtime_supported(void) extern struct console early_efi_console; extern void parse_efi_setup(u64 phys_addr, u32 data_len); +extern void efifb_setup_from_dmi(struct screen_info *si, const char *opt); + #ifdef CONFIG_EFI_MIXED extern void efi_thunk_runtime_setup(void); extern efi_status_t efi_thunk_set_virtual_address_map( diff --git a/arch/x86/kernel/sysfb_efi.c b/arch/x86/kernel/sysfb_efi.c index b285d4e8c68e..e21a8a7ddcff 100644 --- a/arch/x86/kernel/sysfb_efi.c +++ b/arch/x86/kernel/sysfb_efi.c @@ -68,6 +68,21 @@ struct efifb_dmi_info efifb_dmi_list[] = { [M_UNKNOWN] = { NULL, 0, 0, 0, 0, OVERRIDE_NONE } }; +void efifb_setup_from_dmi(struct screen_info *si, const char *opt) +{ + int i; + + for (i = 0; i < M_UNKNOWN; i++) { + if (efifb_dmi_list[i].base != 0 && + !strcmp(opt, efifb_dmi_list[i].optname)) { + si->lfb_base = efifb_dmi_list[i].base; + si->lfb_linelength = efifb_dmi_list[i].stride; + si->lfb_width = efifb_dmi_list[i].width; + si->lfb_height = efifb_dmi_list[i].height; + } + } +} + #define choose_value(dmivalue, fwvalue, field, flags) ({ \ typeof(fwvalue) _ret_ = fwvalue; \ if ((flags) & (field)) \ diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c index 95d293b7445a..dd594369b8a6 100644 --- a/drivers/video/fbdev/efifb.c +++ b/drivers/video/fbdev/efifb.c @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -15,7 +16,7 @@ #include #include #include