summaryrefslogtreecommitdiffstats
path: root/drivers/char/tpm/tpm_nsc.c
diff options
context:
space:
mode:
authorKylene Hall <kjhall@us.ibm.com>2005-06-23 22:02:06 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-24 00:05:27 -0700
commite1a23c6671f2bfd6e5e112848f01334ca39ea2b1 (patch)
tree9eae7fac05706a63ac3b486ecf4d9c686fa7dd54 /drivers/char/tpm/tpm_nsc.c
parenta6df7da8f7ee99e6fd1995fad852bacb978a6447 (diff)
downloadlinux-e1a23c6671f2bfd6e5e112848f01334ca39ea2b1.tar.gz
linux-e1a23c6671f2bfd6e5e112848f01334ca39ea2b1.tar.bz2
linux-e1a23c6671f2bfd6e5e112848f01334ca39ea2b1.zip
[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.c22
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 @@
#include "tpm.h"
/* National definitions */
-enum tpm_nsc_addr {
+enum tpm_nsc_addr{
TPM_NSC_BASE = 0x360,
- TPM_NSC_IRQ = 0x07
+ TPM_NSC_IRQ = 0x07,
+ TPM_NSC_BASE0_HI = 0x60,
+ TPM_NSC_BASE0_LO = 0x61,
+ TPM_NSC_BASE1_HI = 0x62,
+ TPM_NSC_BASE1_LO = 0x63
};
enum tpm_nsc_index {
@@ -44,7 +48,7 @@ enum tpm_nsc_status_loc {
};
/* status bits */
-enum tpm_nsc_status{
+enum tpm_nsc_status {
NSC_STATUS_OBF = 0x01, /* output buffer full */
NSC_STATUS_IBF = 0x02, /* input buffer full */
NSC_STATUS_F0 = 0x04, /* F0 */
@@ -246,7 +250,6 @@ static struct tpm_vendor_specific tpm_nsc = {
.req_complete_mask = NSC_STATUS_OBF,
.req_complete_val = NSC_STATUS_OBF,
.req_canceled = NSC_STATUS_RDY,
- .base = TPM_NSC_BASE,
.attr_group = &nsc_attr_grp,
.miscdev = { .fops = &nsc_ops, },
};
@@ -255,15 +258,16 @@ static int __devinit tpm_nsc_init(struct pci_dev *pci_dev,
const struct pci_device_id *pci_id)
{
int rc = 0;
+ int lo, hi;
+
+ hi = tpm_read_index(TPM_NSC_BASE0_HI);
+ lo = tpm_read_index(TPM_NSC_BASE0_LO);
+
+ tpm_nsc.base = (hi<<8) | lo;
if (pci_enable_device(pci_dev))
return -EIO;
- if (tpm_lpc_bus_init(pci_dev, TPM_NSC_BASE)) {
- rc = -ENODEV;
- goto out_err;
- }
-
/* verify that it is a National part (SID) */
if (tpm_read_index(NSC_SID_INDEX) != 0xEF) {
rc = -ENODEV;