From patchwork Thu Jun 2 11:06:34 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: 9149813 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 062EF60751 for ; Thu, 2 Jun 2016 11:55:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E058B25EF7 for ; Thu, 2 Jun 2016 11:55:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C2C8327D45; Thu, 2 Jun 2016 11:55:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 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 mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CF5F225EF7 for ; Thu, 2 Jun 2016 11:55:51 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1b8RE4-0001A2-WA; Thu, 02 Jun 2016 11:55:48 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1b8RE4-00019w-8t for tpmdd-devel@lists.sourceforge.net; Thu, 02 Jun 2016 11:55:48 +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 1b8RDz-0002ze-9a for tpmdd-devel@lists.sourceforge.net; Thu, 02 Jun 2016 11:55:48 +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 u52ApeUU030111; Thu, 2 Jun 2016 13:51:40 +0300 Received: from andrew-desktop (unknown [10.191.20.92]) by talu02.nuvoton.co.il (Postfix) with ESMTP id 8A0151FFDA; Thu, 2 Jun 2016 14:04:25 +0300 (IDT) Date: Thu, 2 Jun 2016 14:06:34 +0300 From: andrew To: jgunthorpe@obsidianresearch.com, jarkko.sakkinen@linux.intel.com Message-ID: <20160602140634.6ab408bc@andrew-desktop> MIME-Version: 1.0 X-Headers-End: 1b8RDz-0002ze-9a Cc: andrew.zamansky@nuvoton.com, Dan.Morav@nuvoton.com, tpmdd-devel@lists.sourceforge.net, gcwilson@us.ibm.com, stimpy1@gmail.com Subject: [tpmdd-devel] [PATCH] adding tpm2.0 support to nuvoton drivers and adding npct6xx 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 X-Virus-Scanned: ClamAV using ClamSMTP From 401214bfbece31e3ef783f13b762da6f83d10f84 Mon Sep 17 00:00:00 2001 From: andrew azmansky Date: Thu, 2 Jun 2016 09:13:28 +0300 Subject: [PATCH] adding tpm2.0 support to nuvoton drivers and adding npct6xx to device tree Signed-off-by: Andrew Zamansky --- Documentation/devicetree/bindings/i2c/trivial-devices.txt | 1 + drivers/char/tpm/tpm_i2c_nuvoton.c | 5 +++-- drivers/char/tpm/tpm_tis.c | 2 +- 3 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 5398744..0a07cbc 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,npct6xx i2c trusted platform module (TPM) 6xx series 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..7fb0e6c 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 * @@ -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,npct6xx"}, {}, }; MODULE_DEVICE_TABLE(of, i2c_nuvoton_of_match); diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index 30aff5b..bc5fba3 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c @@ -524,7 +524,7 @@ static bool tpm_tis_req_canceled(struct tpm_chip *chip, u8 status) } static const struct tpm_class_ops tpm_tis = { - .flags = TPM_OPS_AUTO_STARTUP, + .flags = TPM_OPS_AUTO_STARTUP | TPM_OPS_PROBE_TPM2, .status = tpm_tis_status, .recv = tpm_tis_recv, .send = tpm_tis_send,