From patchwork Wed Feb 18 11:33:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 44760 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B750E21544 for ; Wed, 18 Feb 2015 11:35:29 +0000 (UTC) Received: by lamq1 with SMTP id q1sf411895lam.0 for ; Wed, 18 Feb 2015 03:35:28 -0800 (PST) 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:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=qwTQgnPjlKAzcSiElpgAZSE9HZ5IucLVC2U48YFyGFk=; b=RwYHhk4ENI51Xq7cWiZlQPOLQVHdJ4/5j5RMgvkN3wSnWbCcGoKnBLkW9lDRfnnXyl HZ7ima69hHgGaBRcqOGa9vG4YbOlXSMALoFIeg0pD3yQrlJ9Qg2eeqhvLkquKyAfOOT0 wum0KJjM8/ugMmc1A7s0bqxZ2jwf2rFR+V+5d/bCQMY3P5pPM0IzZFeP6FINb5mNHiOH ixFnbaWkjsY8ymbtzbPFYvB9w1Wt/PlCxlFX2j+rhXN9HpnfwcSM1zUtTs5U/bD8ro35 Y39etVYgrXwy5iGTWljra+peiB33DGAZLlWj8P/axBl1D3IJWdvrZqJ/NereWx4D57Kv YtpQ== X-Gm-Message-State: ALoCoQkXtA4ax8kdQt4KKP9E6eqxZ4v2Z+AnwBZVcXuot+1nntxPWWe6+JbZULag37xxlsEt0JOS X-Received: by 10.112.199.69 with SMTP id ji5mr2800754lbc.0.1424259328739; Wed, 18 Feb 2015 03:35:28 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.36 with SMTP id n4ls6824laj.27.gmail; Wed, 18 Feb 2015 03:35:28 -0800 (PST) X-Received: by 10.152.21.201 with SMTP id x9mr32714137lae.72.1424259328566; Wed, 18 Feb 2015 03:35:28 -0800 (PST) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id qn8si12803612lbb.159.2015.02.18.03.35.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Feb 2015 03:35:28 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by labpv20 with SMTP id pv20so499984lab.8 for ; Wed, 18 Feb 2015 03:35:28 -0800 (PST) X-Received: by 10.152.43.193 with SMTP id y1mr33775601lal.35.1424259328423; Wed, 18 Feb 2015 03:35:28 -0800 (PST) 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.35.133 with SMTP id h5csp2792995lbj; Wed, 18 Feb 2015 03:35:27 -0800 (PST) X-Received: by 10.70.133.130 with SMTP id pc2mr23528055pdb.99.1424259324336; Wed, 18 Feb 2015 03:35:24 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a2si2545354pdf.154.2015.02.18.03.35.22; Wed, 18 Feb 2015 03:35:24 -0800 (PST) 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 S1752586AbbBRLeB (ORCPT + 28 others); Wed, 18 Feb 2015 06:34:01 -0500 Received: from mail-lb0-f180.google.com ([209.85.217.180]:33461 "EHLO mail-lb0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752475AbbBRLdj (ORCPT ); Wed, 18 Feb 2015 06:33:39 -0500 Received: by lbvp9 with SMTP id p9so532292lbv.0 for ; Wed, 18 Feb 2015 03:33:38 -0800 (PST) X-Received: by 10.152.4.200 with SMTP id m8mr32225365lam.2.1424259218214; Wed, 18 Feb 2015 03:33:38 -0800 (PST) Received: from khorivan.itg.ti.com (32-55-93-178.pool.ukrtel.net. [178.93.55.32]) by mx.google.com with ESMTPSA id w16sm4149125lbk.20.2015.02.18.03.33.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Feb 2015 03:33:36 -0800 (PST) From: Ivan Khoronzhuk To: matt.fleming@intel.com, ard.biesheuvel@linaro.org Cc: leif.lindholm@linaro.org, linux-kernel@vger.kernel.org, Ivan Khoronzhuk Subject: [Patch v2 2/3] firmware: dmi_scan: use full dmi version for SMBIOS3 Date: Wed, 18 Feb 2015 13:33:20 +0200 Message-Id: <1424259201-24886-3-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1424259201-24886-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1424259201-24886-1-git-send-email-ivan.khoronzhuk@linaro.org> 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: ivan.khoronzhuk@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.46 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: , New SMBIOS3 spec adds additional field for versioning - docrev. The docrev identifies the revision of a specification implemented in the table structures, so display SMBIOSv3 versions in format, like "3.22.1". In case of only 32 bit entry point for versions > 3 display dmi version like "3.22.x" as we don't know the docrev. In other cases display version like it was. Signed-off-by: Ivan Khoronzhuk --- drivers/firmware/dmi_scan.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index 07d2960..3f3470f 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c @@ -17,7 +17,7 @@ */ static const char dmi_empty_string[] = " "; -static u16 __initdata dmi_ver; +static u32 dmi_ver __initdata; /* * Catch too early calls to dmi_check_system(): */ @@ -200,7 +200,7 @@ static void __init dmi_save_uuid(const struct dmi_header *dm, int slot, * the UUID are supposed to be little-endian encoded. The specification * says that this is the defacto standard. */ - if (dmi_ver >= 0x0206) + if (dmi_ver >= 0x020600) sprintf(s, "%pUL", d); else sprintf(s, "%pUB", d); @@ -472,7 +472,7 @@ static void __init dmi_format_ids(char *buf, size_t len) */ static int __init dmi_present(const u8 *buf) { - int smbios_ver; + u32 smbios_ver; if (memcmp(buf, "_SM_", 4) == 0 && buf[5] < 32 && dmi_checksum(buf, buf[5])) { @@ -507,8 +507,9 @@ static int __init dmi_present(const u8 *buf) if (dmi_walk_early(dmi_decode) == 0) { if (smbios_ver) { dmi_ver = smbios_ver; - pr_info("SMBIOS %d.%d present.\n", - dmi_ver >> 8, dmi_ver & 0xFF); + pr_info("SMBIOS %d.%d%s present.\n", + dmi_ver >> 8, dmi_ver & 0xFF, + (dmi_ver < 0x0300) ? "" : ".x"); } else { smbios_header_size = 15; memcpy(smbios_header, buf, smbios_header_size); @@ -517,6 +518,7 @@ static int __init dmi_present(const u8 *buf) pr_info("Legacy DMI %d.%d present.\n", dmi_ver >> 8, dmi_ver & 0xFF); } + dmi_ver <<= 8; dmi_format_ids(dmi_ids_string, sizeof(dmi_ids_string)); printk(KERN_DEBUG "DMI: %s\n", dmi_ids_string); return 0; @@ -534,7 +536,8 @@ static int __init dmi_smbios3_present(const u8 *buf) { if (memcmp(buf, "_SM3_", 5) == 0 && buf[6] < 32 && dmi_checksum(buf, buf[6])) { - dmi_ver = get_unaligned_be16(buf + 7); + dmi_ver = get_unaligned_be32(buf + 6); + dmi_ver &= 0xFFFFFF; dmi_len = get_unaligned_le32(buf + 12); dmi_base = get_unaligned_le64(buf + 16); smbios_header_size = buf[6]; @@ -553,8 +556,9 @@ static int __init dmi_smbios3_present(const u8 *buf) dmi_num = dmi_len / 4; if (dmi_walk_early(dmi_decode) == 0) { - pr_info("SMBIOS %d.%d present.\n", - dmi_ver >> 8, dmi_ver & 0xFF); + pr_info("SMBIOS %d.%d.%d present.\n", + dmi_ver >> 16, (dmi_ver >> 8) & 0xFF, + dmi_ver & 0xFF); dmi_format_ids(dmi_ids_string, sizeof(dmi_ids_string)); pr_debug("DMI: %s\n", dmi_ids_string); return 0;