tpm_nsc.c (9b4f2e9576658c4e52d95dc8d309f51b2e2db096) | tpm_nsc.c (f33d9bd50478c9a969b65f58feb6b69a3ad478cb) |
---|---|
1/* 2 * Copyright (C) 2004 IBM Corporation 3 * 4 * Authors: 5 * Leendert van Doorn <leendert@watson.ibm.com> 6 * Dave Safford <safford@watson.ibm.com> 7 * Reiner Sailer <sailer@watson.ibm.com> 8 * Kylene Hall <kjhall@us.ibm.com> --- 270 unchanged lines hidden (view full) --- 279 .owner = THIS_MODULE, 280 .suspend = tpm_pm_suspend, 281 .resume = tpm_pm_resume, 282}; 283 284static int __init init_nsc(void) 285{ 286 int rc = 0; | 1/* 2 * Copyright (C) 2004 IBM Corporation 3 * 4 * Authors: 5 * Leendert van Doorn <leendert@watson.ibm.com> 6 * Dave Safford <safford@watson.ibm.com> 7 * Reiner Sailer <sailer@watson.ibm.com> 8 * Kylene Hall <kjhall@us.ibm.com> --- 270 unchanged lines hidden (view full) --- 279 .owner = THIS_MODULE, 280 .suspend = tpm_pm_suspend, 281 .resume = tpm_pm_resume, 282}; 283 284static int __init init_nsc(void) 285{ 286 int rc = 0; |
287 int lo, hi; | 287 int lo, hi, err; |
288 int nscAddrBase = TPM_ADDR; 289 struct tpm_chip *chip; 290 unsigned long base; 291 292 /* verify that it is a National part (SID) */ 293 if (tpm_read_index(TPM_ADDR, NSC_SID_INDEX) != 0xEF) { 294 nscAddrBase = (tpm_read_index(TPM_SUPERIO_ADDR, 0x2C)<<8)| 295 (tpm_read_index(TPM_SUPERIO_ADDR, 0x2B)&0xFE); 296 if (tpm_read_index(nscAddrBase, NSC_SID_INDEX) != 0xF6) 297 return -ENODEV; 298 } 299 | 288 int nscAddrBase = TPM_ADDR; 289 struct tpm_chip *chip; 290 unsigned long base; 291 292 /* verify that it is a National part (SID) */ 293 if (tpm_read_index(TPM_ADDR, NSC_SID_INDEX) != 0xEF) { 294 nscAddrBase = (tpm_read_index(TPM_SUPERIO_ADDR, 0x2C)<<8)| 295 (tpm_read_index(TPM_SUPERIO_ADDR, 0x2B)&0xFE); 296 if (tpm_read_index(nscAddrBase, NSC_SID_INDEX) != 0xF6) 297 return -ENODEV; 298 } 299 |
300 driver_register(&nsc_drv); | 300 err = driver_register(&nsc_drv); 301 if (err) 302 return err; |
301 302 hi = tpm_read_index(nscAddrBase, TPM_NSC_BASE0_HI); 303 lo = tpm_read_index(nscAddrBase, TPM_NSC_BASE0_LO); 304 base = (hi<<8) | lo; 305 306 /* enable the DPM module */ 307 tpm_write_index(nscAddrBase, NSC_LDC_INDEX, 0x01); 308 --- 92 unchanged lines hidden --- | 303 304 hi = tpm_read_index(nscAddrBase, TPM_NSC_BASE0_HI); 305 lo = tpm_read_index(nscAddrBase, TPM_NSC_BASE0_LO); 306 base = (hi<<8) | lo; 307 308 /* enable the DPM module */ 309 tpm_write_index(nscAddrBase, NSC_LDC_INDEX, 0x01); 310 --- 92 unchanged lines hidden --- |