Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sb_edac: support for Broadwell -EP and -EX

Basic support for the single socket Broadwell-DE processor
was added back in commit 1f39581a9a7a
sb_edac: Add support for Broadwell-DE processor
This patch extends Broadwell support to cover the two
socket "-EP" and four socket "-EX" versions of Broadwell.
Only tested on the 2 socket - but this code is largely
cloned from the Haswell path.

Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

authored by

Tony Luck and committed by
Mauro Carvalho Chehab
fa2ce64f 7d375bff

+58 -15
+58 -15
drivers/edac/sb_edac.c
··· 508 508 * DE processor: 509 509 * - 1 IMC 510 510 * - 2 DDR3 channels, 2 DPC per channel 511 + * EP processor: 512 + * - 1 or 2 IMC 513 + * - 4 DDR4 channels, 3 DPC per channel 514 + * EP 4S processor: 515 + * - 2 IMC 516 + * - 4 DDR4 channels, 3 DPC per channel 517 + * EX processor: 518 + * - 2 IMC 519 + * - each IMC interfaces with a SMI 2 channel 520 + * - each SMI channel interfaces with a scalable memory buffer 521 + * - each scalable memory buffer supports 4 DDR3/DDR4 channels, 3 DPC 511 522 */ 512 523 #define PCI_DEVICE_ID_INTEL_BROADWELL_IMC_VTD_MISC 0x6f28 513 524 #define PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA0 0x6fa0 525 + #define PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA1 0x6f60 514 526 #define PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA0_TA 0x6fa8 515 527 #define PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA0_THERMAL 0x6f71 528 + #define PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA1_TA 0x6f68 529 + #define PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA1_THERMAL 0x6f79 516 530 #define PCI_DEVICE_ID_INTEL_BROADWELL_IMC_CBO_SAD0 0x6ffc 517 531 #define PCI_DEVICE_ID_INTEL_BROADWELL_IMC_CBO_SAD1 0x6ffd 518 532 #define PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA0_TAD0 0x6faa 519 533 #define PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA0_TAD1 0x6fab 520 534 #define PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA0_TAD2 0x6fac 521 535 #define PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA0_TAD3 0x6fad 536 + #define PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA1_TAD0 0x6f6a 537 + #define PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA1_TAD1 0x6f6b 538 + #define PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA1_TAD2 0x6f6c 539 + #define PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA1_TAD3 0x6f6d 522 540 #define PCI_DEVICE_ID_INTEL_BROADWELL_IMC_DDRIO0 0x6faf 523 541 524 542 static const struct pci_id_descr pci_dev_descr_broadwell[] = { ··· 546 528 { PCI_DESCR(PCI_DEVICE_ID_INTEL_BROADWELL_IMC_CBO_SAD0, 0) }, 547 529 { PCI_DESCR(PCI_DEVICE_ID_INTEL_BROADWELL_IMC_CBO_SAD1, 0) }, 548 530 531 + { PCI_DESCR(PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA1, 1) }, 532 + 549 533 { PCI_DESCR(PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA0_TA, 0) }, 550 534 { PCI_DESCR(PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA0_THERMAL, 0) }, 551 535 { PCI_DESCR(PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA0_TAD0, 0) }, 552 536 { PCI_DESCR(PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA0_TAD1, 0) }, 553 - { PCI_DESCR(PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA0_TAD2, 0) }, 554 - { PCI_DESCR(PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA0_TAD3, 0) }, 537 + { PCI_DESCR(PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA0_TAD2, 1) }, 538 + { PCI_DESCR(PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA0_TAD3, 1) }, 539 + 555 540 { PCI_DESCR(PCI_DEVICE_ID_INTEL_BROADWELL_IMC_DDRIO0, 1) }, 541 + 542 + { PCI_DESCR(PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA1_TA, 1) }, 543 + { PCI_DESCR(PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA1_THERMAL, 1) }, 544 + { PCI_DESCR(PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA1_TAD0, 1) }, 545 + { PCI_DESCR(PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA1_TAD1, 1) }, 546 + { PCI_DESCR(PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA1_TAD2, 1) }, 547 + { PCI_DESCR(PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA1_TAD3, 1) }, 556 548 }; 557 549 558 550 static const struct pci_id_table pci_dev_descr_broadwell_table[] = { ··· 591 563 int ranks = (1 << RANK_CNT_BITS(mtr)); 592 564 int max = 4; 593 565 594 - if (type == HASWELL) 566 + if (type == HASWELL || type == BROADWELL) 595 567 max = 8; 596 568 597 569 if (ranks > max) { ··· 1908 1880 { 1909 1881 struct sbridge_pvt *pvt = mci->pvt_info; 1910 1882 struct pci_dev *pdev; 1883 + u8 saw_chan_mask = 0; 1911 1884 int i; 1912 1885 1913 1886 /* there's only one device per system; not tied to any bus */ ··· 1940 1911 pvt->pci_ras = pdev; 1941 1912 break; 1942 1913 case PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA0_TAD0: 1943 - pvt->pci_tad[0] = pdev; 1944 - break; 1945 1914 case PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA0_TAD1: 1946 - pvt->pci_tad[1] = pdev; 1947 - break; 1948 1915 case PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA0_TAD2: 1949 - pvt->pci_tad[2] = pdev; 1950 - break; 1951 1916 case PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA0_TAD3: 1952 - pvt->pci_tad[3] = pdev; 1917 + { 1918 + int id = pdev->device - PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA0_TAD0; 1919 + pvt->pci_tad[id] = pdev; 1920 + saw_chan_mask |= 1 << id; 1921 + } 1922 + break; 1923 + case PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA1_TAD0: 1924 + case PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA1_TAD1: 1925 + case PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA1_TAD2: 1926 + case PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA1_TAD3: 1927 + { 1928 + int id = pdev->device - PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA1_TAD0 + 4; 1929 + pvt->pci_tad[id] = pdev; 1930 + saw_chan_mask |= 1 << id; 1931 + } 1953 1932 break; 1954 1933 case PCI_DEVICE_ID_INTEL_BROADWELL_IMC_DDRIO0: 1955 1934 pvt->pci_ddrio = pdev; 1935 + break; 1936 + case PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA1: 1937 + pvt->pci_ha1 = pdev; 1938 + break; 1939 + case PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA1_TA: 1940 + pvt->pci_ha1_ta = pdev; 1956 1941 break; 1957 1942 default: 1958 1943 break; ··· 1983 1940 !pvt->pci_ras || !pvt->pci_ta || !pvt->info.pci_vtd) 1984 1941 goto enodev; 1985 1942 1986 - for (i = 0; i < NUM_CHANNELS; i++) { 1987 - if (!pvt->pci_tad[i]) 1988 - goto enodev; 1989 - } 1943 + if (saw_chan_mask != 0x0f && /* -EN */ 1944 + saw_chan_mask != 0x33 && /* -EP */ 1945 + saw_chan_mask != 0xff) /* -EX */ 1946 + goto enodev; 1990 1947 return 0; 1991 1948 1992 1949 enodev: ··· 2025 1982 int rc, dimm; 2026 1983 char *area_type = NULL; 2027 1984 2028 - if (pvt->info.type == IVY_BRIDGE) 1985 + if (pvt->info.type != SANDY_BRIDGE) 2029 1986 recoverable = true; 2030 1987 else 2031 1988 recoverable = GET_BITFIELD(m->status, 56, 56);