aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/r82600_edac.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/edac/r82600_edac.c')
-rw-r--r--drivers/edac/r82600_edac.c48
1 files changed, 25 insertions, 23 deletions
diff --git a/drivers/edac/r82600_edac.c b/drivers/edac/r82600_edac.c
index e90892831b90..27d16dc2f11d 100644
--- a/drivers/edac/r82600_edac.c
+++ b/drivers/edac/r82600_edac.c
@@ -26,6 +26,12 @@
26 26
27#include "edac_mc.h" 27#include "edac_mc.h"
28 28
29#define r82600_printk(level, fmt, arg...) \
30 edac_printk(level, "r82600", fmt, ##arg)
31
32#define r82600_mc_printk(mci, level, fmt, arg...) \
33 edac_mc_chipset_printk(mci, level, "r82600", fmt, ##arg)
34
29/* Radisys say "The 82600 integrates a main memory SDRAM controller that 35/* Radisys say "The 82600 integrates a main memory SDRAM controller that
30 * supports up to four banks of memory. The four banks can support a mix of 36 * supports up to four banks of memory. The four banks can support a mix of
31 * sizes of 64 bit wide (72 bits with ECC) Synchronous DRAM (SDRAM) DIMMs, 37 * sizes of 64 bit wide (72 bits with ECC) Synchronous DRAM (SDRAM) DIMMs,
@@ -196,7 +202,7 @@ static void r82600_check(struct mem_ctl_info *mci)
196{ 202{
197 struct r82600_error_info info; 203 struct r82600_error_info info;
198 204
199 debugf1("MC%d: " __FILE__ ": %s()\n", mci->mc_idx, __func__); 205 debugf1("MC%d: %s()\n", mci->mc_idx, __func__);
200 r82600_get_error_info(mci, &info); 206 r82600_get_error_info(mci, &info);
201 r82600_process_error_info(mci, &info, 1); 207 r82600_process_error_info(mci, &info, 1);
202} 208}
@@ -215,7 +221,7 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx)
215 u32 row_high_limit_last = 0; 221 u32 row_high_limit_last = 0;
216 u32 eap_init_bits; 222 u32 eap_init_bits;
217 223
218 debugf0("MC: " __FILE__ ": %s()\n", __func__); 224 debugf0("%s()\n", __func__);
219 225
220 226
221 pci_read_config_byte(pdev, R82600_DRAMC, &dramcr); 227 pci_read_config_byte(pdev, R82600_DRAMC, &dramcr);
@@ -226,11 +232,10 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx)
226 scrub_disabled = eapr & BIT(31); 232 scrub_disabled = eapr & BIT(31);
227 sdram_refresh_rate = dramcr & (BIT(0) | BIT(1)); 233 sdram_refresh_rate = dramcr & (BIT(0) | BIT(1));
228 234
229 debugf2("MC: " __FILE__ ": %s(): sdram refresh rate = %#0x\n", 235 debugf2("%s(): sdram refresh rate = %#0x\n", __func__,
230 __func__, sdram_refresh_rate); 236 sdram_refresh_rate);
231 237
232 debugf2("MC: " __FILE__ ": %s(): DRAMC register = %#0x\n", __func__, 238 debugf2("%s(): DRAMC register = %#0x\n", __func__, dramcr);
233 dramcr);
234 239
235 mci = edac_mc_alloc(0, R82600_NR_CSROWS, R82600_NR_CHANS); 240 mci = edac_mc_alloc(0, R82600_NR_CSROWS, R82600_NR_CHANS);
236 241
@@ -239,7 +244,7 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx)
239 goto fail; 244 goto fail;
240 } 245 }
241 246
242 debugf0("MC: " __FILE__ ": %s(): mci = %p\n", __func__, mci); 247 debugf0("%s(): mci = %p\n", __func__, mci);
243 248
244 mci->pdev = pdev; 249 mci->pdev = pdev;
245 mci->mtype_cap = MEM_FLAG_RDDR | MEM_FLAG_DDR; 250 mci->mtype_cap = MEM_FLAG_RDDR | MEM_FLAG_DDR;
@@ -255,9 +260,8 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx)
255 mci->edac_cap = EDAC_FLAG_NONE | EDAC_FLAG_EC | EDAC_FLAG_SECDED; 260 mci->edac_cap = EDAC_FLAG_NONE | EDAC_FLAG_EC | EDAC_FLAG_SECDED;
256 if (ecc_on) { 261 if (ecc_on) {
257 if (scrub_disabled) 262 if (scrub_disabled)
258 debugf3("MC: " __FILE__ ": %s(): mci = %p - " 263 debugf3("%s(): mci = %p - Scrubbing disabled! EAP: "
259 "Scrubbing disabled! EAP: %#0x\n", __func__, 264 "%#0x\n", __func__, mci, eapr);
260 mci, eapr);
261 } else 265 } else
262 mci->edac_cap = EDAC_FLAG_NONE; 266 mci->edac_cap = EDAC_FLAG_NONE;
263 267
@@ -276,16 +280,15 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx)
276 /* find the DRAM Chip Select Base address and mask */ 280 /* find the DRAM Chip Select Base address and mask */
277 pci_read_config_byte(mci->pdev, R82600_DRBA + index, &drbar); 281 pci_read_config_byte(mci->pdev, R82600_DRBA + index, &drbar);
278 282
279 debugf1("MC%d: " __FILE__ ": %s() Row=%d DRBA = %#0x\n", 283 debugf1("MC%d: %s() Row=%d DRBA = %#0x\n", mci->mc_idx,
280 mci->mc_idx, __func__, index, drbar); 284 __func__, index, drbar);
281 285
282 row_high_limit = ((u32) drbar << 24); 286 row_high_limit = ((u32) drbar << 24);
283/* row_high_limit = ((u32)drbar << 24) | 0xffffffUL; */ 287/* row_high_limit = ((u32)drbar << 24) | 0xffffffUL; */
284 288
285 debugf1("MC%d: " __FILE__ ": %s() Row=%d, " 289 debugf1("MC%d: %s() Row=%d, Boundry Address=%#0x, Last = "
286 "Boundry Address=%#0x, Last = %#0x \n", 290 "%#0x \n", mci->mc_idx, __func__, index,
287 mci->mc_idx, __func__, index, row_high_limit, 291 row_high_limit, row_high_limit_last);
288 row_high_limit_last);
289 292
290 /* Empty row [p.57] */ 293 /* Empty row [p.57] */
291 if (row_high_limit == row_high_limit_last) 294 if (row_high_limit == row_high_limit_last)
@@ -312,8 +315,7 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx)
312 /* FIXME should we? */ 315 /* FIXME should we? */
313 316
314 if (edac_mc_add_mc(mci)) { 317 if (edac_mc_add_mc(mci)) {
315 debugf3("MC: " __FILE__ 318 debugf3("%s(): failed edac_mc_add_mc()\n", __func__);
316 ": %s(): failed edac_mc_add_mc()\n", __func__);
317 goto fail; 319 goto fail;
318 } 320 }
319 321
@@ -325,14 +327,14 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx)
325 eap_init_bits = BIT(0) & BIT(1); 327 eap_init_bits = BIT(0) & BIT(1);
326 if (disable_hardware_scrub) { 328 if (disable_hardware_scrub) {
327 eap_init_bits |= BIT(31); 329 eap_init_bits |= BIT(31);
328 debugf3("MC: " __FILE__ ": %s(): Disabling Hardware Scrub " 330 debugf3("%s(): Disabling Hardware Scrub (scrub on error)\n",
329 "(scrub on error)\n", __func__); 331 __func__);
330 } 332 }
331 333
332 pci_write_bits32(mci->pdev, R82600_EAP, eap_init_bits, 334 pci_write_bits32(mci->pdev, R82600_EAP, eap_init_bits,
333 eap_init_bits); 335 eap_init_bits);
334 336
335 debugf3("MC: " __FILE__ ": %s(): success\n", __func__); 337 debugf3("%s(): success\n", __func__);
336 return 0; 338 return 0;
337 339
338fail: 340fail:
@@ -346,7 +348,7 @@ fail:
346static int __devinit r82600_init_one(struct pci_dev *pdev, 348static int __devinit r82600_init_one(struct pci_dev *pdev,
347 const struct pci_device_id *ent) 349 const struct pci_device_id *ent)
348{ 350{
349 debugf0("MC: " __FILE__ ": %s()\n", __func__); 351 debugf0("%s()\n", __func__);
350 352
351 /* don't need to call pci_device_enable() */ 353 /* don't need to call pci_device_enable() */
352 return r82600_probe1(pdev, ent->driver_data); 354 return r82600_probe1(pdev, ent->driver_data);
@@ -357,7 +359,7 @@ static void __devexit r82600_remove_one(struct pci_dev *pdev)
357{ 359{
358 struct mem_ctl_info *mci; 360 struct mem_ctl_info *mci;
359 361
360 debugf0(__FILE__ ": %s()\n", __func__); 362 debugf0("%s()\n", __func__);
361 363
362 if (((mci = edac_mc_find_mci_by_pdev(pdev)) != NULL) && 364 if (((mci = edac_mc_find_mci_by_pdev(pdev)) != NULL) &&
363 !edac_mc_del_mc(mci)) 365 !edac_mc_del_mc(mci))