| .. | .. |
|---|
| 75 | 75 | /* PCI DIDs for the Intel SMBus Message Transport (SMT) Devices */ |
|---|
| 76 | 76 | #define PCI_DEVICE_ID_INTEL_S1200_SMT0 0x0c59 |
|---|
| 77 | 77 | #define PCI_DEVICE_ID_INTEL_S1200_SMT1 0x0c5a |
|---|
| 78 | +#define PCI_DEVICE_ID_INTEL_CDF_SMT 0x18ac |
|---|
| 78 | 79 | #define PCI_DEVICE_ID_INTEL_DNV_SMT 0x19ac |
|---|
| 80 | +#define PCI_DEVICE_ID_INTEL_EBG_SMT 0x1bff |
|---|
| 79 | 81 | #define PCI_DEVICE_ID_INTEL_AVOTON_SMT 0x1f15 |
|---|
| 80 | 82 | |
|---|
| 81 | 83 | #define ISMT_DESC_ENTRIES 2 /* number of descriptor entries */ |
|---|
| 82 | 84 | #define ISMT_MAX_RETRIES 3 /* number of SMBus retries to attempt */ |
|---|
| 85 | +#define ISMT_LOG_ENTRIES 3 /* number of interrupt cause log entries */ |
|---|
| 83 | 86 | |
|---|
| 84 | 87 | /* Hardware Descriptor Constants - Control Field */ |
|---|
| 85 | 88 | #define ISMT_DESC_CWRL 0x01 /* Command/Write Length */ |
|---|
| .. | .. |
|---|
| 173 | 176 | u8 head; /* ring buffer head pointer */ |
|---|
| 174 | 177 | struct completion cmp; /* interrupt completion */ |
|---|
| 175 | 178 | u8 buffer[I2C_SMBUS_BLOCK_MAX + 16]; /* temp R/W data buffer */ |
|---|
| 179 | + dma_addr_t log_dma; |
|---|
| 180 | + u32 *log; |
|---|
| 176 | 181 | }; |
|---|
| 177 | 182 | |
|---|
| 178 | | -/** |
|---|
| 179 | | - * ismt_ids - PCI device IDs supported by this driver |
|---|
| 180 | | - */ |
|---|
| 181 | 183 | static const struct pci_device_id ismt_ids[] = { |
|---|
| 182 | 184 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_S1200_SMT0) }, |
|---|
| 183 | 185 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_S1200_SMT1) }, |
|---|
| 186 | + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CDF_SMT) }, |
|---|
| 184 | 187 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_DNV_SMT) }, |
|---|
| 188 | + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EBG_SMT) }, |
|---|
| 185 | 189 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_AVOTON_SMT) }, |
|---|
| 186 | 190 | { 0, } |
|---|
| 187 | 191 | }; |
|---|
| .. | .. |
|---|
| 195 | 199 | |
|---|
| 196 | 200 | /** |
|---|
| 197 | 201 | * __ismt_desc_dump() - dump the contents of a specific descriptor |
|---|
| 202 | + * @dev: the iSMT device |
|---|
| 203 | + * @desc: the iSMT hardware descriptor |
|---|
| 198 | 204 | */ |
|---|
| 199 | 205 | static void __ismt_desc_dump(struct device *dev, const struct ismt_desc *desc) |
|---|
| 200 | 206 | { |
|---|
| .. | .. |
|---|
| 405 | 411 | /* Initialize the descriptor */ |
|---|
| 406 | 412 | memset(desc, 0, sizeof(struct ismt_desc)); |
|---|
| 407 | 413 | desc->tgtaddr_rw = ISMT_DESC_ADDR_RW(addr, read_write); |
|---|
| 414 | + |
|---|
| 415 | + /* Always clear the log entries */ |
|---|
| 416 | + memset(priv->log, 0, ISMT_LOG_ENTRIES * sizeof(u32)); |
|---|
| 408 | 417 | |
|---|
| 409 | 418 | /* Initialize common control bits */ |
|---|
| 410 | 419 | if (likely(pci_dev_msi_enabled(priv->pci_dev))) |
|---|
| .. | .. |
|---|
| 626 | 635 | I2C_FUNC_SMBUS_PEC; |
|---|
| 627 | 636 | } |
|---|
| 628 | 637 | |
|---|
| 629 | | -/** |
|---|
| 630 | | - * smbus_algorithm - the adapter algorithm and supported functionality |
|---|
| 631 | | - * @smbus_xfer: the adapter algorithm |
|---|
| 632 | | - * @functionality: functionality supported by the adapter |
|---|
| 633 | | - */ |
|---|
| 634 | 638 | static const struct i2c_algorithm smbus_algorithm = { |
|---|
| 635 | 639 | .smbus_xfer = ismt_access, |
|---|
| 636 | 640 | .functionality = ismt_func, |
|---|
| .. | .. |
|---|
| 694 | 698 | |
|---|
| 695 | 699 | /* initialize the Master Descriptor Base Address (MDBA) */ |
|---|
| 696 | 700 | writeq(priv->io_rng_dma, priv->smba + ISMT_MSTR_MDBA); |
|---|
| 701 | + |
|---|
| 702 | + writeq(priv->log_dma, priv->smba + ISMT_GR_SMTICL); |
|---|
| 697 | 703 | |
|---|
| 698 | 704 | /* initialize the Master Control Register (MCTRL) */ |
|---|
| 699 | 705 | writel(ISMT_MCTRL_MEIE, priv->smba + ISMT_MSTR_MCTRL); |
|---|
| .. | .. |
|---|
| 779 | 785 | if (!priv->hw) |
|---|
| 780 | 786 | return -ENOMEM; |
|---|
| 781 | 787 | |
|---|
| 782 | | - memset(priv->hw, 0, (ISMT_DESC_ENTRIES * sizeof(struct ismt_desc))); |
|---|
| 783 | | - |
|---|
| 784 | 788 | priv->head = 0; |
|---|
| 785 | 789 | init_completion(&priv->cmp); |
|---|
| 786 | 790 | |
|---|
| 791 | + priv->log = dmam_alloc_coherent(&priv->pci_dev->dev, |
|---|
| 792 | + ISMT_LOG_ENTRIES * sizeof(u32), |
|---|
| 793 | + &priv->log_dma, GFP_KERNEL); |
|---|
| 794 | + if (!priv->log) |
|---|
| 795 | + return -ENOMEM; |
|---|
| 796 | + |
|---|
| 787 | 797 | return 0; |
|---|
| 788 | 798 | } |
|---|
| 789 | 799 | |
|---|