Skip to content

Commit 27084ef

Browse files
Leendert van DoornLinus Torvalds
authored andcommitted
[PATCH] tpm: driver for next generation TPM chips
The driver for the next generation of TPM chips version 1.2 including support for interrupts. The Trusted Computing Group has written the TPM Interface Specification (TIS) which defines a common interface for all manufacturer's 1.2 TPM's thus the name tpm_tis. Signed-off-by: Leendert van Doorn <[email protected]> Signed-off-by: Kylene Hall <[email protected]> Cc: Greg KH <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 08e96e4 commit 27084ef

File tree

5 files changed

+670
-1
lines changed

5 files changed

+670
-1
lines changed

drivers/char/tpm/Kconfig

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,18 @@ config TCG_TPM
2020
Note: For more TPM drivers enable CONFIG_PNP, CONFIG_ACPI
2121
and CONFIG_PNPACPI.
2222

23+
config TCG_TIS
24+
tristate "TPM Interface Specification 1.2 Interface"
25+
depends on TCG_TPM
26+
---help---
27+
If you have a TPM security chip that is compliant with the
28+
TCG TIS 1.2 TPM specification say Yes and it will be accessible
29+
from within Linux. To compile this driver as a module, choose
30+
M here; the module will be called tpm_tis.
31+
2332
config TCG_NSC
2433
tristate "National Semiconductor TPM Interface"
25-
depends on TCG_TPM
34+
depends on TCG_TPM && PNPACPI
2635
---help---
2736
If you have a TPM security chip from National Semicondutor
2837
say Yes and it will be accessible from within Linux. To

drivers/char/tpm/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ obj-$(CONFIG_TCG_TPM) += tpm.o
55
ifdef CONFIG_ACPI
66
obj-$(CONFIG_TCG_TPM) += tpm_bios.o
77
endif
8+
obj-$(CONFIG_TCG_TIS) += tpm_tis.o
89
obj-$(CONFIG_TCG_NSC) += tpm_nsc.o
910
obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o
1011
obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o

drivers/char/tpm/tpm.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,9 @@ static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
390390
goto out;
391391
}
392392

393+
if (chip->vendor.irq)
394+
goto out_recv;
395+
393396
stop = jiffies + tpm_calc_ordinal_duration(chip, ordinal);
394397
do {
395398
u8 status = chip->vendor.status(chip);

drivers/char/tpm/tpm.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ struct tpm_vendor_specific {
6464
void __iomem *iobase; /* ioremapped address */
6565
unsigned long base; /* TPM base address */
6666

67+
int irq;
68+
6769
int region_size;
6870
int have_region;
6971

@@ -73,8 +75,13 @@ struct tpm_vendor_specific {
7375
u8 (*status) (struct tpm_chip *);
7476
struct miscdevice miscdev;
7577
struct attribute_group *attr_group;
78+
struct list_head list;
79+
int locality;
7680
u32 timeout_a, timeout_b, timeout_c, timeout_d;
7781
u32 duration[3];
82+
83+
wait_queue_head_t read_queue;
84+
wait_queue_head_t int_queue;
7885
};
7986

8087
struct tpm_chip {
@@ -100,6 +107,8 @@ struct tpm_chip {
100107
struct list_head list;
101108
};
102109

110+
#define to_tpm_chip(n) container_of(n, struct tpm_chip, vendor)
111+
103112
static inline int tpm_read_index(int base, int index)
104113
{
105114
outb(index, base);

0 commit comments

Comments
 (0)