From patchwork Sun Jun 19 08:20:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: andrew.zamansky@nuvoton.com X-Patchwork-Id: 637666 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 3rXRhC3Mhhz9t0Z for ; Sun, 19 Jun 2016 18:18:19 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1bEXvo-00067f-3o; Sun, 19 Jun 2016 08:18:12 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1bEXvm-00067D-Sm for tpmdd-devel@lists.sourceforge.net; Sun, 19 Jun 2016 08:18:10 +0000 Received: from 212.199.177.27.static.012.net.il ([212.199.177.27] helo=herzl.nuvoton.co.il) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1bEXvj-0001xT-3b for tpmdd-devel@lists.sourceforge.net; Sun, 19 Jun 2016 08:18:10 +0000 Received: from talu02.nuvoton.co.il (ntil-fw [212.199.177.25]) by herzl.nuvoton.co.il (8.13.8/8.13.8) with ESMTP id u5J850lY005443; Sun, 19 Jun 2016 11:05:00 +0300 Received: from andrew-desktop.nuvoton.com (unknown [10.191.20.94]) by talu02.nuvoton.co.il (Postfix) with ESMTP id 3C53626267; Sun, 19 Jun 2016 11:17:54 +0300 (IDT) From: andrew zamansky To: jarkko.sakkinen@linux.intel.com, tpmdd-devel@lists.sourceforge.net Date: Sun, 19 Jun 2016 11:20:01 +0300 Message-Id: <1466324401-5054-3-git-send-email-andrew.zamansky@nuvoton.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1466324401-5054-1-git-send-email-andrew.zamansky@nuvoton.com> References: <1466324401-5054-1-git-send-email-andrew.zamansky@nuvoton.com> MIME-Version: 1.0 X-MIME-Autoconverted: from 8bit to quoted-printable by herzl.nuvoton.co.il id u5J850lY005443 X-Spam-Score: 0.0 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 TVD_RCVD_IP Message was received from an IP address X-Headers-End: 1bEXvj-0001xT-3b Cc: devicetree@vger.kernel.org, andrew.zamansky@nuvoton.com, gcwilson@us.ibm.com, azamansk@nuvoton.com, Dan.Morav@nuvoton.com, stimpy1@gmail.com Subject: [tpmdd-devel] [PATCH 2/2] tpm: Add TPM 2.0 support to the Nuvoton i2c driver (NPCT6xx family) 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: , Errors-To: tpmdd-devel-bounces@lists.sourceforge.net From: Jason Gunthorpe The command flow is exactly the same, the core simply needs to probe for TPM 2.0 capability. Signed-off-by: Andrew Azmansky Signed-off-by: Jason Gunthorpe Acked-by: Rob Herring --- Documentation/devicetree/bindings/i2c/trivial-devices.txt | 1 + drivers/char/tpm/tpm_i2c_nuvoton.c | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt index 53987449..d4f6542 100644 --- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt +++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt @@ -62,6 +62,7 @@ national,lm80 Serial Interface ACPI-Compatible Microprocessor System Hardware M national,lm85 Temperature sensor with integrated fan control national,lm92 ±0.33°C Accurate, 12-Bit + Sign Temperature Sensor and Thermal Window Comparator with Two-Wire Interface nuvoton,npct501 i2c trusted platform module (TPM) +nuvoton,npct601 i2c trusted platform module (TPM2) nxp,pca9556 Octal SMBus and I2C registered interface nxp,pca9557 8-bit I2C-bus and SMBus I/O port with reset nxp,pcf8563 Real-time clock/calendar diff --git a/drivers/char/tpm/tpm_i2c_nuvoton.c b/drivers/char/tpm/tpm_i2c_nuvoton.c index b64effc..dbf6095 100644 --- a/drivers/char/tpm/tpm_i2c_nuvoton.c +++ b/drivers/char/tpm/tpm_i2c_nuvoton.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Nuvoton TPM I2C Device Driver Interface for WPCT301/NPCT501, + * Nuvoton TPM I2C Device Driver Interface for WPCT301/NPCT501/NPCT6XX, * based on the TCG TPM Interface Spec version 1.2. * Specifications at www.trustedcomputinggroup.org * @@ -163,7 +163,7 @@ static int i2c_nuvoton_get_burstcount(struct i2c_client *client, } /* - * WPCT301/NPCT501 SINT# supports only dataAvail + * WPCT301/NPCT501/NPCT6XX SINT# supports only dataAvail * any call to this function which is not waiting for dataAvail will * set queue to NULL to avoid waiting for interrupt */ @@ -456,7 +456,7 @@ static bool i2c_nuvoton_req_canceled(struct tpm_chip *chip, u8 status) } static const struct tpm_class_ops tpm_i2c = { - .flags = TPM_OPS_AUTO_STARTUP, + .flags = TPM_OPS_AUTO_STARTUP | TPM_OPS_PROBE_TPM2, .status = i2c_nuvoton_read_status, .recv = i2c_nuvoton_recv, .send = i2c_nuvoton_send, @@ -623,6 +623,7 @@ MODULE_DEVICE_TABLE(i2c, i2c_nuvoton_id); static const struct of_device_id i2c_nuvoton_of_match[] = { {.compatible = "nuvoton,npct501"}, {.compatible = "winbond,wpct301"}, + {.compatible = "nuvoton,npct601"}, {}, }; MODULE_DEVICE_TABLE(of, i2c_nuvoton_of_match);