diff options
Diffstat (limited to 'drivers/edac/e752x_edac.c')
-rw-r--r-- | drivers/edac/e752x_edac.c | 181 |
1 files changed, 91 insertions, 90 deletions
diff --git a/drivers/edac/e752x_edac.c b/drivers/edac/e752x_edac.c index 45c55a067c73..a041218370f9 100644 --- a/drivers/edac/e752x_edac.c +++ b/drivers/edac/e752x_edac.c | |||
@@ -204,21 +204,21 @@ struct e752x_error_info { | |||
204 | 204 | ||
205 | static const struct e752x_dev_info e752x_devs[] = { | 205 | static const struct e752x_dev_info e752x_devs[] = { |
206 | [E7520] = { | 206 | [E7520] = { |
207 | .err_dev = PCI_DEVICE_ID_INTEL_7520_1_ERR, | 207 | .err_dev = PCI_DEVICE_ID_INTEL_7520_1_ERR, |
208 | .ctl_dev = PCI_DEVICE_ID_INTEL_7520_0, | 208 | .ctl_dev = PCI_DEVICE_ID_INTEL_7520_0, |
209 | .ctl_name = "E7520"}, | 209 | .ctl_name = "E7520"}, |
210 | [E7525] = { | 210 | [E7525] = { |
211 | .err_dev = PCI_DEVICE_ID_INTEL_7525_1_ERR, | 211 | .err_dev = PCI_DEVICE_ID_INTEL_7525_1_ERR, |
212 | .ctl_dev = PCI_DEVICE_ID_INTEL_7525_0, | 212 | .ctl_dev = PCI_DEVICE_ID_INTEL_7525_0, |
213 | .ctl_name = "E7525"}, | 213 | .ctl_name = "E7525"}, |
214 | [E7320] = { | 214 | [E7320] = { |
215 | .err_dev = PCI_DEVICE_ID_INTEL_7320_1_ERR, | 215 | .err_dev = PCI_DEVICE_ID_INTEL_7320_1_ERR, |
216 | .ctl_dev = PCI_DEVICE_ID_INTEL_7320_0, | 216 | .ctl_dev = PCI_DEVICE_ID_INTEL_7320_0, |
217 | .ctl_name = "E7320"}, | 217 | .ctl_name = "E7320"}, |
218 | }; | 218 | }; |
219 | 219 | ||
220 | static unsigned long ctl_page_to_phys(struct mem_ctl_info *mci, | 220 | static unsigned long ctl_page_to_phys(struct mem_ctl_info *mci, |
221 | unsigned long page) | 221 | unsigned long page) |
222 | { | 222 | { |
223 | u32 remap; | 223 | u32 remap; |
224 | struct e752x_pvt *pvt = (struct e752x_pvt *)mci->pvt_info; | 224 | struct e752x_pvt *pvt = (struct e752x_pvt *)mci->pvt_info; |
@@ -241,7 +241,7 @@ static unsigned long ctl_page_to_phys(struct mem_ctl_info *mci, | |||
241 | } | 241 | } |
242 | 242 | ||
243 | static void do_process_ce(struct mem_ctl_info *mci, u16 error_one, | 243 | static void do_process_ce(struct mem_ctl_info *mci, u16 error_one, |
244 | u32 sec1_add, u16 sec1_syndrome) | 244 | u32 sec1_add, u16 sec1_syndrome) |
245 | { | 245 | { |
246 | u32 page; | 246 | u32 page; |
247 | int row; | 247 | int row; |
@@ -259,10 +259,10 @@ static void do_process_ce(struct mem_ctl_info *mci, u16 error_one, | |||
259 | /* chip select are bits 14 & 13 */ | 259 | /* chip select are bits 14 & 13 */ |
260 | row = ((page >> 1) & 3); | 260 | row = ((page >> 1) & 3); |
261 | e752x_printk(KERN_WARNING, | 261 | e752x_printk(KERN_WARNING, |
262 | "Test row %d Table %d %d %d %d %d %d %d %d\n", row, | 262 | "Test row %d Table %d %d %d %d %d %d %d %d\n", row, |
263 | pvt->map[0], pvt->map[1], pvt->map[2], pvt->map[3], | 263 | pvt->map[0], pvt->map[1], pvt->map[2], pvt->map[3], |
264 | pvt->map[4], pvt->map[5], pvt->map[6], | 264 | pvt->map[4], pvt->map[5], pvt->map[6], |
265 | pvt->map[7]); | 265 | pvt->map[7]); |
266 | 266 | ||
267 | /* test for channel remapping */ | 267 | /* test for channel remapping */ |
268 | for (i = 0; i < 8; i++) { | 268 | for (i = 0; i < 8; i++) { |
@@ -289,12 +289,12 @@ static void do_process_ce(struct mem_ctl_info *mci, u16 error_one, | |||
289 | 289 | ||
290 | /* e752x mc reads 34:6 of the DRAM linear address */ | 290 | /* e752x mc reads 34:6 of the DRAM linear address */ |
291 | edac_mc_handle_ce(mci, page, offset_in_page(sec1_add << 4), | 291 | edac_mc_handle_ce(mci, page, offset_in_page(sec1_add << 4), |
292 | sec1_syndrome, row, channel, "e752x CE"); | 292 | sec1_syndrome, row, channel, "e752x CE"); |
293 | } | 293 | } |
294 | 294 | ||
295 | static inline void process_ce(struct mem_ctl_info *mci, u16 error_one, | 295 | static inline void process_ce(struct mem_ctl_info *mci, u16 error_one, |
296 | u32 sec1_add, u16 sec1_syndrome, int *error_found, | 296 | u32 sec1_add, u16 sec1_syndrome, int *error_found, |
297 | int handle_error) | 297 | int handle_error) |
298 | { | 298 | { |
299 | *error_found = 1; | 299 | *error_found = 1; |
300 | 300 | ||
@@ -303,7 +303,7 @@ static inline void process_ce(struct mem_ctl_info *mci, u16 error_one, | |||
303 | } | 303 | } |
304 | 304 | ||
305 | static void do_process_ue(struct mem_ctl_info *mci, u16 error_one, | 305 | static void do_process_ue(struct mem_ctl_info *mci, u16 error_one, |
306 | u32 ded_add, u32 scrb_add) | 306 | u32 ded_add, u32 scrb_add) |
307 | { | 307 | { |
308 | u32 error_2b, block_page; | 308 | u32 error_2b, block_page; |
309 | int row; | 309 | int row; |
@@ -318,14 +318,14 @@ static void do_process_ue(struct mem_ctl_info *mci, u16 error_one, | |||
318 | block_page = error_2b >> (PAGE_SHIFT - 4); | 318 | block_page = error_2b >> (PAGE_SHIFT - 4); |
319 | 319 | ||
320 | row = pvt->mc_symmetric ? | 320 | row = pvt->mc_symmetric ? |
321 | /* chip select are bits 14 & 13 */ | 321 | /* chip select are bits 14 & 13 */ |
322 | ((block_page >> 1) & 3) : | 322 | ((block_page >> 1) & 3) : |
323 | edac_mc_find_csrow_by_page(mci, block_page); | 323 | edac_mc_find_csrow_by_page(mci, block_page); |
324 | 324 | ||
325 | /* e752x mc reads 34:6 of the DRAM linear address */ | 325 | /* e752x mc reads 34:6 of the DRAM linear address */ |
326 | edac_mc_handle_ue(mci, block_page, | 326 | edac_mc_handle_ue(mci, block_page, |
327 | offset_in_page(error_2b << 4), | 327 | offset_in_page(error_2b << 4), |
328 | row, "e752x UE from Read"); | 328 | row, "e752x UE from Read"); |
329 | } | 329 | } |
330 | if (error_one & 0x0404) { | 330 | if (error_one & 0x0404) { |
331 | error_2b = scrb_add; | 331 | error_2b = scrb_add; |
@@ -334,20 +334,20 @@ static void do_process_ue(struct mem_ctl_info *mci, u16 error_one, | |||
334 | block_page = error_2b >> (PAGE_SHIFT - 4); | 334 | block_page = error_2b >> (PAGE_SHIFT - 4); |
335 | 335 | ||
336 | row = pvt->mc_symmetric ? | 336 | row = pvt->mc_symmetric ? |
337 | /* chip select are bits 14 & 13 */ | 337 | /* chip select are bits 14 & 13 */ |
338 | ((block_page >> 1) & 3) : | 338 | ((block_page >> 1) & 3) : |
339 | edac_mc_find_csrow_by_page(mci, block_page); | 339 | edac_mc_find_csrow_by_page(mci, block_page); |
340 | 340 | ||
341 | /* e752x mc reads 34:6 of the DRAM linear address */ | 341 | /* e752x mc reads 34:6 of the DRAM linear address */ |
342 | edac_mc_handle_ue(mci, block_page, | 342 | edac_mc_handle_ue(mci, block_page, |
343 | offset_in_page(error_2b << 4), | 343 | offset_in_page(error_2b << 4), |
344 | row, "e752x UE from Scruber"); | 344 | row, "e752x UE from Scruber"); |
345 | } | 345 | } |
346 | } | 346 | } |
347 | 347 | ||
348 | static inline void process_ue(struct mem_ctl_info *mci, u16 error_one, | 348 | static inline void process_ue(struct mem_ctl_info *mci, u16 error_one, |
349 | u32 ded_add, u32 scrb_add, int *error_found, | 349 | u32 ded_add, u32 scrb_add, int *error_found, |
350 | int handle_error) | 350 | int handle_error) |
351 | { | 351 | { |
352 | *error_found = 1; | 352 | *error_found = 1; |
353 | 353 | ||
@@ -377,15 +377,15 @@ static void do_process_ded_retry(struct mem_ctl_info *mci, u16 error, | |||
377 | error_1b = retry_add; | 377 | error_1b = retry_add; |
378 | page = error_1b >> (PAGE_SHIFT - 4); /* convert the addr to 4k page */ | 378 | page = error_1b >> (PAGE_SHIFT - 4); /* convert the addr to 4k page */ |
379 | row = pvt->mc_symmetric ? ((page >> 1) & 3) : /* chip select are bits 14 & 13 */ | 379 | row = pvt->mc_symmetric ? ((page >> 1) & 3) : /* chip select are bits 14 & 13 */ |
380 | edac_mc_find_csrow_by_page(mci, page); | 380 | edac_mc_find_csrow_by_page(mci, page); |
381 | e752x_mc_printk(mci, KERN_WARNING, | 381 | e752x_mc_printk(mci, KERN_WARNING, |
382 | "CE page 0x%lx, row %d : Memory read retry\n", | 382 | "CE page 0x%lx, row %d : Memory read retry\n", |
383 | (long unsigned int)page, row); | 383 | (long unsigned int)page, row); |
384 | } | 384 | } |
385 | 385 | ||
386 | static inline void process_ded_retry(struct mem_ctl_info *mci, u16 error, | 386 | static inline void process_ded_retry(struct mem_ctl_info *mci, u16 error, |
387 | u32 retry_add, int *error_found, | 387 | u32 retry_add, int *error_found, |
388 | int handle_error) | 388 | int handle_error) |
389 | { | 389 | { |
390 | *error_found = 1; | 390 | *error_found = 1; |
391 | 391 | ||
@@ -418,7 +418,7 @@ static void do_global_error(int fatal, u32 errors) | |||
418 | for (i = 0; i < 11; i++) { | 418 | for (i = 0; i < 11; i++) { |
419 | if (errors & (1 << i)) | 419 | if (errors & (1 << i)) |
420 | e752x_printk(KERN_WARNING, "%sError %s\n", | 420 | e752x_printk(KERN_WARNING, "%sError %s\n", |
421 | fatal_message[fatal], global_message[i]); | 421 | fatal_message[fatal], global_message[i]); |
422 | } | 422 | } |
423 | } | 423 | } |
424 | 424 | ||
@@ -445,12 +445,12 @@ static void do_hub_error(int fatal, u8 errors) | |||
445 | for (i = 0; i < 7; i++) { | 445 | for (i = 0; i < 7; i++) { |
446 | if (errors & (1 << i)) | 446 | if (errors & (1 << i)) |
447 | e752x_printk(KERN_WARNING, "%sError %s\n", | 447 | e752x_printk(KERN_WARNING, "%sError %s\n", |
448 | fatal_message[fatal], hub_message[i]); | 448 | fatal_message[fatal], hub_message[i]); |
449 | } | 449 | } |
450 | } | 450 | } |
451 | 451 | ||
452 | static inline void hub_error(int fatal, u8 errors, int *error_found, | 452 | static inline void hub_error(int fatal, u8 errors, int *error_found, |
453 | int handle_error) | 453 | int handle_error) |
454 | { | 454 | { |
455 | *error_found = 1; | 455 | *error_found = 1; |
456 | 456 | ||
@@ -472,7 +472,7 @@ static void do_membuf_error(u8 errors) | |||
472 | for (i = 0; i < 4; i++) { | 472 | for (i = 0; i < 4; i++) { |
473 | if (errors & (1 << i)) | 473 | if (errors & (1 << i)) |
474 | e752x_printk(KERN_WARNING, "Non-Fatal Error %s\n", | 474 | e752x_printk(KERN_WARNING, "Non-Fatal Error %s\n", |
475 | membuf_message[i]); | 475 | membuf_message[i]); |
476 | } | 476 | } |
477 | } | 477 | } |
478 | 478 | ||
@@ -503,7 +503,7 @@ static void do_sysbus_error(int fatal, u32 errors) | |||
503 | for (i = 0; i < 10; i++) { | 503 | for (i = 0; i < 10; i++) { |
504 | if (errors & (1 << i)) | 504 | if (errors & (1 << i)) |
505 | e752x_printk(KERN_WARNING, "%sError System Bus %s\n", | 505 | e752x_printk(KERN_WARNING, "%sError System Bus %s\n", |
506 | fatal_message[fatal], sysbus_message[i]); | 506 | fatal_message[fatal], sysbus_message[i]); |
507 | } | 507 | } |
508 | } | 508 | } |
509 | 509 | ||
@@ -517,7 +517,7 @@ static inline void sysbus_error(int fatal, u32 errors, int *error_found, | |||
517 | } | 517 | } |
518 | 518 | ||
519 | static void e752x_check_hub_interface(struct e752x_error_info *info, | 519 | static void e752x_check_hub_interface(struct e752x_error_info *info, |
520 | int *error_found, int handle_error) | 520 | int *error_found, int handle_error) |
521 | { | 521 | { |
522 | u8 stat8; | 522 | u8 stat8; |
523 | 523 | ||
@@ -550,7 +550,7 @@ static void e752x_check_hub_interface(struct e752x_error_info *info, | |||
550 | } | 550 | } |
551 | 551 | ||
552 | static void e752x_check_sysbus(struct e752x_error_info *info, | 552 | static void e752x_check_sysbus(struct e752x_error_info *info, |
553 | int *error_found, int handle_error) | 553 | int *error_found, int handle_error) |
554 | { | 554 | { |
555 | u32 stat32, error32; | 555 | u32 stat32, error32; |
556 | 556 | ||
@@ -577,7 +577,7 @@ static void e752x_check_sysbus(struct e752x_error_info *info, | |||
577 | } | 577 | } |
578 | 578 | ||
579 | static void e752x_check_membuf(struct e752x_error_info *info, | 579 | static void e752x_check_membuf(struct e752x_error_info *info, |
580 | int *error_found, int handle_error) | 580 | int *error_found, int handle_error) |
581 | { | 581 | { |
582 | u8 stat8; | 582 | u8 stat8; |
583 | 583 | ||
@@ -597,8 +597,8 @@ static void e752x_check_membuf(struct e752x_error_info *info, | |||
597 | } | 597 | } |
598 | 598 | ||
599 | static void e752x_check_dram(struct mem_ctl_info *mci, | 599 | static void e752x_check_dram(struct mem_ctl_info *mci, |
600 | struct e752x_error_info *info, int *error_found, | 600 | struct e752x_error_info *info, int *error_found, |
601 | int handle_error) | 601 | int handle_error) |
602 | { | 602 | { |
603 | u16 error_one, error_next; | 603 | u16 error_one, error_next; |
604 | 604 | ||
@@ -608,11 +608,11 @@ static void e752x_check_dram(struct mem_ctl_info *mci, | |||
608 | /* decode and report errors */ | 608 | /* decode and report errors */ |
609 | if (error_one & 0x0101) /* check first error correctable */ | 609 | if (error_one & 0x0101) /* check first error correctable */ |
610 | process_ce(mci, error_one, info->dram_sec1_add, | 610 | process_ce(mci, error_one, info->dram_sec1_add, |
611 | info->dram_sec1_syndrome, error_found, handle_error); | 611 | info->dram_sec1_syndrome, error_found, handle_error); |
612 | 612 | ||
613 | if (error_next & 0x0101) /* check next error correctable */ | 613 | if (error_next & 0x0101) /* check next error correctable */ |
614 | process_ce(mci, error_next, info->dram_sec2_add, | 614 | process_ce(mci, error_next, info->dram_sec2_add, |
615 | info->dram_sec2_syndrome, error_found, handle_error); | 615 | info->dram_sec2_syndrome, error_found, handle_error); |
616 | 616 | ||
617 | if (error_one & 0x4040) | 617 | if (error_one & 0x4040) |
618 | process_ue_no_info_wr(mci, error_found, handle_error); | 618 | process_ue_no_info_wr(mci, error_found, handle_error); |
@@ -622,26 +622,26 @@ static void e752x_check_dram(struct mem_ctl_info *mci, | |||
622 | 622 | ||
623 | if (error_one & 0x2020) | 623 | if (error_one & 0x2020) |
624 | process_ded_retry(mci, error_one, info->dram_retr_add, | 624 | process_ded_retry(mci, error_one, info->dram_retr_add, |
625 | error_found, handle_error); | 625 | error_found, handle_error); |
626 | 626 | ||
627 | if (error_next & 0x2020) | 627 | if (error_next & 0x2020) |
628 | process_ded_retry(mci, error_next, info->dram_retr_add, | 628 | process_ded_retry(mci, error_next, info->dram_retr_add, |
629 | error_found, handle_error); | 629 | error_found, handle_error); |
630 | 630 | ||
631 | if (error_one & 0x0808) | 631 | if (error_one & 0x0808) |
632 | process_threshold_ce(mci, error_one, error_found, handle_error); | 632 | process_threshold_ce(mci, error_one, error_found, handle_error); |
633 | 633 | ||
634 | if (error_next & 0x0808) | 634 | if (error_next & 0x0808) |
635 | process_threshold_ce(mci, error_next, error_found, | 635 | process_threshold_ce(mci, error_next, error_found, |
636 | handle_error); | 636 | handle_error); |
637 | 637 | ||
638 | if (error_one & 0x0606) | 638 | if (error_one & 0x0606) |
639 | process_ue(mci, error_one, info->dram_ded_add, | 639 | process_ue(mci, error_one, info->dram_ded_add, |
640 | info->dram_scrb_add, error_found, handle_error); | 640 | info->dram_scrb_add, error_found, handle_error); |
641 | 641 | ||
642 | if (error_next & 0x0606) | 642 | if (error_next & 0x0606) |
643 | process_ue(mci, error_next, info->dram_ded_add, | 643 | process_ue(mci, error_next, info->dram_ded_add, |
644 | info->dram_scrb_add, error_found, handle_error); | 644 | info->dram_scrb_add, error_found, handle_error); |
645 | } | 645 | } |
646 | 646 | ||
647 | static void e752x_get_error_info(struct mem_ctl_info *mci, | 647 | static void e752x_get_error_info(struct mem_ctl_info *mci, |
@@ -658,38 +658,38 @@ static void e752x_get_error_info(struct mem_ctl_info *mci, | |||
658 | if (info->ferr_global) { | 658 | if (info->ferr_global) { |
659 | pci_read_config_byte(dev, E752X_HI_FERR, &info->hi_ferr); | 659 | pci_read_config_byte(dev, E752X_HI_FERR, &info->hi_ferr); |
660 | pci_read_config_word(dev, E752X_SYSBUS_FERR, | 660 | pci_read_config_word(dev, E752X_SYSBUS_FERR, |
661 | &info->sysbus_ferr); | 661 | &info->sysbus_ferr); |
662 | pci_read_config_byte(dev, E752X_BUF_FERR, &info->buf_ferr); | 662 | pci_read_config_byte(dev, E752X_BUF_FERR, &info->buf_ferr); |
663 | pci_read_config_word(dev, E752X_DRAM_FERR, &info->dram_ferr); | 663 | pci_read_config_word(dev, E752X_DRAM_FERR, &info->dram_ferr); |
664 | pci_read_config_dword(dev, E752X_DRAM_SEC1_ADD, | 664 | pci_read_config_dword(dev, E752X_DRAM_SEC1_ADD, |
665 | &info->dram_sec1_add); | 665 | &info->dram_sec1_add); |
666 | pci_read_config_word(dev, E752X_DRAM_SEC1_SYNDROME, | 666 | pci_read_config_word(dev, E752X_DRAM_SEC1_SYNDROME, |
667 | &info->dram_sec1_syndrome); | 667 | &info->dram_sec1_syndrome); |
668 | pci_read_config_dword(dev, E752X_DRAM_DED_ADD, | 668 | pci_read_config_dword(dev, E752X_DRAM_DED_ADD, |
669 | &info->dram_ded_add); | 669 | &info->dram_ded_add); |
670 | pci_read_config_dword(dev, E752X_DRAM_SCRB_ADD, | 670 | pci_read_config_dword(dev, E752X_DRAM_SCRB_ADD, |
671 | &info->dram_scrb_add); | 671 | &info->dram_scrb_add); |
672 | pci_read_config_dword(dev, E752X_DRAM_RETR_ADD, | 672 | pci_read_config_dword(dev, E752X_DRAM_RETR_ADD, |
673 | &info->dram_retr_add); | 673 | &info->dram_retr_add); |
674 | 674 | ||
675 | if (info->hi_ferr & 0x7f) | 675 | if (info->hi_ferr & 0x7f) |
676 | pci_write_config_byte(dev, E752X_HI_FERR, | 676 | pci_write_config_byte(dev, E752X_HI_FERR, |
677 | info->hi_ferr); | 677 | info->hi_ferr); |
678 | 678 | ||
679 | if (info->sysbus_ferr) | 679 | if (info->sysbus_ferr) |
680 | pci_write_config_word(dev, E752X_SYSBUS_FERR, | 680 | pci_write_config_word(dev, E752X_SYSBUS_FERR, |
681 | info->sysbus_ferr); | 681 | info->sysbus_ferr); |
682 | 682 | ||
683 | if (info->buf_ferr & 0x0f) | 683 | if (info->buf_ferr & 0x0f) |
684 | pci_write_config_byte(dev, E752X_BUF_FERR, | 684 | pci_write_config_byte(dev, E752X_BUF_FERR, |
685 | info->buf_ferr); | 685 | info->buf_ferr); |
686 | 686 | ||
687 | if (info->dram_ferr) | 687 | if (info->dram_ferr) |
688 | pci_write_bits16(pvt->bridge_ck, E752X_DRAM_FERR, | 688 | pci_write_bits16(pvt->bridge_ck, E752X_DRAM_FERR, |
689 | info->dram_ferr, info->dram_ferr); | 689 | info->dram_ferr, info->dram_ferr); |
690 | 690 | ||
691 | pci_write_config_dword(dev, E752X_FERR_GLOBAL, | 691 | pci_write_config_dword(dev, E752X_FERR_GLOBAL, |
692 | info->ferr_global); | 692 | info->ferr_global); |
693 | } | 693 | } |
694 | 694 | ||
695 | pci_read_config_dword(dev, E752X_NERR_GLOBAL, &info->nerr_global); | 695 | pci_read_config_dword(dev, E752X_NERR_GLOBAL, &info->nerr_global); |
@@ -697,38 +697,38 @@ static void e752x_get_error_info(struct mem_ctl_info *mci, | |||
697 | if (info->nerr_global) { | 697 | if (info->nerr_global) { |
698 | pci_read_config_byte(dev, E752X_HI_NERR, &info->hi_nerr); | 698 | pci_read_config_byte(dev, E752X_HI_NERR, &info->hi_nerr); |
699 | pci_read_config_word(dev, E752X_SYSBUS_NERR, | 699 | pci_read_config_word(dev, E752X_SYSBUS_NERR, |
700 | &info->sysbus_nerr); | 700 | &info->sysbus_nerr); |
701 | pci_read_config_byte(dev, E752X_BUF_NERR, &info->buf_nerr); | 701 | pci_read_config_byte(dev, E752X_BUF_NERR, &info->buf_nerr); |
702 | pci_read_config_word(dev, E752X_DRAM_NERR, &info->dram_nerr); | 702 | pci_read_config_word(dev, E752X_DRAM_NERR, &info->dram_nerr); |
703 | pci_read_config_dword(dev, E752X_DRAM_SEC2_ADD, | 703 | pci_read_config_dword(dev, E752X_DRAM_SEC2_ADD, |
704 | &info->dram_sec2_add); | 704 | &info->dram_sec2_add); |
705 | pci_read_config_word(dev, E752X_DRAM_SEC2_SYNDROME, | 705 | pci_read_config_word(dev, E752X_DRAM_SEC2_SYNDROME, |
706 | &info->dram_sec2_syndrome); | 706 | &info->dram_sec2_syndrome); |
707 | 707 | ||
708 | if (info->hi_nerr & 0x7f) | 708 | if (info->hi_nerr & 0x7f) |
709 | pci_write_config_byte(dev, E752X_HI_NERR, | 709 | pci_write_config_byte(dev, E752X_HI_NERR, |
710 | info->hi_nerr); | 710 | info->hi_nerr); |
711 | 711 | ||
712 | if (info->sysbus_nerr) | 712 | if (info->sysbus_nerr) |
713 | pci_write_config_word(dev, E752X_SYSBUS_NERR, | 713 | pci_write_config_word(dev, E752X_SYSBUS_NERR, |
714 | info->sysbus_nerr); | 714 | info->sysbus_nerr); |
715 | 715 | ||
716 | if (info->buf_nerr & 0x0f) | 716 | if (info->buf_nerr & 0x0f) |
717 | pci_write_config_byte(dev, E752X_BUF_NERR, | 717 | pci_write_config_byte(dev, E752X_BUF_NERR, |
718 | info->buf_nerr); | 718 | info->buf_nerr); |
719 | 719 | ||
720 | if (info->dram_nerr) | 720 | if (info->dram_nerr) |
721 | pci_write_bits16(pvt->bridge_ck, E752X_DRAM_NERR, | 721 | pci_write_bits16(pvt->bridge_ck, E752X_DRAM_NERR, |
722 | info->dram_nerr, info->dram_nerr); | 722 | info->dram_nerr, info->dram_nerr); |
723 | 723 | ||
724 | pci_write_config_dword(dev, E752X_NERR_GLOBAL, | 724 | pci_write_config_dword(dev, E752X_NERR_GLOBAL, |
725 | info->nerr_global); | 725 | info->nerr_global); |
726 | } | 726 | } |
727 | } | 727 | } |
728 | 728 | ||
729 | static int e752x_process_error_info(struct mem_ctl_info *mci, | 729 | static int e752x_process_error_info(struct mem_ctl_info *mci, |
730 | struct e752x_error_info *info, | 730 | struct e752x_error_info *info, |
731 | int handle_errors) | 731 | int handle_errors) |
732 | { | 732 | { |
733 | u32 error32, stat32; | 733 | u32 error32, stat32; |
734 | int error_found; | 734 | int error_found; |
@@ -775,7 +775,7 @@ static inline int dual_channel_active(u16 ddrcsr) | |||
775 | } | 775 | } |
776 | 776 | ||
777 | static void e752x_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev, | 777 | static void e752x_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev, |
778 | u16 ddrcsr) | 778 | u16 ddrcsr) |
779 | { | 779 | { |
780 | struct csrow_info *csrow; | 780 | struct csrow_info *csrow; |
781 | unsigned long last_cumul_size; | 781 | unsigned long last_cumul_size; |
@@ -841,7 +841,7 @@ static void e752x_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev, | |||
841 | } | 841 | } |
842 | 842 | ||
843 | static void e752x_init_mem_map_table(struct pci_dev *pdev, | 843 | static void e752x_init_mem_map_table(struct pci_dev *pdev, |
844 | struct e752x_pvt *pvt) | 844 | struct e752x_pvt *pvt) |
845 | { | 845 | { |
846 | int index; | 846 | int index; |
847 | u8 value, last, row, stat8; | 847 | u8 value, last, row, stat8; |
@@ -864,11 +864,11 @@ static void e752x_init_mem_map_table(struct pci_dev *pdev, | |||
864 | * sided | 864 | * sided |
865 | */ | 865 | */ |
866 | pci_read_config_byte(pdev, E752X_DRB + index + 1, | 866 | pci_read_config_byte(pdev, E752X_DRB + index + 1, |
867 | &value); | 867 | &value); |
868 | pvt->map[index + 1] = (value == last) ? 0xff : /* the dimm is single sided, | 868 | |
869 | so flag as empty */ | 869 | /* the dimm is single sided, so flag as empty */ |
870 | row; /* this is a double sided dimm | 870 | /* this is a double sided dimm to save the next row #*/ |
871 | to save the next row # */ | 871 | pvt->map[index + 1] = (value == last) ? 0xff : row; |
872 | row++; | 872 | row++; |
873 | last = value; | 873 | last = value; |
874 | } | 874 | } |
@@ -881,7 +881,7 @@ static void e752x_init_mem_map_table(struct pci_dev *pdev, | |||
881 | 881 | ||
882 | /* Return 0 on success or 1 on failure. */ | 882 | /* Return 0 on success or 1 on failure. */ |
883 | static int e752x_get_devs(struct pci_dev *pdev, int dev_idx, | 883 | static int e752x_get_devs(struct pci_dev *pdev, int dev_idx, |
884 | struct e752x_pvt *pvt) | 884 | struct e752x_pvt *pvt) |
885 | { | 885 | { |
886 | struct pci_dev *dev; | 886 | struct pci_dev *dev; |
887 | 887 | ||
@@ -894,13 +894,13 @@ static int e752x_get_devs(struct pci_dev *pdev, int dev_idx, | |||
894 | 894 | ||
895 | if (pvt->bridge_ck == NULL) { | 895 | if (pvt->bridge_ck == NULL) { |
896 | e752x_printk(KERN_ERR, "error reporting device not found:" | 896 | e752x_printk(KERN_ERR, "error reporting device not found:" |
897 | "vendor %x device 0x%x (broken BIOS?)\n", | 897 | "vendor %x device 0x%x (broken BIOS?)\n", |
898 | PCI_VENDOR_ID_INTEL, e752x_devs[dev_idx].err_dev); | 898 | PCI_VENDOR_ID_INTEL, e752x_devs[dev_idx].err_dev); |
899 | return 1; | 899 | return 1; |
900 | } | 900 | } |
901 | 901 | ||
902 | dev = pci_get_device(PCI_VENDOR_ID_INTEL, e752x_devs[dev_idx].ctl_dev, | 902 | dev = pci_get_device(PCI_VENDOR_ID_INTEL, e752x_devs[dev_idx].ctl_dev, |
903 | NULL); | 903 | NULL); |
904 | 904 | ||
905 | if (dev == NULL) | 905 | if (dev == NULL) |
906 | goto fail; | 906 | goto fail; |
@@ -910,7 +910,7 @@ static int e752x_get_devs(struct pci_dev *pdev, int dev_idx, | |||
910 | 910 | ||
911 | return 0; | 911 | return 0; |
912 | 912 | ||
913 | fail: | 913 | fail: |
914 | pci_dev_put(pvt->bridge_ck); | 914 | pci_dev_put(pvt->bridge_ck); |
915 | return 1; | 915 | return 1; |
916 | } | 916 | } |
@@ -961,7 +961,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx) | |||
961 | pci_read_config_byte(pdev, E752X_DEVPRES1, &stat8); | 961 | pci_read_config_byte(pdev, E752X_DEVPRES1, &stat8); |
962 | if (!force_function_unhide && !(stat8 & (1 << 5))) { | 962 | if (!force_function_unhide && !(stat8 & (1 << 5))) { |
963 | printk(KERN_INFO "Contact your BIOS vendor to see if the " | 963 | printk(KERN_INFO "Contact your BIOS vendor to see if the " |
964 | "E752x error registers can be safely un-hidden\n"); | 964 | "E752x error registers can be safely un-hidden\n"); |
965 | return -ENOMEM; | 965 | return -ENOMEM; |
966 | } | 966 | } |
967 | stat8 |= (1 << 5); | 967 | stat8 |= (1 << 5); |
@@ -981,7 +981,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx) | |||
981 | debugf3("%s(): init mci\n", __func__); | 981 | debugf3("%s(): init mci\n", __func__); |
982 | mci->mtype_cap = MEM_FLAG_RDDR; | 982 | mci->mtype_cap = MEM_FLAG_RDDR; |
983 | mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED | | 983 | mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED | |
984 | EDAC_FLAG_S4ECD4ED; | 984 | EDAC_FLAG_S4ECD4ED; |
985 | /* FIXME - what if different memory types are in different csrows? */ | 985 | /* FIXME - what if different memory types are in different csrows? */ |
986 | mci->mod_name = EDAC_MOD_STR; | 986 | mci->mod_name = EDAC_MOD_STR; |
987 | mci->mod_ver = E752X_REVISION; | 987 | mci->mod_ver = E752X_REVISION; |
@@ -1021,8 +1021,8 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx) | |||
1021 | pci_read_config_word(pdev, E752X_REMAPLIMIT, &pci_data); | 1021 | pci_read_config_word(pdev, E752X_REMAPLIMIT, &pci_data); |
1022 | pvt->remaplimit = ((u32) pci_data) << 14; | 1022 | pvt->remaplimit = ((u32) pci_data) << 14; |
1023 | e752x_printk(KERN_INFO, | 1023 | e752x_printk(KERN_INFO, |
1024 | "tolm = %x, remapbase = %x, remaplimit = %x\n", pvt->tolm, | 1024 | "tolm = %x, remapbase = %x, remaplimit = %x\n", |
1025 | pvt->remapbase, pvt->remaplimit); | 1025 | pvt->tolm, pvt->remapbase, pvt->remaplimit); |
1026 | 1026 | ||
1027 | /* Here we assume that we will never see multiple instances of this | 1027 | /* Here we assume that we will never see multiple instances of this |
1028 | * type of memory controller. The ID is therefore hardcoded to 0. | 1028 | * type of memory controller. The ID is therefore hardcoded to 0. |
@@ -1039,16 +1039,17 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx) | |||
1039 | e752x_pci = edac_pci_create_generic_ctl(&pdev->dev, EDAC_MOD_STR); | 1039 | e752x_pci = edac_pci_create_generic_ctl(&pdev->dev, EDAC_MOD_STR); |
1040 | if (!e752x_pci) { | 1040 | if (!e752x_pci) { |
1041 | printk(KERN_WARNING | 1041 | printk(KERN_WARNING |
1042 | "%s(): Unable to create PCI control\n", __func__); | 1042 | "%s(): Unable to create PCI control\n", __func__); |
1043 | printk(KERN_WARNING | 1043 | printk(KERN_WARNING |
1044 | "%s(): PCI error report via EDAC not setup\n", __func__); | 1044 | "%s(): PCI error report via EDAC not setup\n", |
1045 | __func__); | ||
1045 | } | 1046 | } |
1046 | 1047 | ||
1047 | /* get this far and it's successful */ | 1048 | /* get this far and it's successful */ |
1048 | debugf3("%s(): success\n", __func__); | 1049 | debugf3("%s(): success\n", __func__); |
1049 | return 0; | 1050 | return 0; |
1050 | 1051 | ||
1051 | fail: | 1052 | fail: |
1052 | pci_dev_put(pvt->dev_d0f0); | 1053 | pci_dev_put(pvt->dev_d0f0); |
1053 | pci_dev_put(pvt->dev_d0f1); | 1054 | pci_dev_put(pvt->dev_d0f1); |
1054 | pci_dev_put(pvt->bridge_ck); | 1055 | pci_dev_put(pvt->bridge_ck); |
@@ -1059,7 +1060,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx) | |||
1059 | 1060 | ||
1060 | /* returns count (>= 0), or negative on error */ | 1061 | /* returns count (>= 0), or negative on error */ |
1061 | static int __devinit e752x_init_one(struct pci_dev *pdev, | 1062 | static int __devinit e752x_init_one(struct pci_dev *pdev, |
1062 | const struct pci_device_id *ent) | 1063 | const struct pci_device_id *ent) |
1063 | { | 1064 | { |
1064 | debugf0("%s()\n", __func__); | 1065 | debugf0("%s()\n", __func__); |
1065 | 1066 | ||