From patchwork Fri Sep 19 17:00:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 37644 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8BD5D2054D for ; Fri, 19 Sep 2014 17:02:42 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id l4sf1821418lbv.4 for ; Fri, 19 Sep 2014 10:02:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id:cc :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=pU3FTdCwgbGkLgwco+wJb+lSkFonmyJon8X7HnkY4Fs=; b=IXznmy3YNf90Lp7AjtWqM7Io9+HXf2X6kjsjRcNfsvkjeLRlEoatj/UcMvhaPCoEno Am5Z13vojPgMnRQkmTHWuAn3T/BpWLf8FckTAy53adPlmZ4Ea7sr/cS9FbYu+V26dfTS bv7ionxHuyBHKXE1++6on09fk+9mFdRxxWd/SWQCniTTo2sIZe0FKKrNUhaqH1LrD9HI Ce62rafYkg8hB9v3IdwraYKbhcyEnUFt4qhWJcx+HIEF/XennQjthZtpwghEMUq9ZGS4 L4XozK5Aqk4o/6XnMANP5YaVK+m5rQukqmUgVkK6+UWtx5JPA6jy2HMTISQ2gcrJ1qBV d11A== X-Gm-Message-State: ALoCoQkGuQOlfw8jw1n8U7iPEFWUjPmG99wTJU6CV3Vx6JpFcy9ckQ1fZKXVuwuweW417CFsfMfM X-Received: by 10.194.203.40 with SMTP id kn8mr1799109wjc.4.1411146161356; Fri, 19 Sep 2014 10:02:41 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.9 with SMTP id o9ls306898lao.97.gmail; Fri, 19 Sep 2014 10:02:41 -0700 (PDT) X-Received: by 10.152.2.41 with SMTP id 9mr7926183lar.79.1411146161195; Fri, 19 Sep 2014 10:02:41 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com [209.85.215.52]) by mx.google.com with ESMTPS id c2si3348925lae.48.2014.09.19.10.02.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 19 Sep 2014 10:02:40 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by mail-la0-f52.google.com with SMTP id gq15so3498780lab.39 for ; Fri, 19 Sep 2014 10:02:40 -0700 (PDT) X-Received: by 10.112.76.6 with SMTP id g6mr7782685lbw.22.1411146160734; Fri, 19 Sep 2014 10:02:40 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.130.169 with SMTP id of9csp975792lbb; Fri, 19 Sep 2014 10:02:39 -0700 (PDT) X-Received: by 10.66.65.133 with SMTP id x5mr3476317pas.26.1411146159116; Fri, 19 Sep 2014 10:02:39 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id mp8si3985430pbc.15.2014.09.19.10.02.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Sep 2014 10:02:39 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; 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 1XV1YX-0006mc-V6; Fri, 19 Sep 2014 17:01:13 +0000 Received: from mail-pa0-f42.google.com ([209.85.220.42]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XV1YU-0006cp-Iw for linux-arm-kernel@lists.infradead.org; Fri, 19 Sep 2014 17:01:11 +0000 Received: by mail-pa0-f42.google.com with SMTP id et14so464373pad.15 for ; Fri, 19 Sep 2014 10:00:48 -0700 (PDT) X-Received: by 10.68.220.105 with SMTP id pv9mr2461559pbc.8.1411146048745; Fri, 19 Sep 2014 10:00:48 -0700 (PDT) Received: from ards-macbook-pro.local ([38.126.120.10]) by mx.google.com with ESMTPSA id ee5sm2337683pbc.76.2014.09.19.10.00.46 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 19 Sep 2014 10:00:47 -0700 (PDT) From: Ard Biesheuvel To: will.deacon@arm.com, catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH resend] arm64: dmi: Add SMBIOS/DMI support Date: Fri, 19 Sep 2014 10:00:32 -0700 Message-Id: <1411146032-5771-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140919_100110_652527_6B9F5AB4 X-CRM114-Status: GOOD ( 15.70 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.220.42 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.220.42 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: Yi Li , Ard Biesheuvel X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Yi Li SMbios is important for server hardware vendors. It implements a spec for providing descriptive information about the platform. Things like serial numbers, physical layout of the ports, build configuration data, and the like. This has been tested by dmidecode and lshw tools. Signed-off-by: Yi Li Signed-off-by: Ard Biesheuvel --- arch/arm64/Kconfig | 11 +++++++++++ arch/arm64/include/asm/dmi.h | 31 +++++++++++++++++++++++++++++++ arch/arm64/kernel/setup.c | 2 ++ 3 files changed, 44 insertions(+) create mode 100644 arch/arm64/include/asm/dmi.h diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index fd4e81a4e1ce..c69ab5a3a321 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -368,6 +368,17 @@ config EFI allow the kernel to be booted as an EFI application. This is only useful on systems that have UEFI firmware. +config DMI + bool "Enable support for SMBIOS (DMI) tables" + depends on EFI + default y + help + This enables SMBIOS/DMI feature for systems. + + This option is only useful on systems that have UEFI firmware. + However, even with this option, the resultant kernel should + continue to boot on existing non-UEFI platforms. + endmenu menu "Userspace binary formats" diff --git a/arch/arm64/include/asm/dmi.h b/arch/arm64/include/asm/dmi.h new file mode 100644 index 000000000000..69d37d87b159 --- /dev/null +++ b/arch/arm64/include/asm/dmi.h @@ -0,0 +1,31 @@ +/* + * arch/arm64/include/asm/dmi.h + * + * Copyright (C) 2013 Linaro Limited. + * Written by: Yi Li (yi.li@linaro.org) + * + * based on arch/ia64/include/asm/dmi.h + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + */ + +#ifndef __ASM_DMI_H +#define __ASM_DMI_H + +#include +#include + +/* + * According to section 2.3.6 of the UEFI spec, the firmware should not + * request a virtual mapping for configuration tables such as SMBIOS. + * This means we have to map them before use. + */ +#define dmi_early_remap(x, l) ioremap_cache(x, l) +#define dmi_early_unmap(x, l) iounmap(x) +#define dmi_remap(x, l) ioremap_cache(x, l) +#define dmi_unmap(x) iounmap(x) +#define dmi_alloc(l) kzalloc(l, GFP_KERNEL) + +#endif diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index edb146d01857..87e2e5419a51 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -416,6 +417,7 @@ void __init setup_arch(char **cmdline_p) static int __init arm64_device_init(void) { of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); + dmi_scan_machine(); return 0; } arch_initcall_sync(arm64_device_init);