devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: andrew zamansky <andrew.zamansky-KrzQf0k3Iz9BDgjK7y7TUQ@public.gmane.org>
To: jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
	tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	andrew.zamansky-KrzQf0k3Iz9BDgjK7y7TUQ@public.gmane.org,
	gcwilson-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org,
	azamansk-KrzQf0k3Iz9BDgjK7y7TUQ@public.gmane.org,
	Dan.Morav-KrzQf0k3Iz9BDgjK7y7TUQ@public.gmane.org,
	stimpy1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: [PATCH 2/2] tpm: Add TPM 2.0 support to the Nuvoton i2c driver (NPCT6xx family)
Date: Sun, 19 Jun 2016 11:20:01 +0300	[thread overview]
Message-ID: <1466324401-5054-3-git-send-email-andrew.zamansky@nuvoton.com> (raw)
In-Reply-To: <1466324401-5054-1-git-send-email-andrew.zamansky-KrzQf0k3Iz9BDgjK7y7TUQ@public.gmane.org>

From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>

The command flow is exactly the same, the core simply needs to probe
for TPM 2.0 capability.

Signed-off-by: Andrew Azmansky <andrew.zamansky@nuvoton.com>
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
---
 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);
-- 
1.9.1


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://sdm.link/zohomanageengine
_______________________________________________
tpmdd-devel mailing list
tpmdd-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tpmdd-devel

  parent reply	other threads:[~2016-06-19  8:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-19  8:19 [PATCH 0/2] Add TPM 2.0 support to the Nuvoton i2c driver andrew zamansky
     [not found] ` <1466324401-5054-1-git-send-email-andrew.zamansky-KrzQf0k3Iz9BDgjK7y7TUQ@public.gmane.org>
2016-06-19  8:20   ` [PATCH 1/2] tpm: Factor out common startup code andrew zamansky
     [not found]     ` <1466324401-5054-2-git-send-email-andrew.zamansky-KrzQf0k3Iz9BDgjK7y7TUQ@public.gmane.org>
2016-06-19 12:39       ` Jarkko Sakkinen
     [not found]         ` <20160619123923.GA31053-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-06-20 21:07           ` Jason Gunthorpe
     [not found]             ` <20160620210757.GB11746-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-06-22 12:22               ` Jarkko Sakkinen
     [not found]                 ` <20160622122227.GA27577-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-06-22 21:37                   ` Jason Gunthorpe
2016-06-24 18:14                   ` Jason Gunthorpe
     [not found]                     ` <20160624181437.GB14506-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-06-24 20:17                       ` Jarkko Sakkinen
2016-06-25  7:07                       ` Andrew Zamansky
2016-06-19  8:20   ` andrew zamansky [this message]
     [not found]     ` <1466324401-5054-3-git-send-email-andrew.zamansky-KrzQf0k3Iz9BDgjK7y7TUQ@public.gmane.org>
2016-06-20 17:59       ` [PATCH 2/2] tpm: Add TPM 2.0 support to the Nuvoton i2c driver (NPCT6xx family) Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1466324401-5054-3-git-send-email-andrew.zamansky@nuvoton.com \
    --to=andrew.zamansky-krzqf0k3iz9bdgjk7y7tuq@public.gmane.org \
    --cc=Dan.Morav-KrzQf0k3Iz9BDgjK7y7TUQ@public.gmane.org \
    --cc=azamansk-KrzQf0k3Iz9BDgjK7y7TUQ@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=gcwilson-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
    --cc=jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=stimpy1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).