From patchwork Fri Mar 10 09:58:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiandi An X-Patchwork-Id: 737341 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vfjmz1p3Gz9s7m for ; Fri, 10 Mar 2017 21:14:58 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1cmHZW-0001fz-1A; Fri, 10 Mar 2017 10:14:54 +0000 Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1cmHZU-0001fu-O8 for tpmdd-devel@lists.sourceforge.net; Fri, 10 Mar 2017 10:14:52 +0000 Received-SPF: pass (sog-mx-4.v43.ch3.sourceforge.com: domain of codeaurora.org designates 198.145.29.96 as permitted sender) client-ip=198.145.29.96; envelope-from=anjiandi@codeaurora.org; helo=smtp.codeaurora.org; Received: from smtp.codeaurora.org ([198.145.29.96]) by sog-mx-4.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1cmHZT-0002eG-NH for tpmdd-devel@lists.sourceforge.net; Fri, 10 Mar 2017 10:14:52 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 6C78F607EC; Fri, 10 Mar 2017 09:58:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from anjiandi-ubuntu.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: anjiandi@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id ACA48607EC; Fri, 10 Mar 2017 09:58:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org ACA48607EC Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=anjiandi@codeaurora.org From: Jiandi An To: tpmdd-devel@lists.sourceforge.net Date: Fri, 10 Mar 2017 03:58:07 -0600 Message-Id: <1489139889-14376-2-git-send-email-anjiandi@codeaurora.org> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1489139889-14376-1-git-send-email-anjiandi@codeaurora.org> References: <1489139889-14376-1-git-send-email-anjiandi@codeaurora.org> X-Spam-Score: -1.6 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [198.145.29.96 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.0 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1cmHZT-0002eG-NH Cc: Jiandi An , rafael.j.wysocki@intel.com, robert.moore@intel.com, lv.zheng@intel.com, lenb@kernel.org Subject: [tpmdd-devel] [PATCH 1/3] ACPICA: Update TPM2 ACPI table X-BeenThere: tpmdd-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Tpm Device Driver maintainance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: tpmdd-devel-bounces@lists.sourceforge.net TCG ACPI Specification Family "1.2" and "2.0" Version 1.2 Revision 8 introduces new start method for ARM SMC. - Add new start method (type 11) for ARM SMC - Add start method specific parameters for ARM SMC start method Signed-off-by: Jiandi An --- drivers/char/tpm/tpm_crb.c | 6 +++++- drivers/char/tpm/tpm_tis.c | 6 +++++- include/acpi/actbl2.h | 12 ++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c index cb6fb13..089fcf8 100644 --- a/drivers/char/tpm/tpm_crb.c +++ b/drivers/char/tpm/tpm_crb.c @@ -410,12 +410,16 @@ static int crb_acpi_add(struct acpi_device *device) struct tpm_chip *chip; struct device *dev = &device->dev; acpi_status status; + u32 default_len; u32 sm; int rc; + default_len = sizeof(struct acpi_table_tpm2) - + sizeof(union platform_params); + status = acpi_get_table(ACPI_SIG_TPM2, 1, (struct acpi_table_header **) &buf); - if (ACPI_FAILURE(status) || buf->header.length < sizeof(*buf)) { + if (ACPI_FAILURE(status) || buf->header.length < default_len) { dev_err(dev, FW_BUG "failed to get TPM2 ACPI table\n"); return -EINVAL; } diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index c7e1384..0e2e5f6 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c @@ -253,11 +253,15 @@ static int tpm_tis_acpi_init(struct acpi_device *acpi_dev) acpi_status st; struct list_head resources; struct tpm_info tpm_info = {}; + u32 default_len; int ret; + default_len = sizeof(struct acpi_table_tpm2) - + sizeof(union platform_params); + st = acpi_get_table(ACPI_SIG_TPM2, 1, (struct acpi_table_header **) &tbl); - if (ACPI_FAILURE(st) || tbl->header.length < sizeof(*tbl)) { + if (ACPI_FAILURE(st) || tbl->header.length < default_len) { dev_err(&acpi_dev->dev, FW_BUG "failed to get TPM2 ACPI table\n"); return -EINVAL; diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index 7aee9fb..9612049 100644 --- a/include/acpi/actbl2.h +++ b/include/acpi/actbl2.h @@ -1277,6 +1277,14 @@ struct acpi_table_tcpa_server { * ******************************************************************************/ +struct tpm2_crb_smc { + u32 interrupt; + u8 interrupt_flags; + u8 op_flags; + u16 reserved2; + u32 smc_func_id; +}; + struct acpi_table_tpm2 { struct acpi_table_header header; /* Common ACPI table header */ u16 platform_class; @@ -1285,6 +1293,9 @@ struct acpi_table_tpm2 { u32 start_method; /* Platform-specific data follows */ + union platform_params { + struct tpm2_crb_smc smc_params; + } platform_data; }; /* Values for start_method above */ @@ -1294,6 +1305,7 @@ struct acpi_table_tpm2 { #define ACPI_TPM2_MEMORY_MAPPED 6 #define ACPI_TPM2_COMMAND_BUFFER 7 #define ACPI_TPM2_COMMAND_BUFFER_WITH_START_METHOD 8 +#define ACPI_TPM2_COMMAND_BUFFER_WITH_SMC 11 /******************************************************************************* *