From patchwork Sun Jun 8 10:09:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yi Li X-Patchwork-Id: 31532 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f72.google.com (mail-qa0-f72.google.com [209.85.216.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 931AC20CBB for ; Sun, 8 Jun 2014 10:10:23 +0000 (UTC) Received: by mail-qa0-f72.google.com with SMTP id hw13sf18085308qab.7 for ; Sun, 08 Jun 2014 03:10:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=tTYRQwWyTRk6ztJDYDVXgkCyqn/WRkiBKmT6z8S4uPI=; b=FFEOD8A7ZkFKfJu1nQgby3IYembL9L3A/FU9IG6EDOdlgHvT7i6ffcziMs9XOh3rV7 iO4CKPXWTbhregsATdsjcBKaXsWteXqpHvqIYiBq+NNhpuwUZoACD76QiK8XwPiZa/+i 4jorKAmwRQaK1bQXWu5oBlm+tICJ4MI/HxqIRzI8lrPaQco/AYXqq8ZF/J1PMwY3aUiR g88f92000sr/+kg35eot/FEB69YIN0G/E+bjmQDQUnl94cql1LPZhU87omhWdKPLFWhY cdTpor7Rj/Cu4lNfGFI5ARYFglyAhgeffGbs/xjPa1C9HwU4/PpxebwRWZA4/BReUQv+ wFGA== X-Gm-Message-State: ALoCoQlKMNgmerMbT3JhljWfjatOSCWhb7485F60sUaeC3ZTO9mKnx9kJvfIRLWmVp43WC8Tb4hi X-Received: by 10.236.112.12 with SMTP id x12mr2897938yhg.56.1402222223457; Sun, 08 Jun 2014 03:10:23 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.104.49 with SMTP id z46ls1227042qge.50.gmail; Sun, 08 Jun 2014 03:10:23 -0700 (PDT) X-Received: by 10.52.92.100 with SMTP id cl4mr15952285vdb.48.1402222223251; Sun, 08 Jun 2014 03:10:23 -0700 (PDT) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id xr4si10206489veb.87.2014.06.08.03.10.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 08 Jun 2014 03:10:23 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.177 as permitted sender) client-ip=209.85.128.177; Received: by mail-ve0-f177.google.com with SMTP id oz11so690006veb.36 for ; Sun, 08 Jun 2014 03:10:23 -0700 (PDT) X-Received: by 10.52.163.161 with SMTP id yj1mr15064819vdb.35.1402222223144; Sun, 08 Jun 2014 03:10:23 -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.54.6 with SMTP id vs6csp64347vcb; Sun, 8 Jun 2014 03:10:22 -0700 (PDT) X-Received: by 10.182.214.41 with SMTP id nx9mr17046556obc.15.1402222222623; Sun, 08 Jun 2014 03:10:22 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l9si22835711obu.35.2014.06.08.03.10.22; Sun, 08 Jun 2014 03:10:22 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753561AbaFHKKL (ORCPT + 27 others); Sun, 8 Jun 2014 06:10:11 -0400 Received: from mail-ie0-f180.google.com ([209.85.223.180]:59467 "EHLO mail-ie0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753543AbaFHKKJ (ORCPT ); Sun, 8 Jun 2014 06:10:09 -0400 Received: by mail-ie0-f180.google.com with SMTP id at20so4258100iec.11 for ; Sun, 08 Jun 2014 03:10:08 -0700 (PDT) X-Received: by 10.50.67.79 with SMTP id l15mr23028456igt.10.1402222208586; Sun, 08 Jun 2014 03:10:08 -0700 (PDT) Received: from localhost.localdomain (li568-142.members.linode.com. [106.186.21.142]) by mx.google.com with ESMTPSA id e4sm49948759igx.4.2014.06.08.03.09.49 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 08 Jun 2014 03:10:07 -0700 (PDT) From: Yi Li To: ard.biesheuvel@linaro.org, msalter@redhat.com, catalin.marinas@arm.com, will.deacon@arm.com, sudeep.karkadanagesha@arm.com, steve.capper@linaro.org, lorenzo.pieralisi@arm.com, liviu.dudau@arm.com, grant.likely@linaro.org, mark.rutland@arm.com Cc: yi.li@linaro.org, phoenix.liyi@huawei.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] arm64: dmi: Add SMBIOS/DMI support on arm64 Date: Sun, 8 Jun 2014 18:09:25 +0800 Message-Id: <1402222165-3363-1-git-send-email-yi.li@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: yi.li@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.128.177 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 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add smbios/dmi support on arm64 system, it depends on EFI boot. Since SMBIOS is very important specification for the hardware vendors , it describes the hardware informations like BIOS version, serial number, physical layout of the ports and so on. All x86 and IA64 servers has supported this specfication. If ARM64 hopes to enter server market, then SMBIOS needs to support on ARM64, and it has been included as one important section in SBBR document from ARM. This has been tested by dmidecode and lshw tools. Signed-off-by: Yi Li --- Changes since v1: -Followed Ard Biesheuvel's suggestion to rebase the patch on Matt Fleming's arm64-efi branch. -Followed Mark Rutland's suggesiton to change the include header. -Followed Grant likely's suggestion to enrich the SMBIOS background and the reason why we need to enable the SMBIOS on ARM64 platform. 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 6c71f12..13ee261 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -294,6 +294,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 0000000..a0b3dac --- /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 0a14aaf..7622561 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -400,6 +401,7 @@ static int __init arm64_device_init(void) { of_clk_init(NULL); of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); + dmi_scan_machine(); return 0; } arch_initcall(arm64_device_init);