Commit 4e401fb0 authored by Stefan Berger's avatar Stefan Berger Committed by Rajiv Andrade

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: default avatarStefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: default avatarRajiv Andrade <srajiv@linux.vnet.ibm.com>
parent 40401530
...@@ -99,6 +99,8 @@ struct tpm_vendor_specific { ...@@ -99,6 +99,8 @@ struct tpm_vendor_specific {
wait_queue_head_t int_queue; wait_queue_head_t int_queue;
}; };
#define TPM_VID_INTEL 0x8086
struct tpm_chip { struct tpm_chip {
struct device *dev; /* Device stuff */ struct device *dev; /* Device stuff */
......
...@@ -368,6 +368,11 @@ static int probe_itpm(struct tpm_chip *chip) ...@@ -368,6 +368,11 @@ static int probe_itpm(struct tpm_chip *chip)
}; };
size_t len = sizeof(cmd_getticks); size_t len = sizeof(cmd_getticks);
int rem_itpm = itpm; int rem_itpm = itpm;
u16 vendor = ioread16(chip->vendor.iobase + TPM_DID_VID(0));
/* probe only iTPMS */
if (vendor != TPM_VID_INTEL)
return 0;
itpm = 0; itpm = 0;
...@@ -390,9 +395,6 @@ static int probe_itpm(struct tpm_chip *chip) ...@@ -390,9 +395,6 @@ static int probe_itpm(struct tpm_chip *chip)
out: out:
itpm = rem_itpm; itpm = rem_itpm;
tpm_tis_ready(chip); tpm_tis_ready(chip);
/* some TPMs need a break here otherwise they will not work
* correctly on the immediately subsequent command */
msleep(chip->vendor.timeout_b);
release_locality(chip, chip->vendor.locality, 0); release_locality(chip, chip->vendor.locality, 0);
return rc; return rc;
......
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