diff options
author | Kylene Hall <kjhall@us.ibm.com> | 2005-06-24 01:02:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-24 03:05:27 -0400 |
commit | e1a23c6671f2bfd6e5e112848f01334ca39ea2b1 (patch) | |
tree | 9eae7fac05706a63ac3b486ecf4d9c686fa7dd54 /drivers/char/tpm/tpm_nsc.c | |
parent | a6df7da8f7ee99e6fd1995fad852bacb978a6447 (diff) |
[PATCH] tpm: replace odd LPC init function
Realized the tpm_lpc_init function isn't really necessary. Replaced it
with vendor specific logic to find out the address the BIOS mapped the TPM
to. This patch removes the tpm_lpc_init function, enums associated with it
and calls to it. The patch also implements the replacement functionality.
Signed-off-by: Kylene Hall <kjhall@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/tpm/tpm_nsc.c')
-rw-r--r-- | drivers/char/tpm/tpm_nsc.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/char/tpm/tpm_nsc.c b/drivers/char/tpm/tpm_nsc.c index 37bea14f9310..1a45e7dfc13b 100644 --- a/drivers/char/tpm/tpm_nsc.c +++ b/drivers/char/tpm/tpm_nsc.c | |||
@@ -22,9 +22,13 @@ | |||
22 | #include "tpm.h" | 22 | #include "tpm.h" |
23 | 23 | ||
24 | /* National definitions */ | 24 | /* National definitions */ |
25 | enum tpm_nsc_addr { | 25 | enum tpm_nsc_addr{ |
26 | TPM_NSC_BASE = 0x360, | 26 | TPM_NSC_BASE = 0x360, |
27 | TPM_NSC_IRQ = 0x07 | 27 | TPM_NSC_IRQ = 0x07, |
28 | TPM_NSC_BASE0_HI = 0x60, | ||
29 | TPM_NSC_BASE0_LO = 0x61, | ||
30 | TPM_NSC_BASE1_HI = 0x62, | ||
31 | TPM_NSC_BASE1_LO = 0x63 | ||
28 | }; | 32 | }; |
29 | 33 | ||
30 | enum tpm_nsc_index { | 34 | enum tpm_nsc_index { |
@@ -44,7 +48,7 @@ enum tpm_nsc_status_loc { | |||
44 | }; | 48 | }; |
45 | 49 | ||
46 | /* status bits */ | 50 | /* status bits */ |
47 | enum tpm_nsc_status{ | 51 | enum tpm_nsc_status { |
48 | NSC_STATUS_OBF = 0x01, /* output buffer full */ | 52 | NSC_STATUS_OBF = 0x01, /* output buffer full */ |
49 | NSC_STATUS_IBF = 0x02, /* input buffer full */ | 53 | NSC_STATUS_IBF = 0x02, /* input buffer full */ |
50 | NSC_STATUS_F0 = 0x04, /* F0 */ | 54 | NSC_STATUS_F0 = 0x04, /* F0 */ |
@@ -246,7 +250,6 @@ static struct tpm_vendor_specific tpm_nsc = { | |||
246 | .req_complete_mask = NSC_STATUS_OBF, | 250 | .req_complete_mask = NSC_STATUS_OBF, |
247 | .req_complete_val = NSC_STATUS_OBF, | 251 | .req_complete_val = NSC_STATUS_OBF, |
248 | .req_canceled = NSC_STATUS_RDY, | 252 | .req_canceled = NSC_STATUS_RDY, |
249 | .base = TPM_NSC_BASE, | ||
250 | .attr_group = &nsc_attr_grp, | 253 | .attr_group = &nsc_attr_grp, |
251 | .miscdev = { .fops = &nsc_ops, }, | 254 | .miscdev = { .fops = &nsc_ops, }, |
252 | }; | 255 | }; |
@@ -255,15 +258,16 @@ static int __devinit tpm_nsc_init(struct pci_dev *pci_dev, | |||
255 | const struct pci_device_id *pci_id) | 258 | const struct pci_device_id *pci_id) |
256 | { | 259 | { |
257 | int rc = 0; | 260 | int rc = 0; |
261 | int lo, hi; | ||
262 | |||
263 | hi = tpm_read_index(TPM_NSC_BASE0_HI); | ||
264 | lo = tpm_read_index(TPM_NSC_BASE0_LO); | ||
265 | |||
266 | tpm_nsc.base = (hi<<8) | lo; | ||
258 | 267 | ||
259 | if (pci_enable_device(pci_dev)) | 268 | if (pci_enable_device(pci_dev)) |
260 | return -EIO; | 269 | return -EIO; |
261 | 270 | ||
262 | if (tpm_lpc_bus_init(pci_dev, TPM_NSC_BASE)) { | ||
263 | rc = -ENODEV; | ||
264 | goto out_err; | ||
265 | } | ||
266 | |||
267 | /* verify that it is a National part (SID) */ | 271 | /* verify that it is a National part (SID) */ |
268 | if (tpm_read_index(NSC_SID_INDEX) != 0xEF) { | 272 | if (tpm_read_index(NSC_SID_INDEX) != 0xEF) { |
269 | rc = -ENODEV; | 273 | rc = -ENODEV; |