15 #include <linux/module.h>
17 #include <linux/pci.h>
22 #define AMD76X_REVISION " Ver: 2.0.2"
23 #define EDAC_MOD_STR "amd76x_edac"
25 #define amd76x_printk(level, fmt, arg...) \
26 edac_printk(level, "amd76x", fmt, ##arg)
28 #define amd76x_mc_printk(mci, level, fmt, arg...) \
29 edac_mc_chipset_printk(mci, level, "amd76x", fmt, ##arg)
31 #define AMD76X_NR_CSROWS 8
32 #define AMD76X_NR_DIMMS 4
36 #define AMD76X_ECC_MODE_STATUS 0x48
48 #define AMD76X_DRAM_MODE_STATUS 0x58
63 #define AMD76X_MEM_BASE_ADDR 0xC0
88 .ctl_name =
"AMD761"},
90 .ctl_name =
"AMD762"},
93 static struct edac_pci_ctl_info *amd76x_pci;
131 static int amd76x_process_error_info(
struct mem_ctl_info *mci,
149 mci->
csrows[row]->first_page, 0, 0,
164 mci->
csrows[row]->first_page, 0, 0,
184 amd76x_get_error_info(mci, &info);
185 amd76x_process_error_info(mci, &info, 1);
193 u32 mba, mba_base, mba_mask, dms;
196 for (index = 0; index < mci->
nr_csrows; index++) {
201 pci_read_config_dword(pdev,
207 mba_base = mba & 0xff800000
UL;
208 mba_mask = ((mba & 0xff80) << 16) | 0x7fffff
UL;
211 dimm->
nr_pages = (mba_mask + 1) >> PAGE_SHIFT;
230 static int amd76x_probe1(
struct pci_dev *pdev,
int dev_idx)
232 static const enum edac_type ems_modes[] = {
246 ems_mode = (ems >> 10) & 0x3;
250 layers[0].is_virt_csrow =
true;
253 layers[1].is_virt_csrow =
false;
272 amd76x_init_csrows(mci, pdev, ems_modes[ems_mode]);
273 amd76x_get_error_info(mci, &
discard);
279 edac_dbg(3,
"failed edac_mc_add_mc()\n");
287 "%s(): Unable to create PCI control\n",
290 "%s(): PCI error report via EDAC not setup\n",
352 .probe = amd76x_init_one,
354 .id_table = amd76x_pci_tbl,
357 static int __init amd76x_init(
void)
362 return pci_register_driver(&amd76x_driver);
365 static void __exit amd76x_exit(
void)
374 MODULE_AUTHOR(
"Linux Networx (http://lnxi.com) Thayne Harbaugh");