Commit 27084efe authored by Leendert van Doorn's avatar Leendert van Doorn Committed by Linus Torvalds

[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: default avatarLeendert van Doorn <leendert@watson.ibm.com>
Signed-off-by: default avatarKylene Hall <kjhall@us.ibm.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 08e96e48
...@@ -20,9 +20,18 @@ config TCG_TPM ...@@ -20,9 +20,18 @@ config TCG_TPM
Note: For more TPM drivers enable CONFIG_PNP, CONFIG_ACPI Note: For more TPM drivers enable CONFIG_PNP, CONFIG_ACPI
and CONFIG_PNPACPI. and CONFIG_PNPACPI.
config TCG_TIS
tristate "TPM Interface Specification 1.2 Interface"
depends on TCG_TPM
---help---
If you have a TPM security chip that is compliant with the
TCG TIS 1.2 TPM specification 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.
config TCG_NSC config TCG_NSC
tristate "National Semiconductor TPM Interface" tristate "National Semiconductor TPM Interface"
depends on TCG_TPM depends on TCG_TPM && PNPACPI
---help--- ---help---
If you have a TPM security chip from National Semicondutor If you have a TPM security chip from National Semicondutor
say Yes and it will be accessible from within Linux. To say Yes and it will be accessible from within Linux. To
......
...@@ -5,6 +5,7 @@ obj-$(CONFIG_TCG_TPM) += tpm.o ...@@ -5,6 +5,7 @@ obj-$(CONFIG_TCG_TPM) += tpm.o
ifdef CONFIG_ACPI ifdef CONFIG_ACPI
obj-$(CONFIG_TCG_TPM) += tpm_bios.o obj-$(CONFIG_TCG_TPM) += tpm_bios.o
endif endif
obj-$(CONFIG_TCG_TIS) += tpm_tis.o
obj-$(CONFIG_TCG_NSC) += tpm_nsc.o obj-$(CONFIG_TCG_NSC) += tpm_nsc.o
obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o
obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o
...@@ -390,6 +390,9 @@ static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf, ...@@ -390,6 +390,9 @@ static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
goto out; goto out;
} }
if (chip->vendor.irq)
goto out_recv;
stop = jiffies + tpm_calc_ordinal_duration(chip, ordinal); stop = jiffies + tpm_calc_ordinal_duration(chip, ordinal);
do { do {
u8 status = chip->vendor.status(chip); u8 status = chip->vendor.status(chip);
......
...@@ -64,6 +64,8 @@ struct tpm_vendor_specific { ...@@ -64,6 +64,8 @@ struct tpm_vendor_specific {
void __iomem *iobase; /* ioremapped address */ void __iomem *iobase; /* ioremapped address */
unsigned long base; /* TPM base address */ unsigned long base; /* TPM base address */
int irq;
int region_size; int region_size;
int have_region; int have_region;
...@@ -73,8 +75,13 @@ struct tpm_vendor_specific { ...@@ -73,8 +75,13 @@ struct tpm_vendor_specific {
u8 (*status) (struct tpm_chip *); u8 (*status) (struct tpm_chip *);
struct miscdevice miscdev; struct miscdevice miscdev;
struct attribute_group *attr_group; struct attribute_group *attr_group;
struct list_head list;
int locality;
u32 timeout_a, timeout_b, timeout_c, timeout_d; u32 timeout_a, timeout_b, timeout_c, timeout_d;
u32 duration[3]; u32 duration[3];
wait_queue_head_t read_queue;
wait_queue_head_t int_queue;
}; };
struct tpm_chip { struct tpm_chip {
...@@ -100,6 +107,8 @@ struct tpm_chip { ...@@ -100,6 +107,8 @@ struct tpm_chip {
struct list_head list; struct list_head list;
}; };
#define to_tpm_chip(n) container_of(n, struct tpm_chip, vendor)
static inline int tpm_read_index(int base, int index) static inline int tpm_read_index(int base, int index)
{ {
outb(index, base); outb(index, base);
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment