From patchwork Tue Jun 3 15:57:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yi Li X-Patchwork-Id: 31327 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 898BD203AC for ; Tue, 3 Jun 2014 15:58:54 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id z6sf32897438yhz.5 for ; Tue, 03 Jun 2014 08:58:54 -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=DHwknF3rM7ae9kPsfjNIXD5ea/BHpokOrdR/5sH9fVI=; b=RkQumKrdZehMeC3jJ5XybJcrRkLwxqDHHTYAx/7I4OJqEYkbpZnflJbKXMcqJFJwrx ih3UMlSyhMFAESNiVrEJTWGLgt/zNvgDxKOBHha2jbFZQJlhBsDKpFj4yzhha3m1EjX3 vIidyxzUvVRatWkACHMWad5VnBkbvoIqTEcJ4S8o83FyXJapHjJoDq1rDXMcjxUiYU6w FfR9zQWQroWJc+fW6g/JtNMRF1okNgHtrZqQ0DMij5KuQB0sluEmlZhMv4QKht+lKe6N KIHk89vBb9N6xb2sMohJLuDP9MFHH+c2hUrviHXXx5aNDa0MMOnVDyTWh6nefYZWOgq6 Ww9A== X-Gm-Message-State: ALoCoQkOzj00cAiP1piE/w4f4GhQdF/aRUcurwWk2CQslmNUIz8kP+aCmDBhDOKcXnAi7QgdIMg5 X-Received: by 10.58.30.108 with SMTP id r12mr17831894veh.17.1401811134259; Tue, 03 Jun 2014 08:58:54 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.43.35 with SMTP id d32ls2571957qga.87.gmail; Tue, 03 Jun 2014 08:58:54 -0700 (PDT) X-Received: by 10.220.179.197 with SMTP id br5mr1827555vcb.80.1401811134103; Tue, 03 Jun 2014 08:58:54 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id t7si10266871vef.53.2014.06.03.08.58.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Jun 2014 08:58:54 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id lf12so6962185vcb.3 for ; Tue, 03 Jun 2014 08:58:53 -0700 (PDT) X-Received: by 10.52.227.138 with SMTP id sa10mr31459006vdc.25.1401811133919; Tue, 03 Jun 2014 08:58:53 -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.220.221.72 with SMTP id ib8csp7177vcb; Tue, 3 Jun 2014 08:58:53 -0700 (PDT) X-Received: by 10.68.135.195 with SMTP id pu3mr2477088pbb.10.1401811132965; Tue, 03 Jun 2014 08:58:52 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id af1si21880450pbd.34.2014.06.03.08.58.52; Tue, 03 Jun 2014 08:58:52 -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 S933114AbaFCP6m (ORCPT + 27 others); Tue, 3 Jun 2014 11:58:42 -0400 Received: from mail-pb0-f48.google.com ([209.85.160.48]:60379 "EHLO mail-pb0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932308AbaFCP6l (ORCPT ); Tue, 3 Jun 2014 11:58:41 -0400 Received: by mail-pb0-f48.google.com with SMTP id rr13so5656477pbb.7 for ; Tue, 03 Jun 2014 08:58:40 -0700 (PDT) X-Received: by 10.68.143.65 with SMTP id sc1mr52002438pbb.93.1401811120470; Tue, 03 Jun 2014 08:58:40 -0700 (PDT) Received: from localhost.localdomain ([183.12.88.85]) by mx.google.com with ESMTPSA id pr4sm29510546pbb.53.2014.06.03.08.58.31 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Jun 2014 08:58:39 -0700 (PDT) From: Yi Li To: ard.biesheuvel@linaro.org, catalin.marinas@arm.com, will.deacon@arm.com, rob.herring@calxeda.com, sudeep.karkadanagesha@arm.com, steve.capper@linaro.org, lorenzo.pieralisi@arm.com, liviu.dudau@arm.com, grant.likely@linaro.org Cc: yi.li@linaro.org, phoenix.liyi@huawei.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] ARM64:DMI: Add smbios/dmi support on arm64 Date: Tue, 3 Jun 2014 23:57:13 +0800 Message-Id: <1401811033-16478-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.220.172 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. Signed-off-by: Yi Li --- Changes since v1: -Followed Ard Biesheuvel's suggestion to rebase the patch on Matt Fleming's arm64-efi branch. 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..f2198bf --- /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);