Skip to contentSkip to conversation

Add i2c TPM driver

PATCH New Che-Liang Chiou 3 participants 10 messages Dec 13, 2011 – Dec 14, 2011 Kbuild

lore
Share & tools
lore
#0 lore raw

cover Add i2c TPM driver

This patchset adds an i2c bus based TPM driver.

Che-Liang Chiou (3):
tpm: Rename generic_lpc_tpm to tpm_tis_lpc
tpm: Add i2c TPM driver
tpm: Update README

 Makefile                                         |    2 +-
 README                                           |   18 +-
 drivers/tpm/Makefile                             |    5 +-
 drivers/tpm/tpm.c                                |  457 +++++++++++++++++
 drivers/tpm/tpm_private.h                        |  131 +++++
 drivers/tpm/tpm_tis_i2c.c                        |  584 ++++++++++++++++++++++
 drivers/tpm/{generic_lpc_tpm.c => tpm_tis_lpc.c} |    0
 7 files changed, 1194 insertions(+), 3 deletions(-)
 create mode 100644 drivers/tpm/tpm.c
 create mode 100644 drivers/tpm/tpm_private.h
 create mode 100644 drivers/tpm/tpm_tis_i2c.c
 rename drivers/tpm/{generic_lpc_tpm.c => tpm_tis_lpc.c} (100%)
Signature · 1 line
1.7.3.1
#1 lore raw

PATCH 1/3 tpm: Rename generic_lpc_tpm to tpm_tis_lpc

The new name is more aligned with Linux kernel's naming of TPM driver.

---
 Makefile                                         |    2 +-
 README                                           |    5 ++++-
 drivers/tpm/Makefile                             |    2 +-
 drivers/tpm/{generic_lpc_tpm.c => tpm_tis_lpc.c} |    0
 4 files changed, 6 insertions(+), 3 deletions(-)
 rename drivers/tpm/{generic_lpc_tpm.c => tpm_tis_lpc.c} (100%)
Makefile +1 -1
index de65a17..abeafd7 100644
@@ -277,7 +277,7 @@ LIBS += arch/powerpc/cpu/mpc8xxx/lib8xxx.o
 endif
 LIBS += drivers/rtc/librtc.o
 LIBS += drivers/serial/libserial.o
-ifeq ($(CONFIG_GENERIC_LPC_TPM),y)
+ifeq ($(CONFIG_TPM),y)
 LIBS += drivers/tpm/libtpm.o
 endif
 LIBS += drivers/twserial/libtws.o
README +4 -1
index e9d1891..434384c 100644
@@ -1073,7 +1073,10 @@ The following options need to be configured:
 			If this option is set, the driver enables cache flush.
 
 - TPM Support:
-		CONFIG_GENERIC_LPC_TPM
+		CONFIG_TPM
+		Support TPM devices.
+
+		CONFIG_TPM_TIS_LPC
 		Support for generic parallel port TPM devices. Only one device
 		per system is supported at this time.
 
drivers/tpm/Makefile +1 -1
index be11c8b..47d09de 100644
@@ -23,7 +23,7 @@ include $(TOPDIR)/config.mk
 
 LIB := $(obj)libtpm.o
 
-COBJS-$(CONFIG_GENERIC_LPC_TPM) = generic_lpc_tpm.o
+COBJS-$(CONFIG_TPM_TIS_LPC) = tpm_tis_lpc.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
drivers/tpm/tpm_tis_lpc.c renamed from drivers/tpm/generic_lpc_tpm.c +0 -0
similarity index 100%
rename from drivers/tpm/generic_lpc_tpm.c
rename to drivers/tpm/tpm_tis_lpc.c
Signature · 1 line
1.7.3.1
#3 lore raw

PATCH 1/3 tpm: Rename generic_lpc_tpm to tpm_tis_lpc

In reply to Che-Liang Chiou

-----Original Message-----
From: Che-Liang Chiou [mailto:clchiou at chromium.org]
Sent: Tuesday, December 13, 2011 12:51 PM
To: U-Boot Mailing List
Cc: Simon Glass; Mike Frysinger; Huewe Peter (IFAG CCS TI SWT SW ESW); Che-Liang Chiou
Subject: [PATCH 1/3] tpm: Rename generic_lpc_tpm to tpm_tis_lpc

The new name is more aligned with Linux kernel's naming of TPM driver.

I'm fine with this

(please note my email has changed)

#4 lore raw

PATCH 2/3 tpm: Add i2c TPM driver

In reply to Che-Liang Chiou

Peter Huewe implemented the original driver; this patch only reorganizes the code structure of the driver, and does not make logical changes.

tpm.c implements the interface defined in tpm.h based on underlying LPC or i2C TPM driver. tpm.c and the underlying driver communicate throught tpm_private.h.

This patch is tested on a tegra2-based machine, where the i2c driver is not upstreamed yet.

Note: Merging the LPC driver with tpm.c is left to future patches.

---
 drivers/tpm/Makefile      |    5 +-
 drivers/tpm/tpm.c         |  457 +++++++++++++++++++++++++++++++++++
 drivers/tpm/tpm_private.h |  131 ++++++++++
 drivers/tpm/tpm_tis_i2c.c |  584 +++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 1176 insertions(+), 1 deletions(-)
 create mode 100644 drivers/tpm/tpm.c
 create mode 100644 drivers/tpm/tpm_private.h
 create mode 100644 drivers/tpm/tpm_tis_i2c.c
drivers/tpm/Makefile +4 -1
index 47d09de..cb29bab 100644
@@ -23,7 +23,10 @@ include $(TOPDIR)/config.mk
 
 LIB := $(obj)libtpm.o
 
-COBJS-$(CONFIG_TPM_TIS_LPC) = tpm_tis_lpc.o
+# TODO(clchiou): Merge tpm_tis_lpc.c with tpm.c
+COBJS-$(CONFIG_TPM_TIS_I2C) += tpm.o
+COBJS-$(CONFIG_TPM_TIS_I2C) += tpm_tis_i2c.o
+COBJS-$(CONFIG_TPM_TIS_LPC) += tpm_tis_lpc.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
drivers/tpm/tpm.c new file +457 -0

457 lines not on this page · raw message

drivers/tpm/tpm_private.h new file +131 -0

131 lines not on this page · raw message

drivers/tpm/tpm_tis_i2c.c new file +584 -0

584 lines not on this page · raw message

Signature · 1 line
1.7.3.1
#5 lore raw

PATCH 2/3 tpm: Add i2c TPM driver

Quoted 7 lines · On Tuesday 13 December 2011 06:51:01 Che-Liang Chiou wrote:

Peter Huewe implemented the original driver; this patch only reorganizes the code structure of the driver, and does not make logical changes.

tpm.c implements the interface defined in tpm.h based on underlying LPC or i2C TPM driver. tpm.c and the underlying driver communicate throught tpm_private.h.

Quoted 6 lines

This patch is tested on a tegra2-based machine, where the i2c driver is not upstreamed yet.

Note: Merging the LPC driver with tpm.c is left to future patches.

you need to add your own s-o-b tag here since you're submitting it
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20111213/452928d6/attachment.pgp>

#6 lore raw

PATCH 2/3 tpm: Add i2c TPM driver

In reply to Che-Liang Chiou

-----Original Message-----
From: Che-Liang Chiou [mailto:clchiou at chromium.org]
Sent: Tuesday, December 13, 2011 12:51 PM
To: U-Boot Mailing List
Cc: Simon Glass; Mike Frysinger; Huewe Peter (IFAG CCS TI SWT SW ESW); Che-Liang Chiou
Subject: [PATCH 2/3] tpm: Add i2c TPM driver

Peter Huewe implemented the original driver; this patch only reorganizes the code structure of the driver, and does not make logical changes.

tpm.c implements the interface defined in tpm.h based on underlying LPC or i2C TPM driver. tpm.c and the underlying driver communicate throught tpm_private.h.

This patch is tested on a tegra2-based machine, where the i2c driver is not upstreamed yet.

Note: Merging the LPC driver with tpm.c is left to future patches.

[[[PH]]]
I'm fine with this

(please note my email has changed)

#7 lore raw

PATCH 3/3 tpm: Update README

In reply to Che-Liang Chiou

Document TPM_TIS_I2C-related config options in README.

---
 README |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
README +13 -0
index 434384c..badb834 100644
@@ -1076,6 +1076,19 @@ The following options need to be configured:
 		CONFIG_TPM
 		Support TPM devices.
 
+		CONFIG_TPM_TIS_I2C
+		Support for i2c bus TPM devices. Only one device
+		per system is supported at this time.
+
+			CONFIG_TPM_TIS_I2C_BUS_NUMBER
+			Define the the i2c bus number for the TPM device
+
+			CONFIG_TPM_TIS_I2C_SLAVE_ADDRESS
+			Define the TPM's address on the i2c bus
+
+			CONFIG_TPM_TIS_I2C_BURST_LIMITATION
+			Define the burst count bytes upper limit
+
 		CONFIG_TPM_TIS_LPC
 		Support for generic parallel port TPM devices. Only one device
 		per system is supported at this time.
Signature · 1 line
1.7.3.1
#8 lore raw

PATCH 3/3 tpm: Update README

Quoted 1 line · On Tuesday 13 December 2011 06:51:02 Che-Liang Chiou wrote:

Document TPM_TIS_I2C-related config options in README.

this should probably just be squashed into:
[PATCH 2/3] tpm: Add i2c TPM driver
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20111213/6368486a/attachment.pgp>

#9 lore raw

PATCH 3/3 tpm: Update README

In reply to Che-Liang Chiou

-----Original Message-----
From: Che-Liang Chiou [mailto:clchiou at chromium.org]
Sent: Tuesday, December 13, 2011 12:51 PM
To: U-Boot Mailing List
Cc: Simon Glass; Mike Frysinger; Huewe Peter (IFAG CCS TI SWT SW ESW); Che-Liang Chiou
Subject: [PATCH 3/3] tpm: Update README

Document TPM_TIS_I2C-related config options in README.

I'm fine with this

(please note my email has changed)