aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/tpm/tpm_nsc.c
diff options
context:
space:
mode:
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 @@
22#include "tpm.h" 22#include "tpm.h"
23 23
24/* National definitions */ 24/* National definitions */
25enum tpm_nsc_addr { 25enum 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
30enum tpm_nsc_index { 34enum tpm_nsc_index {
@@ -44,7 +48,7 @@ enum tpm_nsc_status_loc {
44}; 48};
45 49
46/* status bits */ 50/* status bits */
47enum tpm_nsc_status{ 51enum 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;