ie31200_edac.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  1. /*
  2. * Intel E3-1200
  3. * Copyright (C) 2014 Jason Baron <jbaron@akamai.com>
  4. *
  5. * Support for the E3-1200 processor family. Heavily based on previous
  6. * Intel EDAC drivers.
  7. *
  8. * Since the DRAM controller is on the cpu chip, we can use its PCI device
  9. * id to identify these processors.
  10. *
  11. * PCI DRAM controller device ids (Taken from The PCI ID Repository - http://pci-ids.ucw.cz/)
  12. *
  13. * 0108: Xeon E3-1200 Processor Family DRAM Controller
  14. * 010c: Xeon E3-1200/2nd Generation Core Processor Family DRAM Controller
  15. * 0150: Xeon E3-1200 v2/3rd Gen Core processor DRAM Controller
  16. * 0158: Xeon E3-1200 v2/Ivy Bridge DRAM Controller
  17. * 015c: Xeon E3-1200 v2/3rd Gen Core processor DRAM Controller
  18. * 0c04: Xeon E3-1200 v3/4th Gen Core Processor DRAM Controller
  19. * 0c08: Xeon E3-1200 v3 Processor DRAM Controller
  20. * 1918: Xeon E3-1200 v5 Skylake Host Bridge/DRAM Registers
  21. *
  22. * Based on Intel specification:
  23. * http://www.intel.com/content/dam/www/public/us/en/documents/datasheets/xeon-e3-1200v3-vol-2-datasheet.pdf
  24. * http://www.intel.com/content/www/us/en/processors/xeon/xeon-e3-1200-family-vol-2-datasheet.html
  25. *
  26. * According to the above datasheet (p.16):
  27. * "
  28. * 6. Software must not access B0/D0/F0 32-bit memory-mapped registers with
  29. * requests that cross a DW boundary.
  30. * "
  31. *
  32. * Thus, we make use of the explicit: lo_hi_readq(), which breaks the readq into
  33. * 2 readl() calls. This restriction may be lifted in subsequent chip releases,
  34. * but lo_hi_readq() ensures that we are safe across all e3-1200 processors.
  35. */
  36. #include <linux/module.h>
  37. #include <linux/init.h>
  38. #include <linux/pci.h>
  39. #include <linux/pci_ids.h>
  40. #include <linux/edac.h>
  41. #include <linux/io-64-nonatomic-lo-hi.h>
  42. #include "edac_core.h"
  43. #define IE31200_REVISION "1.0"
  44. #define EDAC_MOD_STR "ie31200_edac"
  45. #define ie31200_printk(level, fmt, arg...) \
  46. edac_printk(level, "ie31200", fmt, ##arg)
  47. #define PCI_DEVICE_ID_INTEL_IE31200_HB_1 0x0108
  48. #define PCI_DEVICE_ID_INTEL_IE31200_HB_2 0x010c
  49. #define PCI_DEVICE_ID_INTEL_IE31200_HB_3 0x0150
  50. #define PCI_DEVICE_ID_INTEL_IE31200_HB_4 0x0158
  51. #define PCI_DEVICE_ID_INTEL_IE31200_HB_5 0x015c
  52. #define PCI_DEVICE_ID_INTEL_IE31200_HB_6 0x0c04
  53. #define PCI_DEVICE_ID_INTEL_IE31200_HB_7 0x0c08
  54. #define PCI_DEVICE_ID_INTEL_IE31200_HB_8 0x1918
  55. #define IE31200_DIMMS 4
  56. #define IE31200_RANKS 8
  57. #define IE31200_RANKS_PER_CHANNEL 4
  58. #define IE31200_DIMMS_PER_CHANNEL 2
  59. #define IE31200_CHANNELS 2
  60. /* Intel IE31200 register addresses - device 0 function 0 - DRAM Controller */
  61. #define IE31200_MCHBAR_LOW 0x48
  62. #define IE31200_MCHBAR_HIGH 0x4c
  63. #define IE31200_MCHBAR_MASK GENMASK_ULL(38, 15)
  64. #define IE31200_MMR_WINDOW_SIZE BIT(15)
  65. /*
  66. * Error Status Register (16b)
  67. *
  68. * 15 reserved
  69. * 14 Isochronous TBWRR Run Behind FIFO Full
  70. * (ITCV)
  71. * 13 Isochronous TBWRR Run Behind FIFO Put
  72. * (ITSTV)
  73. * 12 reserved
  74. * 11 MCH Thermal Sensor Event
  75. * for SMI/SCI/SERR (GTSE)
  76. * 10 reserved
  77. * 9 LOCK to non-DRAM Memory Flag (LCKF)
  78. * 8 reserved
  79. * 7 DRAM Throttle Flag (DTF)
  80. * 6:2 reserved
  81. * 1 Multi-bit DRAM ECC Error Flag (DMERR)
  82. * 0 Single-bit DRAM ECC Error Flag (DSERR)
  83. */
  84. #define IE31200_ERRSTS 0xc8
  85. #define IE31200_ERRSTS_UE BIT(1)
  86. #define IE31200_ERRSTS_CE BIT(0)
  87. #define IE31200_ERRSTS_BITS (IE31200_ERRSTS_UE | IE31200_ERRSTS_CE)
  88. /*
  89. * Channel 0 ECC Error Log (64b)
  90. *
  91. * 63:48 Error Column Address (ERRCOL)
  92. * 47:32 Error Row Address (ERRROW)
  93. * 31:29 Error Bank Address (ERRBANK)
  94. * 28:27 Error Rank Address (ERRRANK)
  95. * 26:24 reserved
  96. * 23:16 Error Syndrome (ERRSYND)
  97. * 15: 2 reserved
  98. * 1 Multiple Bit Error Status (MERRSTS)
  99. * 0 Correctable Error Status (CERRSTS)
  100. */
  101. #define IE31200_C0ECCERRLOG 0x40c8
  102. #define IE31200_C1ECCERRLOG 0x44c8
  103. #define IE31200_C0ECCERRLOG_SKL 0x4048
  104. #define IE31200_C1ECCERRLOG_SKL 0x4448
  105. #define IE31200_ECCERRLOG_CE BIT(0)
  106. #define IE31200_ECCERRLOG_UE BIT(1)
  107. #define IE31200_ECCERRLOG_RANK_BITS GENMASK_ULL(28, 27)
  108. #define IE31200_ECCERRLOG_RANK_SHIFT 27
  109. #define IE31200_ECCERRLOG_SYNDROME_BITS GENMASK_ULL(23, 16)
  110. #define IE31200_ECCERRLOG_SYNDROME_SHIFT 16
  111. #define IE31200_ECCERRLOG_SYNDROME(log) \
  112. ((log & IE31200_ECCERRLOG_SYNDROME_BITS) >> \
  113. IE31200_ECCERRLOG_SYNDROME_SHIFT)
  114. #define IE31200_CAPID0 0xe4
  115. #define IE31200_CAPID0_PDCD BIT(4)
  116. #define IE31200_CAPID0_DDPCD BIT(6)
  117. #define IE31200_CAPID0_ECC BIT(1)
  118. #define IE31200_MAD_DIMM_0_OFFSET 0x5004
  119. #define IE31200_MAD_DIMM_0_OFFSET_SKL 0x500C
  120. #define IE31200_MAD_DIMM_SIZE GENMASK_ULL(7, 0)
  121. #define IE31200_MAD_DIMM_A_RANK BIT(17)
  122. #define IE31200_MAD_DIMM_A_RANK_SHIFT 17
  123. #define IE31200_MAD_DIMM_A_RANK_SKL BIT(10)
  124. #define IE31200_MAD_DIMM_A_RANK_SKL_SHIFT 10
  125. #define IE31200_MAD_DIMM_A_WIDTH BIT(19)
  126. #define IE31200_MAD_DIMM_A_WIDTH_SHIFT 19
  127. #define IE31200_MAD_DIMM_A_WIDTH_SKL GENMASK_ULL(9, 8)
  128. #define IE31200_MAD_DIMM_A_WIDTH_SKL_SHIFT 8
  129. /* Skylake reports 1GB increments, everything else is 256MB */
  130. #define IE31200_PAGES(n, skl) \
  131. (n << (28 + (2 * skl) - PAGE_SHIFT))
  132. static int nr_channels;
  133. struct ie31200_priv {
  134. void __iomem *window;
  135. void __iomem *c0errlog;
  136. void __iomem *c1errlog;
  137. };
  138. enum ie31200_chips {
  139. IE31200 = 0,
  140. };
  141. struct ie31200_dev_info {
  142. const char *ctl_name;
  143. };
  144. struct ie31200_error_info {
  145. u16 errsts;
  146. u16 errsts2;
  147. u64 eccerrlog[IE31200_CHANNELS];
  148. };
  149. static const struct ie31200_dev_info ie31200_devs[] = {
  150. [IE31200] = {
  151. .ctl_name = "IE31200"
  152. },
  153. };
  154. struct dimm_data {
  155. u8 size; /* in multiples of 256MB, except Skylake is 1GB */
  156. u8 dual_rank : 1,
  157. x16_width : 2; /* 0 means x8 width */
  158. };
  159. static int how_many_channels(struct pci_dev *pdev)
  160. {
  161. int n_channels;
  162. unsigned char capid0_2b; /* 2nd byte of CAPID0 */
  163. pci_read_config_byte(pdev, IE31200_CAPID0 + 1, &capid0_2b);
  164. /* check PDCD: Dual Channel Disable */
  165. if (capid0_2b & IE31200_CAPID0_PDCD) {
  166. edac_dbg(0, "In single channel mode\n");
  167. n_channels = 1;
  168. } else {
  169. edac_dbg(0, "In dual channel mode\n");
  170. n_channels = 2;
  171. }
  172. /* check DDPCD - check if both channels are filled */
  173. if (capid0_2b & IE31200_CAPID0_DDPCD)
  174. edac_dbg(0, "2 DIMMS per channel disabled\n");
  175. else
  176. edac_dbg(0, "2 DIMMS per channel enabled\n");
  177. return n_channels;
  178. }
  179. static bool ecc_capable(struct pci_dev *pdev)
  180. {
  181. unsigned char capid0_4b; /* 4th byte of CAPID0 */
  182. pci_read_config_byte(pdev, IE31200_CAPID0 + 3, &capid0_4b);
  183. if (capid0_4b & IE31200_CAPID0_ECC)
  184. return false;
  185. return true;
  186. }
  187. static int eccerrlog_row(u64 log)
  188. {
  189. return ((log & IE31200_ECCERRLOG_RANK_BITS) >>
  190. IE31200_ECCERRLOG_RANK_SHIFT);
  191. }
  192. static void ie31200_clear_error_info(struct mem_ctl_info *mci)
  193. {
  194. /*
  195. * Clear any error bits.
  196. * (Yes, we really clear bits by writing 1 to them.)
  197. */
  198. pci_write_bits16(to_pci_dev(mci->pdev), IE31200_ERRSTS,
  199. IE31200_ERRSTS_BITS, IE31200_ERRSTS_BITS);
  200. }
  201. static void ie31200_get_and_clear_error_info(struct mem_ctl_info *mci,
  202. struct ie31200_error_info *info)
  203. {
  204. struct pci_dev *pdev;
  205. struct ie31200_priv *priv = mci->pvt_info;
  206. pdev = to_pci_dev(mci->pdev);
  207. /*
  208. * This is a mess because there is no atomic way to read all the
  209. * registers at once and the registers can transition from CE being
  210. * overwritten by UE.
  211. */
  212. pci_read_config_word(pdev, IE31200_ERRSTS, &info->errsts);
  213. if (!(info->errsts & IE31200_ERRSTS_BITS))
  214. return;
  215. info->eccerrlog[0] = lo_hi_readq(priv->c0errlog);
  216. if (nr_channels == 2)
  217. info->eccerrlog[1] = lo_hi_readq(priv->c1errlog);
  218. pci_read_config_word(pdev, IE31200_ERRSTS, &info->errsts2);
  219. /*
  220. * If the error is the same for both reads then the first set
  221. * of reads is valid. If there is a change then there is a CE
  222. * with no info and the second set of reads is valid and
  223. * should be UE info.
  224. */
  225. if ((info->errsts ^ info->errsts2) & IE31200_ERRSTS_BITS) {
  226. info->eccerrlog[0] = lo_hi_readq(priv->c0errlog);
  227. if (nr_channels == 2)
  228. info->eccerrlog[1] =
  229. lo_hi_readq(priv->c1errlog);
  230. }
  231. ie31200_clear_error_info(mci);
  232. }
  233. static void ie31200_process_error_info(struct mem_ctl_info *mci,
  234. struct ie31200_error_info *info)
  235. {
  236. int channel;
  237. u64 log;
  238. if (!(info->errsts & IE31200_ERRSTS_BITS))
  239. return;
  240. if ((info->errsts ^ info->errsts2) & IE31200_ERRSTS_BITS) {
  241. edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, 1, 0, 0, 0,
  242. -1, -1, -1, "UE overwrote CE", "");
  243. info->errsts = info->errsts2;
  244. }
  245. for (channel = 0; channel < nr_channels; channel++) {
  246. log = info->eccerrlog[channel];
  247. if (log & IE31200_ECCERRLOG_UE) {
  248. edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, 1,
  249. 0, 0, 0,
  250. eccerrlog_row(log),
  251. channel, -1,
  252. "ie31200 UE", "");
  253. } else if (log & IE31200_ECCERRLOG_CE) {
  254. edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci, 1,
  255. 0, 0,
  256. IE31200_ECCERRLOG_SYNDROME(log),
  257. eccerrlog_row(log),
  258. channel, -1,
  259. "ie31200 CE", "");
  260. }
  261. }
  262. }
  263. static void ie31200_check(struct mem_ctl_info *mci)
  264. {
  265. struct ie31200_error_info info;
  266. edac_dbg(1, "MC%d\n", mci->mc_idx);
  267. ie31200_get_and_clear_error_info(mci, &info);
  268. ie31200_process_error_info(mci, &info);
  269. }
  270. static void __iomem *ie31200_map_mchbar(struct pci_dev *pdev)
  271. {
  272. union {
  273. u64 mchbar;
  274. struct {
  275. u32 mchbar_low;
  276. u32 mchbar_high;
  277. };
  278. } u;
  279. void __iomem *window;
  280. pci_read_config_dword(pdev, IE31200_MCHBAR_LOW, &u.mchbar_low);
  281. pci_read_config_dword(pdev, IE31200_MCHBAR_HIGH, &u.mchbar_high);
  282. u.mchbar &= IE31200_MCHBAR_MASK;
  283. if (u.mchbar != (resource_size_t)u.mchbar) {
  284. ie31200_printk(KERN_ERR, "mmio space beyond accessible range (0x%llx)\n",
  285. (unsigned long long)u.mchbar);
  286. return NULL;
  287. }
  288. window = ioremap_nocache(u.mchbar, IE31200_MMR_WINDOW_SIZE);
  289. if (!window)
  290. ie31200_printk(KERN_ERR, "Cannot map mmio space at 0x%llx\n",
  291. (unsigned long long)u.mchbar);
  292. return window;
  293. }
  294. static void __skl_populate_dimm_info(struct dimm_data *dd, u32 addr_decode,
  295. int chan)
  296. {
  297. dd->size = (addr_decode >> (chan << 4)) & IE31200_MAD_DIMM_SIZE;
  298. dd->dual_rank = (addr_decode & (IE31200_MAD_DIMM_A_RANK_SKL << (chan << 4))) ? 1 : 0;
  299. dd->x16_width = ((addr_decode & (IE31200_MAD_DIMM_A_WIDTH_SKL << (chan << 4))) >>
  300. (IE31200_MAD_DIMM_A_WIDTH_SKL_SHIFT + (chan << 4)));
  301. }
  302. static void __populate_dimm_info(struct dimm_data *dd, u32 addr_decode,
  303. int chan)
  304. {
  305. dd->size = (addr_decode >> (chan << 3)) & IE31200_MAD_DIMM_SIZE;
  306. dd->dual_rank = (addr_decode & (IE31200_MAD_DIMM_A_RANK << chan)) ? 1 : 0;
  307. dd->x16_width = (addr_decode & (IE31200_MAD_DIMM_A_WIDTH << chan)) ? 1 : 0;
  308. }
  309. static void populate_dimm_info(struct dimm_data *dd, u32 addr_decode, int chan,
  310. bool skl)
  311. {
  312. if (skl)
  313. __skl_populate_dimm_info(dd, addr_decode, chan);
  314. else
  315. __populate_dimm_info(dd, addr_decode, chan);
  316. }
  317. static int ie31200_probe1(struct pci_dev *pdev, int dev_idx)
  318. {
  319. int i, j, ret;
  320. struct mem_ctl_info *mci = NULL;
  321. struct edac_mc_layer layers[2];
  322. struct dimm_data dimm_info[IE31200_CHANNELS][IE31200_DIMMS_PER_CHANNEL];
  323. void __iomem *window;
  324. struct ie31200_priv *priv;
  325. u32 addr_decode, mad_offset;
  326. bool skl = (pdev->device == PCI_DEVICE_ID_INTEL_IE31200_HB_8);
  327. edac_dbg(0, "MC:\n");
  328. if (!ecc_capable(pdev)) {
  329. ie31200_printk(KERN_INFO, "No ECC support\n");
  330. return -ENODEV;
  331. }
  332. nr_channels = how_many_channels(pdev);
  333. layers[0].type = EDAC_MC_LAYER_CHIP_SELECT;
  334. layers[0].size = IE31200_DIMMS;
  335. layers[0].is_virt_csrow = true;
  336. layers[1].type = EDAC_MC_LAYER_CHANNEL;
  337. layers[1].size = nr_channels;
  338. layers[1].is_virt_csrow = false;
  339. mci = edac_mc_alloc(0, ARRAY_SIZE(layers), layers,
  340. sizeof(struct ie31200_priv));
  341. if (!mci)
  342. return -ENOMEM;
  343. window = ie31200_map_mchbar(pdev);
  344. if (!window) {
  345. ret = -ENODEV;
  346. goto fail_free;
  347. }
  348. edac_dbg(3, "MC: init mci\n");
  349. mci->pdev = &pdev->dev;
  350. if (skl)
  351. mci->mtype_cap = MEM_FLAG_DDR4;
  352. else
  353. mci->mtype_cap = MEM_FLAG_DDR3;
  354. mci->edac_ctl_cap = EDAC_FLAG_SECDED;
  355. mci->edac_cap = EDAC_FLAG_SECDED;
  356. mci->mod_name = EDAC_MOD_STR;
  357. mci->mod_ver = IE31200_REVISION;
  358. mci->ctl_name = ie31200_devs[dev_idx].ctl_name;
  359. mci->dev_name = pci_name(pdev);
  360. mci->edac_check = ie31200_check;
  361. mci->ctl_page_to_phys = NULL;
  362. priv = mci->pvt_info;
  363. priv->window = window;
  364. if (skl) {
  365. priv->c0errlog = window + IE31200_C0ECCERRLOG_SKL;
  366. priv->c1errlog = window + IE31200_C1ECCERRLOG_SKL;
  367. mad_offset = IE31200_MAD_DIMM_0_OFFSET_SKL;
  368. } else {
  369. priv->c0errlog = window + IE31200_C0ECCERRLOG;
  370. priv->c1errlog = window + IE31200_C1ECCERRLOG;
  371. mad_offset = IE31200_MAD_DIMM_0_OFFSET;
  372. }
  373. /* populate DIMM info */
  374. for (i = 0; i < IE31200_CHANNELS; i++) {
  375. addr_decode = readl(window + mad_offset +
  376. (i * 4));
  377. edac_dbg(0, "addr_decode: 0x%x\n", addr_decode);
  378. for (j = 0; j < IE31200_DIMMS_PER_CHANNEL; j++) {
  379. populate_dimm_info(&dimm_info[i][j], addr_decode, j,
  380. skl);
  381. edac_dbg(0, "size: 0x%x, rank: %d, width: %d\n",
  382. dimm_info[i][j].size,
  383. dimm_info[i][j].dual_rank,
  384. dimm_info[i][j].x16_width);
  385. }
  386. }
  387. /*
  388. * The dram rank boundary (DRB) reg values are boundary addresses
  389. * for each DRAM rank with a granularity of 64MB. DRB regs are
  390. * cumulative; the last one will contain the total memory
  391. * contained in all ranks.
  392. */
  393. for (i = 0; i < IE31200_DIMMS_PER_CHANNEL; i++) {
  394. for (j = 0; j < IE31200_CHANNELS; j++) {
  395. struct dimm_info *dimm;
  396. unsigned long nr_pages;
  397. nr_pages = IE31200_PAGES(dimm_info[j][i].size, skl);
  398. if (nr_pages == 0)
  399. continue;
  400. if (dimm_info[j][i].dual_rank) {
  401. nr_pages = nr_pages / 2;
  402. dimm = EDAC_DIMM_PTR(mci->layers, mci->dimms,
  403. mci->n_layers, (i * 2) + 1,
  404. j, 0);
  405. dimm->nr_pages = nr_pages;
  406. edac_dbg(0, "set nr pages: 0x%lx\n", nr_pages);
  407. dimm->grain = 8; /* just a guess */
  408. if (skl)
  409. dimm->mtype = MEM_DDR4;
  410. else
  411. dimm->mtype = MEM_DDR3;
  412. dimm->dtype = DEV_UNKNOWN;
  413. dimm->edac_mode = EDAC_UNKNOWN;
  414. }
  415. dimm = EDAC_DIMM_PTR(mci->layers, mci->dimms,
  416. mci->n_layers, i * 2, j, 0);
  417. dimm->nr_pages = nr_pages;
  418. edac_dbg(0, "set nr pages: 0x%lx\n", nr_pages);
  419. dimm->grain = 8; /* same guess */
  420. if (skl)
  421. dimm->mtype = MEM_DDR4;
  422. else
  423. dimm->mtype = MEM_DDR3;
  424. dimm->dtype = DEV_UNKNOWN;
  425. dimm->edac_mode = EDAC_UNKNOWN;
  426. }
  427. }
  428. ie31200_clear_error_info(mci);
  429. if (edac_mc_add_mc(mci)) {
  430. edac_dbg(3, "MC: failed edac_mc_add_mc()\n");
  431. ret = -ENODEV;
  432. goto fail_unmap;
  433. }
  434. /* get this far and it's successful */
  435. edac_dbg(3, "MC: success\n");
  436. return 0;
  437. fail_unmap:
  438. iounmap(window);
  439. fail_free:
  440. edac_mc_free(mci);
  441. return ret;
  442. }
  443. static int ie31200_init_one(struct pci_dev *pdev,
  444. const struct pci_device_id *ent)
  445. {
  446. edac_dbg(0, "MC:\n");
  447. if (pci_enable_device(pdev) < 0)
  448. return -EIO;
  449. return ie31200_probe1(pdev, ent->driver_data);
  450. }
  451. static void ie31200_remove_one(struct pci_dev *pdev)
  452. {
  453. struct mem_ctl_info *mci;
  454. struct ie31200_priv *priv;
  455. edac_dbg(0, "\n");
  456. mci = edac_mc_del_mc(&pdev->dev);
  457. if (!mci)
  458. return;
  459. priv = mci->pvt_info;
  460. iounmap(priv->window);
  461. edac_mc_free(mci);
  462. }
  463. static const struct pci_device_id ie31200_pci_tbl[] = {
  464. {
  465. PCI_VEND_DEV(INTEL, IE31200_HB_1), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  466. IE31200},
  467. {
  468. PCI_VEND_DEV(INTEL, IE31200_HB_2), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  469. IE31200},
  470. {
  471. PCI_VEND_DEV(INTEL, IE31200_HB_3), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  472. IE31200},
  473. {
  474. PCI_VEND_DEV(INTEL, IE31200_HB_4), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  475. IE31200},
  476. {
  477. PCI_VEND_DEV(INTEL, IE31200_HB_5), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  478. IE31200},
  479. {
  480. PCI_VEND_DEV(INTEL, IE31200_HB_6), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  481. IE31200},
  482. {
  483. PCI_VEND_DEV(INTEL, IE31200_HB_7), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  484. IE31200},
  485. {
  486. PCI_VEND_DEV(INTEL, IE31200_HB_8), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  487. IE31200},
  488. {
  489. 0,
  490. } /* 0 terminated list. */
  491. };
  492. MODULE_DEVICE_TABLE(pci, ie31200_pci_tbl);
  493. static struct pci_driver ie31200_driver = {
  494. .name = EDAC_MOD_STR,
  495. .probe = ie31200_init_one,
  496. .remove = ie31200_remove_one,
  497. .id_table = ie31200_pci_tbl,
  498. };
  499. static int __init ie31200_init(void)
  500. {
  501. edac_dbg(3, "MC:\n");
  502. /* Ensure that the OPSTATE is set correctly for POLL or NMI */
  503. opstate_init();
  504. return pci_register_driver(&ie31200_driver);
  505. }
  506. static void __exit ie31200_exit(void)
  507. {
  508. edac_dbg(3, "MC:\n");
  509. pci_unregister_driver(&ie31200_driver);
  510. }
  511. module_init(ie31200_init);
  512. module_exit(ie31200_exit);
  513. MODULE_LICENSE("GPL");
  514. MODULE_AUTHOR("Jason Baron <jbaron@akamai.com>");
  515. MODULE_DESCRIPTION("MC support for Intel Processor E31200 memory hub controllers");