diff options
author | Arthur Jones <ajones@riverbed.com> | 2008-07-25 04:49:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-25 13:53:48 -0400 |
commit | 43920a598f9358a12eb59eeddc4cd950f03aea8c (patch) | |
tree | 8008a71e74ad49df95f7d74a99f994a416f71a64 | |
parent | f7952ffcffa88c9a3fa92c26081f4ec9143c680f (diff) |
edac: i5100 fix enable ecc hardware
It is possible that the BIOS did not enable ECC at boot time. We check
for that case and fail to load if it is true.
Signed-off-by: Arthur Jones <ajones@riverbed.com>
Signed-off-by: Doug Thompson <dougthompson@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/edac/i5100_edac.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/edac/i5100_edac.c b/drivers/edac/i5100_edac.c index a8767a6c1481..509eec860c37 100644 --- a/drivers/edac/i5100_edac.c +++ b/drivers/edac/i5100_edac.c | |||
@@ -24,6 +24,8 @@ | |||
24 | /* register addresses and bit field accessors... */ | 24 | /* register addresses and bit field accessors... */ |
25 | 25 | ||
26 | /* device 16, func 1 */ | 26 | /* device 16, func 1 */ |
27 | #define I5100_MC 0x40 /* Memory Control Register */ | ||
28 | #define I5100_MC_ERRDETEN(a) ((a) >> 5 & 1) | ||
27 | #define I5100_MS 0x44 /* Memory Status Register */ | 29 | #define I5100_MS 0x44 /* Memory Status Register */ |
28 | #define I5100_SPDDATA 0x48 /* Serial Presence Detect Status Reg */ | 30 | #define I5100_SPDDATA 0x48 /* Serial Presence Detect Status Reg */ |
29 | #define I5100_SPDDATA_RDO(a) ((a) >> 15 & 1) | 31 | #define I5100_SPDDATA_RDO(a) ((a) >> 15 & 1) |
@@ -688,6 +690,14 @@ static int __devinit i5100_init_one(struct pci_dev *pdev, | |||
688 | goto bail; | 690 | goto bail; |
689 | } | 691 | } |
690 | 692 | ||
693 | /* ECC enabled? */ | ||
694 | pci_read_config_dword(pdev, I5100_MC, &dw); | ||
695 | if (!I5100_MC_ERRDETEN(dw)) { | ||
696 | printk(KERN_INFO "i5100_edac: ECC not enabled.\n"); | ||
697 | ret = -ENODEV; | ||
698 | goto bail; | ||
699 | } | ||
700 | |||
691 | /* figure out how many ranks, from strapped state of 48GB_Mode input */ | 701 | /* figure out how many ranks, from strapped state of 48GB_Mode input */ |
692 | pci_read_config_dword(pdev, I5100_MS, &dw); | 702 | pci_read_config_dword(pdev, I5100_MS, &dw); |
693 | ranksperch = !!(dw & (1 << 8)) * 2 + 4; | 703 | ranksperch = !!(dw & (1 << 8)) * 2 + 4; |