aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorStefan Berger <stefanb@linux.vnet.ibm.com>2012-01-20 12:58:49 -0500
committerRajiv Andrade <srajiv@linux.vnet.ibm.com>2012-02-14 13:43:08 -0500
commit4e401fb028b79105ed87d85fc2220c77be277ed9 (patch)
tree8ac642d06075f499f8a102fec06cb75a0cd1e7bc /drivers/char
parent4040153087478993cbf0809f444400a3c808074c (diff)
tpm_tis: Only probe iTPMs
Detect iTPMs through the vendor ID on the hardware interface and only probe the device if the manufacturer is found to be Intel. This obsoletes a previously added delay necessary for some TPMs but not iTPMs. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/tpm/tpm.h2
-rw-r--r--drivers/char/tpm/tpm_tis.c8
2 files changed, 7 insertions, 3 deletions
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index 010547138281..b1c5280ac159 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -99,6 +99,8 @@ struct tpm_vendor_specific {
99 wait_queue_head_t int_queue; 99 wait_queue_head_t int_queue;
100}; 100};
101 101
102#define TPM_VID_INTEL 0x8086
103
102struct tpm_chip { 104struct tpm_chip {
103 struct device *dev; /* Device stuff */ 105 struct device *dev; /* Device stuff */
104 106
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index a1748621111b..47ba9c213cc1 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -368,6 +368,11 @@ static int probe_itpm(struct tpm_chip *chip)
368 }; 368 };
369 size_t len = sizeof(cmd_getticks); 369 size_t len = sizeof(cmd_getticks);
370 int rem_itpm = itpm; 370 int rem_itpm = itpm;
371 u16 vendor = ioread16(chip->vendor.iobase + TPM_DID_VID(0));
372
373 /* probe only iTPMS */
374 if (vendor != TPM_VID_INTEL)
375 return 0;
371 376
372 itpm = 0; 377 itpm = 0;
373 378
@@ -390,9 +395,6 @@ static int probe_itpm(struct tpm_chip *chip)
390out: 395out:
391 itpm = rem_itpm; 396 itpm = rem_itpm;
392 tpm_tis_ready(chip); 397 tpm_tis_ready(chip);
393 /* some TPMs need a break here otherwise they will not work
394 * correctly on the immediately subsequent command */
395 msleep(chip->vendor.timeout_b);
396 release_locality(chip, chip->vendor.locality, 0); 398 release_locality(chip, chip->vendor.locality, 0);
397 399
398 return rc; 400 return rc;