This patch to the Linux kernel add the support of the Intel iTPM (Integrated TPM, found in the Intel GM45 chipsets) to the tpm_tis driver. What is wrong with the iTPM ? o It has a non standard ACPI HID so plug and play (PNP) will not work. o It returns a wrong TIS status when sending a TPM command. What does this patch do to the tpm_tis driver ? o changes the default paramaters to disable the ACPI plug and play (force=1) and the interrupts (interrupts=0) o sets the default time out before calling request_locality() during the initialisation of the TPM o checks if the status is TPM_STS_VALID in tpm_tis_send() (not TPM_STS_DATA_EXPECT) which actually makes the TPM driver working Many thanks to Seiji Munetoh on the mailing list of the Linux TPM driver (http://sf.net/projects/tpmdd). --- drivers/char/tpm/tpm_tis.c.orig 2009-02-02 14:42:32.000000000 +0900 +++ drivers/char/tpm/tpm_tis.c 2009-02-02 18:12:12.000000000 +0900 @@ -293,7 +293,7 @@ wait_for_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c, &chip->vendor.int_queue); status = tpm_tis_status(chip); - if ((status & TPM_STS_DATA_EXPECT) == 0) { + if ((status & TPM_STS_VALID) == 0) { rc = -EIO; goto out_err; } @@ -430,7 +430,7 @@ return IRQ_HANDLED; } -static int interrupts = 1; +static int interrupts = 0; module_param(interrupts, bool, 0444); MODULE_PARM_DESC(interrupts, "Enable interrupts"); @@ -450,19 +450,19 @@ goto out_err; } - if (request_locality(chip, 0) != 0) { - rc = -ENODEV; - goto out_err; - } - - vendor = ioread32(chip->vendor.iobase + TPM_DID_VID(0)); - /* Default timeouts */ chip->vendor.timeout_a = msecs_to_jiffies(TIS_SHORT_TIMEOUT); chip->vendor.timeout_b = msecs_to_jiffies(TIS_LONG_TIMEOUT); chip->vendor.timeout_c = msecs_to_jiffies(TIS_SHORT_TIMEOUT); chip->vendor.timeout_d = msecs_to_jiffies(TIS_SHORT_TIMEOUT); + if (request_locality(chip, 0) != 0) { + rc = -ENODEV; + goto out_err; + } + + vendor = ioread32(chip->vendor.iobase + TPM_DID_VID(0)); + dev_info(dev, "1.2 TPM (device-id 0x%X, rev-id %d)\n", vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0))); @@ -652,7 +652,7 @@ static struct platform_device *pdev; -static int force; +static int force = 1; module_param(force, bool, 0444); MODULE_PARM_DESC(force, "Force device probe rather than using ACPI entry"); static int __init init_tis(void)