tpm: Add support for Atmel I2C TPMs
Subsystems (4)
PATCH v2 1/1 tpm: Add support for Atmel I2C TPMs
This is based on the work of Teddy Reed <[email protected]> published on GitHub:
https://github.com/theopolis/tpm-i2c-atmel.git
34894b988b67e0ae55088d6388e77b0dbf10c07d
That driver was never merged, I have taken it as a starting port, forward ported, tested and revised the driver:
- Make it broadly textually similar to the Infineon and Nuvoton I2C driver
- Place everything in a format suitable for mainline inclusion
- Use high level I2C functions i2c_smbus_write_i2c_block_data and i2c_master_recv for data xfer
- Use the timeout system from the core code, by faking out a status register
- checkpatch cleanups
- Testing on ARM Kirkwood, with this device tree, using a AT97SC3204T-X1A180
tpm@29 {
compatible = "atmel,at97sc3204t";
reg = <0x29>;
};PENDING: Teddy will need to provide a public Signed-Off line for this driver, although very little of his original text remained unchanged, the work to discover the protocol is entirely his and he will need to certify the Developer Certification of Origin that it is suitable for mainline inclusion.
--- .../devicetree/bindings/i2c/trivial-devices.txt | 1 + drivers/char/tpm/Kconfig | 9 + drivers/char/tpm/Makefile | 1 + drivers/char/tpm/tpm_i2c_atmel.c | 285 +++++++++++++++++++++ 4 files changed, 296 insertions(+) create mode 100644 drivers/char/tpm/tpm_i2c_atmel.c
v2 changes:
- Fix outgoing xfers of > 64 bytes by not using smbus
- Greatly improve performance of incoming xfers by making the transfer be done in two stages. Testing shows that the chip retains the last reply and multiple reads are OK.
- Rebase to v3.12-rc1
- Testing on v3.12-rc1 on ARM kirkwood
Documentation/devicetree/bindings/i2c/trivial-devices.txt +1 -0
@@ -15,6 +15,7 @@ adi,adt7461 +/-1C TDM Extended Temp Range I.C adt7461 +/-1C TDM Extended Temp Range I.C at,24c08 i2c serial eeprom (24cxx) atmel,24c02 i2c serial eeprom (24cxx) +atmel,at97sc3204t i2c trusted platform module (TPM) catalyst,24c32 i2c serial eeprom dallas,ds1307 64 x 8, Serial, I2C Real-Time Clock dallas,ds1338 I2C RTC with 56-Byte NV RAM
drivers/char/tpm/Kconfig +9 -0
@@ -33,6 +33,15 @@ config TCG_TIS from within Linux. To compile this driver as a module, choose M here; the module will be called tpm_tis. +config TCG_TIS_I2C_ATMEL + tristate "TPM Interface Specification 1.2 Interface (I2C - Atmel)" + depends on I2C + ---help--- + If you have an Atmel I2C TPM security chip 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_tis_i2c_atmel. + config TCG_TIS_I2C_INFINEON tristate "TPM Interface Specification 1.2 Interface (I2C - Infineon)" depends on I2C
drivers/char/tpm/Makefile +1 -0
@@ -12,6 +12,7 @@ ifdef CONFIG_TCG_IBMVTPM endif endif obj-$(CONFIG_TCG_TIS) += tpm_tis.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_NSC) += tpm_nsc.o
drivers/char/tpm/tpm_i2c_atmel.c new file +285 -0
285 lines not on this page · raw message
Signature · 6 lines
1.8.1.2 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html