diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-24 16:06:57 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-24 16:06:57 -0400 |
| commit | 8de547e1824437f3c6af180d3ed2162fa4b3f389 (patch) | |
| tree | 1318eea19b4b6a563ea2bbe95cf9b2ad10f92b43 | |
| parent | 76c39e4fef73e42777c27d6b87a04f89ebd0ef66 (diff) | |
| parent | e6649cc62949f1ed473bf1131fa425cfe72d3f64 (diff) | |
Merge branch 'devel' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/edac
* 'devel' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/edac: (25 commits)
i7300_edac: Properly initialize per-csrow memory size
V4L/DVB: i7300_edac: better initialize page counts
MAINTAINERS: Add maintainer for i7300-edac driver
i7300-edac: CodingStyle cleanup
i7300_edac: Improve comments
i7300_edac: Cleanup: reorganize the file contents
i7300_edac: Properly detect channel on CE errors
i7300_edac: enrich FBD error info for corrected errors
i7300_edac: enrich FBD error info for fatal errors
i7300_edac: pre-allocate a buffer used to prepare err messages
i7300_edac: Fix MTR x4/x8 detection logic
i7300_edac: Make the debug messages coherent with the others
i7300_edac: Cleanup: remove get_error_info logic
i7300_edac: Add a code to cleanup error registers
i7300_edac: Add support for reporting FBD errors
i7300_edac: Properly detect the type of error correction
i7300_edac: Detect if the device is on single mode
i7300_edac: Adds detection for enhanced scrub mode on x8
i7300_edac: Clear the error bit after reading
i7300_edac: Add error detection code for global errors
...
| -rw-r--r-- | MAINTAINERS | 7 | ||||
| -rw-r--r-- | drivers/edac/Kconfig | 7 | ||||
| -rw-r--r-- | drivers/edac/Makefile | 1 | ||||
| -rw-r--r-- | drivers/edac/i7300_edac.c | 1247 | ||||
| -rw-r--r-- | include/linux/pci_ids.h | 19 |
5 files changed, 1273 insertions, 8 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 0e265fcc103b..23a4ca9e27f4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -2212,6 +2212,13 @@ W: bluesmoke.sourceforge.net | |||
| 2212 | S: Maintained | 2212 | S: Maintained |
| 2213 | F: drivers/edac/i5400_edac.c | 2213 | F: drivers/edac/i5400_edac.c |
| 2214 | 2214 | ||
| 2215 | EDAC-I7300 | ||
| 2216 | M: Mauro Carvalho Chehab <mchehab@redhat.com> | ||
| 2217 | L: linux-edac@vger.kernel.org | ||
| 2218 | W: bluesmoke.sourceforge.net | ||
| 2219 | S: Maintained | ||
| 2220 | F: drivers/edac/i7300_edac.c | ||
| 2221 | |||
| 2215 | EDAC-I7CORE | 2222 | EDAC-I7CORE |
| 2216 | M: Mauro Carvalho Chehab <mchehab@redhat.com> | 2223 | M: Mauro Carvalho Chehab <mchehab@redhat.com> |
| 2217 | L: linux-edac@vger.kernel.org | 2224 | L: linux-edac@vger.kernel.org |
diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig index 9dbb28b9559f..f436a2fa9f38 100644 --- a/drivers/edac/Kconfig +++ b/drivers/edac/Kconfig | |||
| @@ -209,6 +209,13 @@ config EDAC_I5100 | |||
| 209 | Support for error detection and correction the Intel | 209 | Support for error detection and correction the Intel |
| 210 | San Clemente MCH. | 210 | San Clemente MCH. |
| 211 | 211 | ||
| 212 | config EDAC_I7300 | ||
| 213 | tristate "Intel Clarksboro MCH" | ||
| 214 | depends on EDAC_MM_EDAC && X86 && PCI | ||
| 215 | help | ||
| 216 | Support for error detection and correction the Intel | ||
| 217 | Clarksboro MCH (Intel 7300 chipset). | ||
| 218 | |||
| 212 | config EDAC_MPC85XX | 219 | config EDAC_MPC85XX |
| 213 | tristate "Freescale MPC83xx / MPC85xx" | 220 | tristate "Freescale MPC83xx / MPC85xx" |
| 214 | depends on EDAC_MM_EDAC && FSL_SOC && (PPC_83xx || PPC_85xx) | 221 | depends on EDAC_MM_EDAC && FSL_SOC && (PPC_83xx || PPC_85xx) |
diff --git a/drivers/edac/Makefile b/drivers/edac/Makefile index 32c7bc93c525..b3781399b38a 100644 --- a/drivers/edac/Makefile +++ b/drivers/edac/Makefile | |||
| @@ -27,6 +27,7 @@ obj-$(CONFIG_EDAC_CPC925) += cpc925_edac.o | |||
| 27 | obj-$(CONFIG_EDAC_I5000) += i5000_edac.o | 27 | obj-$(CONFIG_EDAC_I5000) += i5000_edac.o |
| 28 | obj-$(CONFIG_EDAC_I5100) += i5100_edac.o | 28 | obj-$(CONFIG_EDAC_I5100) += i5100_edac.o |
| 29 | obj-$(CONFIG_EDAC_I5400) += i5400_edac.o | 29 | obj-$(CONFIG_EDAC_I5400) += i5400_edac.o |
| 30 | obj-$(CONFIG_EDAC_I7300) += i7300_edac.o | ||
| 30 | obj-$(CONFIG_EDAC_I7CORE) += i7core_edac.o | 31 | obj-$(CONFIG_EDAC_I7CORE) += i7core_edac.o |
| 31 | obj-$(CONFIG_EDAC_E7XXX) += e7xxx_edac.o | 32 | obj-$(CONFIG_EDAC_E7XXX) += e7xxx_edac.o |
| 32 | obj-$(CONFIG_EDAC_E752X) += e752x_edac.o | 33 | obj-$(CONFIG_EDAC_E752X) += e752x_edac.o |
diff --git a/drivers/edac/i7300_edac.c b/drivers/edac/i7300_edac.c new file mode 100644 index 000000000000..05523b504271 --- /dev/null +++ b/drivers/edac/i7300_edac.c | |||
| @@ -0,0 +1,1247 @@ | |||
| 1 | /* | ||
| 2 | * Intel 7300 class Memory Controllers kernel module (Clarksboro) | ||
| 3 | * | ||
| 4 | * This file may be distributed under the terms of the | ||
| 5 | * GNU General Public License version 2 only. | ||
| 6 | * | ||
| 7 | * Copyright (c) 2010 by: | ||
| 8 | * Mauro Carvalho Chehab <mchehab@redhat.com> | ||
| 9 | * | ||
| 10 | * Red Hat Inc. http://www.redhat.com | ||
| 11 | * | ||
| 12 | * Intel 7300 Chipset Memory Controller Hub (MCH) - Datasheet | ||
| 13 | * http://www.intel.com/Assets/PDF/datasheet/318082.pdf | ||
| 14 | * | ||
| 15 | * TODO: The chipset allow checking for PCI Express errors also. Currently, | ||
| 16 | * the driver covers only memory error errors | ||
| 17 | * | ||
| 18 | * This driver uses "csrows" EDAC attribute to represent DIMM slot# | ||
| 19 | */ | ||
| 20 | |||
| 21 | #include <linux/module.h> | ||
| 22 | #include <linux/init.h> | ||
| 23 | #include <linux/pci.h> | ||
| 24 | #include <linux/pci_ids.h> | ||
| 25 | #include <linux/slab.h> | ||
| 26 | #include <linux/edac.h> | ||
| 27 | #include <linux/mmzone.h> | ||
| 28 | |||
| 29 | #include "edac_core.h" | ||
| 30 | |||
| 31 | /* | ||
| 32 | * Alter this version for the I7300 module when modifications are made | ||
| 33 | */ | ||
| 34 | #define I7300_REVISION " Ver: 1.0.0 " __DATE__ | ||
| 35 | |||
| 36 | #define EDAC_MOD_STR "i7300_edac" | ||
| 37 | |||
| 38 | #define i7300_printk(level, fmt, arg...) \ | ||
| 39 | edac_printk(level, "i7300", fmt, ##arg) | ||
| 40 | |||
| 41 | #define i7300_mc_printk(mci, level, fmt, arg...) \ | ||
| 42 | edac_mc_chipset_printk(mci, level, "i7300", fmt, ##arg) | ||
| 43 | |||
| 44 | /*********************************************** | ||
| 45 | * i7300 Limit constants Structs and static vars | ||
| 46 | ***********************************************/ | ||
| 47 | |||
| 48 | /* | ||
| 49 | * Memory topology is organized as: | ||
| 50 | * Branch 0 - 2 channels: channels 0 and 1 (FDB0 PCI dev 21.0) | ||
| 51 | * Branch 1 - 2 channels: channels 2 and 3 (FDB1 PCI dev 22.0) | ||
| 52 | * Each channel can have to 8 DIMM sets (called as SLOTS) | ||
| 53 | * Slots should generally be filled in pairs | ||
| 54 | * Except on Single Channel mode of operation | ||
| 55 | * just slot 0/channel0 filled on this mode | ||
| 56 | * On normal operation mode, the two channels on a branch should be | ||
| 57 | * filled together for the same SLOT# | ||
| 58 | * When in mirrored mode, Branch 1 replicate memory at Branch 0, so, the four | ||
| 59 | * channels on both branches should be filled | ||
| 60 | */ | ||
| 61 | |||
| 62 | /* Limits for i7300 */ | ||
| 63 | #define MAX_SLOTS 8 | ||
| 64 | #define MAX_BRANCHES 2 | ||
| 65 | #define MAX_CH_PER_BRANCH 2 | ||
| 66 | #define MAX_CHANNELS (MAX_CH_PER_BRANCH * MAX_BRANCHES) | ||
| 67 | #define MAX_MIR 3 | ||
| 68 | |||
| 69 | #define to_channel(ch, branch) ((((branch)) << 1) | (ch)) | ||
| 70 | |||
| 71 | #define to_csrow(slot, ch, branch) \ | ||
| 72 | (to_channel(ch, branch) | ((slot) << 2)) | ||
| 73 | |||
| 74 | /* Device name and register DID (Device ID) */ | ||
| 75 | struct i7300_dev_info { | ||
| 76 | const char *ctl_name; /* name for this device */ | ||
| 77 | u16 fsb_mapping_errors; /* DID for the branchmap,control */ | ||
| 78 | }; | ||
| 79 | |||
| 80 | /* Table of devices attributes supported by this driver */ | ||
| 81 | static const struct i7300_dev_info i7300_devs[] = { | ||
| 82 | { | ||
| 83 | .ctl_name = "I7300", | ||
| 84 | .fsb_mapping_errors = PCI_DEVICE_ID_INTEL_I7300_MCH_ERR, | ||
| 85 | }, | ||
| 86 | }; | ||
| 87 | |||
| 88 | struct i7300_dimm_info { | ||
| 89 | int megabytes; /* size, 0 means not present */ | ||
| 90 | }; | ||
| 91 | |||
| 92 | /* driver private data structure */ | ||
| 93 | struct i7300_pvt { | ||
| 94 | struct pci_dev *pci_dev_16_0_fsb_ctlr; /* 16.0 */ | ||
| 95 | struct pci_dev *pci_dev_16_1_fsb_addr_map; /* 16.1 */ | ||
| 96 | struct pci_dev *pci_dev_16_2_fsb_err_regs; /* 16.2 */ | ||
| 97 | struct pci_dev *pci_dev_2x_0_fbd_branch[MAX_BRANCHES]; /* 21.0 and 22.0 */ | ||
| 98 | |||
| 99 | u16 tolm; /* top of low memory */ | ||
| 100 | u64 ambase; /* AMB BAR */ | ||
| 101 | |||
| 102 | u32 mc_settings; /* Report several settings */ | ||
| 103 | u32 mc_settings_a; | ||
| 104 | |||
| 105 | u16 mir[MAX_MIR]; /* Memory Interleave Reg*/ | ||
| 106 | |||
| 107 | u16 mtr[MAX_SLOTS][MAX_BRANCHES]; /* Memory Technlogy Reg */ | ||
| 108 | u16 ambpresent[MAX_CHANNELS]; /* AMB present regs */ | ||
| 109 | |||
| 110 | /* DIMM information matrix, allocating architecture maximums */ | ||
| 111 | struct i7300_dimm_info dimm_info[MAX_SLOTS][MAX_CHANNELS]; | ||
| 112 | |||
| 113 | /* Temporary buffer for use when preparing error messages */ | ||
| 114 | char *tmp_prt_buffer; | ||
| 115 | }; | ||
| 116 | |||
| 117 | /* FIXME: Why do we need to have this static? */ | ||
| 118 | static struct edac_pci_ctl_info *i7300_pci; | ||
| 119 | |||
| 120 | /*************************************************** | ||
| 121 | * i7300 Register definitions for memory enumeration | ||
| 122 | ***************************************************/ | ||
| 123 | |||
| 124 | /* | ||
| 125 | * Device 16, | ||
| 126 | * Function 0: System Address (not documented) | ||
| 127 | * Function 1: Memory Branch Map, Control, Errors Register | ||
| 128 | */ | ||
| 129 | |||
| 130 | /* OFFSETS for Function 0 */ | ||
| 131 | #define AMBASE 0x48 /* AMB Mem Mapped Reg Region Base */ | ||
| 132 | #define MAXCH 0x56 /* Max Channel Number */ | ||
| 133 | #define MAXDIMMPERCH 0x57 /* Max DIMM PER Channel Number */ | ||
| 134 | |||
| 135 | /* OFFSETS for Function 1 */ | ||
| 136 | #define MC_SETTINGS 0x40 | ||
