amd64_edac: Add support for newer F16h models
authorAravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>
Thu, 20 Feb 2014 16:28:46 +0000 (10:28 -0600)
committerBorislav Petkov <bp@suse.de>
Thu, 27 Feb 2014 17:03:16 +0000 (18:03 +0100)
Extend ECC decoding support for F16h M30h. Tested on F16h M30h with ECC
turned on using mce_amd_inj module and the patch works fine.

Signed-off-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>
Link: http://lkml.kernel.org/r/1392913726-16961-1-git-send-email-Aravind.Gopalakrishnan@amd.com
Tested-by: Arindam Nath <Arindam.Nath@amd.com>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
arch/x86/kernel/amd_nb.c
drivers/edac/amd64_edac.c
drivers/edac/amd64_edac.h
include/linux/pci_ids.h

index 59554dca96ec8945c1d7f514a1281e06c6e7e771..6523534671b6a7e38c8a847f7ad7b421f714a4be 100644 (file)
@@ -22,6 +22,7 @@ const struct pci_device_id amd_nb_misc_ids[] = {
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_M10H_F3) },
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_M30H_NB_F3) },
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_NB_F3) },
+       { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_M30H_NB_F3) },
        {}
 };
 EXPORT_SYMBOL(amd_nb_misc_ids);
@@ -30,6 +31,7 @@ static const struct pci_device_id amd_nb_link_ids[] = {
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_NB_F4) },
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_M30H_NB_F4) },
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_NB_F4) },
+       { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_M30H_NB_F4) },
        {}
 };
 
index 34380ccc3dd95538aef011e856e8e68a225ce207..f8bf00010d45a78652c9a922ddb5a2d5c65a7448 100644 (file)
@@ -1807,6 +1807,17 @@ static struct amd64_family_type family_types[] = {
                        .read_dct_pci_cfg       = f10_read_dct_pci_cfg,
                }
        },
+       [F16_M30H_CPUS] = {
+               .ctl_name = "F16h_M30h",
+               .f1_id = PCI_DEVICE_ID_AMD_16H_M30H_NB_F1,
+               .f3_id = PCI_DEVICE_ID_AMD_16H_M30H_NB_F3,
+               .ops = {
+                       .early_channel_count    = f1x_early_channel_count,
+                       .map_sysaddr_to_csrow   = f1x_map_sysaddr_to_csrow,
+                       .dbam_to_cs             = f16_dbam_to_chip_select,
+                       .read_dct_pci_cfg       = f10_read_dct_pci_cfg,
+               }
+       },
 };
 
 /*
@@ -2586,6 +2597,11 @@ static struct amd64_family_type *per_family_init(struct amd64_pvt *pvt)
                break;
 
        case 0x16:
+               if (pvt->model == 0x30) {
+                       fam_type = &family_types[F16_M30H_CPUS];
+                       pvt->ops = &family_types[F16_M30H_CPUS].ops;
+                       break;
+               }
                fam_type        = &family_types[F16_CPUS];
                pvt->ops        = &family_types[F16_CPUS].ops;
                break;
@@ -2838,6 +2854,14 @@ static const struct pci_device_id amd64_pci_table[] = {
                .class          = 0,
                .class_mask     = 0,
        },
+       {
+               .vendor         = PCI_VENDOR_ID_AMD,
+               .device         = PCI_DEVICE_ID_AMD_16H_M30H_NB_F2,
+               .subvendor      = PCI_ANY_ID,
+               .subdevice      = PCI_ANY_ID,
+               .class          = 0,
+               .class_mask     = 0,
+       },
 
        {0, }
 };
index 6dc1fcc25afb8ac7ad04df3c58a462e9996f557b..d903e0c21144814862032e453c811cee8b998b91 100644 (file)
 #define PCI_DEVICE_ID_AMD_15H_NB_F2    0x1602
 #define PCI_DEVICE_ID_AMD_16H_NB_F1    0x1531
 #define PCI_DEVICE_ID_AMD_16H_NB_F2    0x1532
+#define PCI_DEVICE_ID_AMD_16H_M30H_NB_F1 0x1581
+#define PCI_DEVICE_ID_AMD_16H_M30H_NB_F2 0x1582
 
 /*
  * Function 1 - Address Map
@@ -300,6 +302,7 @@ enum amd_families {
        F15_CPUS,
        F15_M30H_CPUS,
        F16_CPUS,
+       F16_M30H_CPUS,
        NUM_FAMILIES,
 };
 
index 97fbecdd7a401157cd290d6f4e981a8557ee4745..e91ad27b1a560b720a591fc1e31573b293f1c5be 100644 (file)
 #define PCI_DEVICE_ID_AMD_15H_NB_F5    0x1605
 #define PCI_DEVICE_ID_AMD_16H_NB_F3    0x1533
 #define PCI_DEVICE_ID_AMD_16H_NB_F4    0x1534
+#define PCI_DEVICE_ID_AMD_16H_M30H_NB_F3 0x1583
+#define PCI_DEVICE_ID_AMD_16H_M30H_NB_F4 0x1584
 #define PCI_DEVICE_ID_AMD_CNB17H_F3    0x1703
 #define PCI_DEVICE_ID_AMD_LANCE                0x2000
 #define PCI_DEVICE_ID_AMD_LANCE_HOME   0x2001