12 #include <linux/module.h>
14 #include <linux/pci.h>
19 #define I82860_REVISION " Ver: 2.0.2"
20 #define EDAC_MOD_STR "i82860_edac"
22 #define i82860_printk(level, fmt, arg...) \
23 edac_printk(level, "i82860", fmt, ##arg)
25 #define i82860_mc_printk(mci, level, fmt, arg...) \
26 edac_mc_chipset_printk(mci, level, "i82860", fmt, ##arg)
28 #ifndef PCI_DEVICE_ID_INTEL_82860_0
29 #define PCI_DEVICE_ID_INTEL_82860_0 0x2531
32 #define I82860_MCHCFG 0x50
33 #define I82860_GBA 0x60
34 #define I82860_GBA_MASK 0x7FF
35 #define I82860_GBA_SHIFT 24
36 #define I82860_ERRSTS 0xC8
37 #define I82860_EAP 0xE4
38 #define I82860_DERRCTL_STS 0xE2
57 .ctl_name =
"i82860"},
60 static struct pci_dev *mci_pdev;
63 static struct edac_pci_ctl_info *i82860_pci;
98 static int i82860_process_error_info(
struct mem_ctl_info *mci,
113 -1, -1, -1,
"UE overwrote CE",
"");
119 dimm = mci->
csrows[row]->channels[0]->dimm;
121 if (info->
errsts & 0x0002)
140 i82860_get_error_info(mci, &info);
141 i82860_process_error_info(mci, &info, 1);
146 unsigned long last_cumul_size;
155 mchcfg_ddim = mchcfg_ddim & 0x180;
163 for (index = 0; index < mci->
nr_csrows; index++) {
167 pci_read_config_word(pdev,
I82860_GBA + index * 2, &value);
170 edac_dbg(3,
"(%d) cumul_size 0x%x\n", index, cumul_size);
172 if (cumul_size == last_cumul_size)
177 dimm->
nr_pages = cumul_size - last_cumul_size;
178 last_cumul_size = cumul_size;
179 dimm->
grain = 1 << 12;
186 static int i82860_probe1(
struct pci_dev *pdev,
int dev_idx)
204 layers[0].is_virt_csrow =
true;
207 layers[1].is_virt_csrow =
true;
224 i82860_init_csrows(mci, pdev);
225 i82860_get_error_info(mci, &
discard);
231 edac_dbg(3,
"failed edac_mc_add_mc()\n");
239 "%s(): Unable to create PCI control\n",
242 "%s(): PCI error report via EDAC not setup\n",
304 .probe = i82860_init_one,
306 .id_table = i82860_pci_tbl,
309 static int __init i82860_init(
void)
318 if ((pci_rc = pci_register_driver(&i82860_driver)) < 0)
325 if (mci_pdev ==
NULL) {
326 edac_dbg(0,
"860 pci_get_device fail\n");
331 pci_rc = i82860_init_one(mci_pdev, i82860_pci_tbl);
346 if (mci_pdev !=
NULL)
352 static void __exit i82860_exit(
void)
358 if (mci_pdev !=
NULL)