From patchwork Wed Jul 2 10:34:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 32963 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f198.google.com (mail-vc0-f198.google.com [209.85.220.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EBD6520672 for ; Wed, 2 Jul 2014 10:36:55 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id hy10sf24968392vcb.1 for ; Wed, 02 Jul 2014 03:36:55 -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=ipw0u6g0Nv4HgvXoExsEi2/OpULftt+4lYO02kiEEFI=; b=HRRQP6ssb9z8pLs7Yw3/XfOI6sUVsHsBuI2s4zWF3SK1qCyAgdJTbivg2b3Zm/DjvY TFdy5jfDaBqkYoJAncc2YVliEmOGkN8GNA979hOa483yxE07ykWtOxsZmELIcit5SPBR 8nJUyCqALWX62grrjVdlyfpP9Si8vCv7UOXhms+j4v21gp+wbp4PXNoR4xnPLMMNhXAf MY/giCev1MbeBZk9eBNkelcBXu0sk19/YGID0clanD8MGFaMRyX5kicZUS4Eq9v/kt85 854tRUhYyuXDjoEtBDXQwtBhBrenN12M1Pv1DZcRKeERQknmCJ87DmVZLjKSZVlZu9vS sQEg== X-Gm-Message-State: ALoCoQm6J2QItDP3XzIKXjiu38afFkrGY1puwXzfXugj8ymvTAfRCm4z8pllOepIv61rJ+w3Vc3/ X-Received: by 10.58.6.210 with SMTP id d18mr17483144vea.10.1404297415528; Wed, 02 Jul 2014 03:36:55 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.90.48 with SMTP id w45ls2308418qgd.73.gmail; Wed, 02 Jul 2014 03:36:55 -0700 (PDT) X-Received: by 10.58.30.35 with SMTP id p3mr47977581veh.25.1404297415455; Wed, 02 Jul 2014 03:36:55 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id xq1si10039585vec.20.2014.07.02.03.36.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 02 Jul 2014 03:36:55 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id ik5so10040485vcb.7 for ; Wed, 02 Jul 2014 03:36:55 -0700 (PDT) X-Received: by 10.220.92.135 with SMTP id r7mr48738450vcm.11.1404297415353; Wed, 02 Jul 2014 03:36:55 -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.221.37.5 with SMTP id tc5csp283148vcb; Wed, 2 Jul 2014 03:36:54 -0700 (PDT) X-Received: by 10.69.11.35 with SMTP id ef3mr69350619pbd.83.1404297414636; Wed, 02 Jul 2014 03:36:54 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id pt9si29843313pbb.240.2014.07.02.03.36.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Jul 2014 03:36:54 -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 1X2Hse-00025B-UF; Wed, 02 Jul 2014 10:35:12 +0000 Received: from mail-we0-f176.google.com ([74.125.82.176]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X2Hsa-0000yM-QW for linux-arm-kernel@lists.infradead.org; Wed, 02 Jul 2014 10:35:10 +0000 Received: by mail-we0-f176.google.com with SMTP id u56so10834492wes.21 for ; Wed, 02 Jul 2014 03:34:46 -0700 (PDT) X-Received: by 10.194.157.195 with SMTP id wo3mr1992761wjb.130.1404297285924; Wed, 02 Jul 2014 03:34:45 -0700 (PDT) Received: from ards-macbook-pro.local ([37.183.67.249]) by mx.google.com with ESMTPSA id dj2sm53754121wib.11.2014.07.02.03.34.44 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 02 Jul 2014 03:34:45 -0700 (PDT) From: Ard Biesheuvel To: catalin.marinas@arm.com Subject: [PATCH resend] arm64: dmi: Add SMBIOS/DMI support Date: Wed, 2 Jul 2014 12:34:37 +0200 Message-Id: <1404297277-28295-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-20140702_033509_052160_1CCAF004 X-CRM114-Status: GOOD ( 14.72 ) 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 [74.125.82.176 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [74.125.82.176 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: grant.likely@linaro.org, Yi Li , leif.lindholm@linaro.org, linux-arm-kernel@lists.infradead.org, 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.220.176 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 [ardb: whitespace, commit log tweaks] Signed-off-by: Ard Biesheuvel --- Resending on behalf of Yi. Please consider for 3.17. Regards, Ard. arch/arm64/Kconfig | 10 ++++++++++ arch/arm64/include/asm/dmi.h | 28 ++++++++++++++++++++++++++++ arch/arm64/kernel/setup.c | 2 ++ 3 files changed, 40 insertions(+) create mode 100644 arch/arm64/include/asm/dmi.h diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index a474de346be6..560996c4a172 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -307,6 +307,16 @@ 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..b8758f46fb42 --- /dev/null +++ b/arch/arm64/include/asm/dmi.h @@ -0,0 +1,28 @@ +/* + * 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 1 + +#include +#include + +/* Use efi mappings for DMI */ +#define dmi_early_remap(x, l) efi_lookup_mapped_addr(x) +#define dmi_early_unmap(x, l) +#define dmi_remap(x, l) efi_lookup_mapped_addr(x) +#define dmi_unmap(x) +#define dmi_alloc(l) kzalloc(l, GFP_ATOMIC) + +#endif diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 46d1125571f6..4075e46282b1 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -413,6 +414,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);