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_atmel.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_atmel.c')
-rw-r--r-- | drivers/char/tpm/tpm_atmel.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/char/tpm/tpm_atmel.c b/drivers/char/tpm/tpm_atmel.c index 13248400b9c3..61fe14a77124 100644 --- a/drivers/char/tpm/tpm_atmel.c +++ b/drivers/char/tpm/tpm_atmel.c | |||
@@ -22,8 +22,9 @@ | |||
22 | #include "tpm.h" | 22 | #include "tpm.h" |
23 | 23 | ||
24 | /* Atmel definitions */ | 24 | /* Atmel definitions */ |
25 | enum tpm_atmel_addr{ | 25 | enum tpm_atmel_addr { |
26 | TPM_ATML_BASE = 0x400 | 26 | TPM_ATMEL_BASE_ADDR_LO = 0x08, |
27 | TPM_ATMEL_BASE_ADDR_HI = 0x09 | ||
27 | }; | 28 | }; |
28 | 29 | ||
29 | /* write status bits */ | 30 | /* write status bits */ |
@@ -148,7 +149,6 @@ static struct tpm_vendor_specific tpm_atmel = { | |||
148 | .req_complete_mask = ATML_STATUS_BUSY | ATML_STATUS_DATA_AVAIL, | 149 | .req_complete_mask = ATML_STATUS_BUSY | ATML_STATUS_DATA_AVAIL, |
149 | .req_complete_val = ATML_STATUS_DATA_AVAIL, | 150 | .req_complete_val = ATML_STATUS_DATA_AVAIL, |
150 | .req_canceled = ATML_STATUS_READY, | 151 | .req_canceled = ATML_STATUS_READY, |
151 | .base = TPM_ATML_BASE, | ||
152 | .attr_group = &atmel_attr_grp, | 152 | .attr_group = &atmel_attr_grp, |
153 | .miscdev = { .fops = &atmel_ops, }, | 153 | .miscdev = { .fops = &atmel_ops, }, |
154 | }; | 154 | }; |
@@ -158,14 +158,16 @@ static int __devinit tpm_atml_init(struct pci_dev *pci_dev, | |||
158 | { | 158 | { |
159 | u8 version[4]; | 159 | u8 version[4]; |
160 | int rc = 0; | 160 | int rc = 0; |
161 | int lo, hi; | ||
161 | 162 | ||
162 | if (pci_enable_device(pci_dev)) | 163 | if (pci_enable_device(pci_dev)) |
163 | return -EIO; | 164 | return -EIO; |
164 | 165 | ||
165 | if (tpm_lpc_bus_init(pci_dev, TPM_ATML_BASE)) { | 166 | lo = tpm_read_index( TPM_ATMEL_BASE_ADDR_LO ); |
166 | rc = -ENODEV; | 167 | hi = tpm_read_index( TPM_ATMEL_BASE_ADDR_HI ); |
167 | goto out_err; | 168 | |
168 | } | 169 | tpm_atmel.base = (hi<<8)|lo; |
170 | dev_dbg( &pci_dev->dev, "Operating with base: 0x%x\n", tpm_atmel.base); | ||
169 | 171 | ||
170 | /* verify that it is an Atmel part */ | 172 | /* verify that it is an Atmel part */ |
171 | if (tpm_read_index(4) != 'A' || tpm_read_index(5) != 'T' | 173 | if (tpm_read_index(4) != 'A' || tpm_read_index(5) != 'T' |