Auto-update from upstream
[powerpc.git] / drivers / char / tpm / tpm_atmel.c
index 07abfb7..cc2cc77 100644 (file)
@@ -22,8 +22,9 @@
 #include "tpm.h"
 
 /* Atmel definitions */
-enum tpm_atmel_addr{
-       TPM_ATML_BASE = 0x400
+enum tpm_atmel_addr {
+       TPM_ATMEL_BASE_ADDR_LO = 0x08,
+       TPM_ATMEL_BASE_ADDR_HI = 0x09
 };
 
 /* write status bits */
@@ -147,7 +148,7 @@ static struct tpm_vendor_specific tpm_atmel = {
        .cancel = tpm_atml_cancel,
        .req_complete_mask = ATML_STATUS_BUSY | ATML_STATUS_DATA_AVAIL,
        .req_complete_val = ATML_STATUS_DATA_AVAIL,
-       .base = TPM_ATML_BASE,
+       .req_canceled = ATML_STATUS_READY,
        .attr_group = &atmel_attr_grp,
        .miscdev = { .fops = &atmel_ops, },
 };
@@ -157,27 +158,29 @@ static int __devinit tpm_atml_init(struct pci_dev *pci_dev,
 {
        u8 version[4];
        int rc = 0;
+       int lo, hi;
 
        if (pci_enable_device(pci_dev))
                return -EIO;
 
-       if (tpm_lpc_bus_init(pci_dev, TPM_ATML_BASE)) {
-               rc = -ENODEV;
-               goto out_err;
-       }
+       lo = tpm_read_index(TPM_ADDR, TPM_ATMEL_BASE_ADDR_LO);
+       hi = tpm_read_index(TPM_ADDR, TPM_ATMEL_BASE_ADDR_HI);
+
+       tpm_atmel.base = (hi<<8)|lo;
+       dev_dbg( &pci_dev->dev, "Operating with base: 0x%x\n", tpm_atmel.base);
 
        /* verify that it is an Atmel part */
-       if (tpm_read_index(4) != 'A' || tpm_read_index(5) != 'T'
-           || tpm_read_index(6) != 'M' || tpm_read_index(7) != 'L') {
+       if (tpm_read_index(TPM_ADDR, 4) != 'A' || tpm_read_index(TPM_ADDR, 5) != 'T'
+           || tpm_read_index(TPM_ADDR, 6) != 'M' || tpm_read_index(TPM_ADDR, 7) != 'L') {
                rc = -ENODEV;
                goto out_err;
        }
 
        /* query chip for its version number */
-       if ((version[0] = tpm_read_index(0x00)) != 0xFF) {
-               version[1] = tpm_read_index(0x01);
-               version[2] = tpm_read_index(0x02);
-               version[3] = tpm_read_index(0x03);
+       if ((version[0] = tpm_read_index(TPM_ADDR, 0x00)) != 0xFF) {
+               version[1] = tpm_read_index(TPM_ADDR, 0x01);
+               version[2] = tpm_read_index(TPM_ADDR, 0x02);
+               version[3] = tpm_read_index(TPM_ADDR, 0x03);
        } else {
                dev_info(&pci_dev->dev, "version query failed\n");
                rc = -ENODEV;
@@ -204,6 +207,7 @@ static struct pci_device_id tpm_pci_tbl[] __devinitdata = {
        {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12)},
        {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0)},
        {PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_LPC)},
+       {PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB6LPC)},
        {0,}
 };