Skip to contentSkip to conversation

char: tpm: add new driver for tpm i2c ptp

PATCH Superseded Oshri Alkoby 2 participants 6 messages Jun 25, 2019 – Jun 27, 2019

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover char: tpm: add new driver for tpm i2c ptp

This patch set adds support for TPM devices that implement the I2C interface defined by TCG PTP specification.

The driver was tested on Raspberry-Pie 3, using Nuvoton NPCT75X TPM.

Oshri Alkoby (2):
dt-bindings: tpm: add the TPM I2C PTP device tree binding
documentation
char: tpm: add new driver for tpm i2c ptp

 .../bindings/security/tpm/tpm-i2c-ptp.txt     |   17 +
 drivers/char/tpm/Kconfig                      |   22 +
 drivers/char/tpm/Makefile                     |    1 +
 drivers/char/tpm/tpm_i2c_ptp.c                | 1099 +++++++++++++++++
 4 files changed, 1139 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/security/tpm/tpm-i2c-ptp.txt
 create mode 100644 drivers/char/tpm/tpm_i2c_ptp.c
Signature · 1 line
2.18.0
#1 lore raw

PATCH 1/2 dt-bindings: tpm: add the TPM I2C PTP device tree binding documentation

---
 .../bindings/security/tpm/tpm-i2c-ptp.txt       | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/security/tpm/tpm-i2c-ptp.txt
Documentation/devicetree/bindings/security/tpm/tpm-i2c-ptp.txt new file +17 -0
new file mode 100644
index 000000000000..6bd512f023a4
@@ -0,0 +1,17 @@
+* Device Tree Bindings for I2C PTP based Trusted Platform Module(TPM)
+
+Required properties:
+
+- compatible     : Should be "tcg,tpm_i2c_ptp"
+- reg            : Address on the bus
+- tpm-pirq       : Input gpio pin, used for host interrupts
+
+Example (for Raspberry Pie 3 Board with Nuvoton's NPCT75X (2.0)
+-------------------------------------------------------------------
+
+tpm_i2c_ptp: tpm_i2c_ptp@2e {
+
+	compatible = "tcg,tpm_i2c_ptp";
+	reg = <0x2e>;
+	tpm-pirq = <&gpio 24 GPIO_ACTIVE_HIGH>;
+};
Signature · 1 line
2.18.0
#3 lore raw

PATCH 2/2 char: tpm: add new driver for tpm i2c ptp

In reply to Oshri Alkoby
---
 drivers/char/tpm/Kconfig       |   22 +
 drivers/char/tpm/Makefile      |    1 +
 drivers/char/tpm/tpm_i2c_ptp.c | 1099 ++++++++++++++++++++++++++++++++
 3 files changed, 1122 insertions(+)
 create mode 100644 drivers/char/tpm/tpm_i2c_ptp.c
drivers/char/tpm/Kconfig +22 -0
index 88a3c06fc153..ea4138145191 100644
@@ -97,6 +97,28 @@ config TCG_TIS_I2C_NUVOTON
 	  To compile this driver as a module, choose M here; the module
 	  will be called tpm_i2c_nuvoton.
 
+config TCG_TIS_I2C_PTP
+	tristate "TPM Interface Specification 1.2/2.0 Interface (I2C - PTP)"
+	depends on I2C
+	select CRC_CCITT
+	---help---
+	  If you have a TPM security chip with an I2C interface that impelements
+	  the TPM I2C interface protocol defined by the PTP say Yes and it will be
+	  accessible from within Linux.
+	  To compile this driver as a module, choose M here; the module
+	  will be called tpm_i2c_ptp.
+
+config TCG_TIS_I2C_PTP_MAX_SIZE
+	prompt "Max I2C Buffer Size"
+	depends on TCG_TIS_I2C_PTP
+	int
+	default 32
+	help
+	  Set the maximal I2C buffer size. This will alter the default value. A
+	  different size can be set by using a module parameter (i2c_max_size)
+	  as well. If no parameter is provided when loading, this is the value
+	  that will be used.
+
 config TCG_NSC
 	tristate "National Semiconductor TPM Interface"
 	depends on X86
drivers/char/tpm/Makefile +1 -0
index a01c4cab902a..d736f22205cb 100644
@@ -25,6 +25,7 @@ obj-$(CONFIG_TCG_TIS_SPI) += tpm_tis_spi.o
 obj-$(CONFIG_TCG_TIS_I2C_ATMEL) += tpm_i2c_atmel.o
 obj-$(CONFIG_TCG_TIS_I2C_INFINEON) += tpm_i2c_infineon.o
 obj-$(CONFIG_TCG_TIS_I2C_NUVOTON) += tpm_i2c_nuvoton.o
+obj-$(CONFIG_TCG_TIS_I2C_PTP) += tpm_i2c_ptp.o
 obj-$(CONFIG_TCG_NSC) += tpm_nsc.o
 obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o
 obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o
drivers/char/tpm/tpm_i2c_ptp.c new file +1099 -0

1,099 lines not on this page · raw message

Signature · 1 line
2.18.0
#5 lore raw
In reply to Oshri Alkoby
Quoted 4 lines · Oshri Alkoby

This patch set adds support for TPM devices that implement the I2C interface defined by TCG PTP specification.

The driver was tested on Raspberry-Pie 3, using Nuvoton NPCT75X TPM.

Where is the link to teh spec?

/Jarkko