Add i2c TPM driver
v2 cover Add i2c TPM driver
This patchset adds an i2c bus based TPM driver.
Changes in v1:
- Update s-o-b Peter Huewe's email address
- Squash patch #3 into patch #2
Changes in v2:
- Style improvements
Che-Liang Chiou (2):
tpm: Rename generic_lpc_tpm to tpm_tis_lpc
tpm: Add i2c TPM driver
Makefile | 2 +-
README | 18 +-
drivers/tpm/Makefile | 5 +-
drivers/tpm/tpm.c | 466 +++++++++++++++++
drivers/tpm/tpm_private.h | 134 +++++
drivers/tpm/tpm_tis_i2c.c | 587 ++++++++++++++++++++++
drivers/tpm/{generic_lpc_tpm.c => tpm_tis_lpc.c} | 0
7 files changed, 1209 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
PATCH v2 1/2 tpm: Rename generic_lpc_tpm to tpm_tis_lpc
The new name is more aligned with Linux kernel's naming of TPM driver.
---
Changes in v1:
- Update s-o-b Peter Huewe's email address
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
@@ -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
@@ -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
@@ -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
Signature · 1 line
1.7.3.1
PATCH v2 2/2 tpm: Add i2c TPM driver
In reply to Che-Liang ChiouPeter 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.
---
Changes in v1:
- Squash patch #3 into patch #2
Changes in v2:
- Style improvements
README | 13 + drivers/tpm/Makefile | 5 +- drivers/tpm/tpm.c | 466 +++++++++++++++++++++++++++++++++++ drivers/tpm/tpm_private.h | 134 ++++++++++ drivers/tpm/tpm_tis_i2c.c | 587 +++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 1204 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
README +13 -0
@@ -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.
drivers/tpm/Makefile +4 -1
@@ -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 +466 -0
466 lines not on this page · raw message
drivers/tpm/tpm_private.h new file +134 -0
134 lines not on this page · raw message
drivers/tpm/tpm_tis_i2c.c new file +587 -0
587 lines not on this page · raw message
Signature · 1 line
1.7.3.1
v2 cover Add i2c TPM driver
In reply to Che-Liang ChiouDear Che-Liang Chiou,
Quoted 2 lines · In message <[email protected]> you wrote:
This patchset adds an i2c bus based TPM driver.
Are there any users of this driver?
I see we are adding TPM code, but so far this is all dead code as there are no users for it.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
History is only a confused heap of facts.
-- Philip Earl of Chesterfieldv2 cover Add i2c TPM driver
Dear Che-Liang Chiou,
Quoted 9 lines · In message <[email protected]> I wrote:
Quoted 2 lines · In message <[email protected]> you wrote:
This patchset adds an i2c bus based TPM driver.
Are there any users of this driver?
I see we are adding TPM code, but so far this is all dead code as there are no users for it.
I think I never received any reply.
Are there any plans of adding code that actually uses these drivers? If this is only dead code which is not used by any board, we may as well omit resp. remove it.
Please comment.
Thanks.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de In the realm of scientific observation, luck is granted only to those who are prepared. - Louis Pasteur
v2 cover Add i2c TPM driver
Quoted 6 lines · Wolfgang Denk
Dear Che-Liang Chiou,
Quoted 3 lines · In message <[email protected]> I wrote:
Quoted 1 line · In message <[email protected]> you wrote:
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
This patchset adds an i2c bus based TPM driver.
Are there any users of this driver?
I see we are adding TPM code, but so far this is all dead code as there are no users for it.
I think I never received any reply.
I thought that we've discussed that I should wait until tegra2 i2c driver is merged into mainline, and then resubmit this patch series (cf. "[PATCH v1 1/2] tpm: Rename generic_lpc_tpm to tpm_tis_lpc").
Quoted 18 lines
Are there any plans of adding code that actually uses these drivers? If this is only dead code which is not used by any board, we may as well omit resp. remove it.
Please comment.
Thanks.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, ? ? MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de In the realm of scientific observation, luck is granted only to those who are prepared. ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? - Louis Pasteur
v2 cover Add i2c TPM driver
Dear Che-liang Chiou,
Quoted 6 lines · In message <CANJuy2+=qELDW04C8+1pJ6Kq_yhbK+rjQed_gm72R0DdNJxD3A@mail.gmail.com>…
Quoted 2 lines
I think I never received any reply.
I thought that we've discussed that I should wait until tegra2 i2c driver is merged into mainline, and then resubmit this patch series (cf. "[PATCH v1 1/2] tpm: Rename
generic_lpc_tpmtotpm_tis_lpc").
OK, thanks. I'll wait for the updates, then.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Uncontrolled power will turn even saints into savages. And we can all be counted on to live down to our lowest impulses. -- Parmen, "Plato's Stepchildren", stardate 5784.3