Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165706
b: refs/heads/master
c: b484625
h: refs/heads/master
v: v3
  • Loading branch information
Ira W. Snyder authored and Linus Torvalds committed Sep 24, 2009
1 parent a5be056 commit 677a247
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a014554e667d702a3a7ae1cf500ebd358e7991be
refs/heads/master: b4846251727a38a7f248e41308c060995371dd05
6 changes: 3 additions & 3 deletions trunk/drivers/edac/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,11 @@ config EDAC_I5100
San Clemente MCH.

config EDAC_MPC85XX
tristate "Freescale MPC85xx"
depends on EDAC_MM_EDAC && FSL_SOC && MPC85xx
tristate "Freescale MPC83xx / MPC85xx"
depends on EDAC_MM_EDAC && FSL_SOC && (PPC_83xx || MPC85xx)
help
Support for error detection and correction on the Freescale
MPC8560, MPC8540, MPC8548
MPC8349, MPC8560, MPC8540, MPC8548

config EDAC_MV64X60
tristate "Marvell MV64x60"
Expand Down
28 changes: 19 additions & 9 deletions trunk/drivers/edac/mpc85xx_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ static u32 orig_pci_err_en;
#endif

static u32 orig_l2_err_disable;
#ifdef CONFIG_MPC85xx
static u32 orig_hid1[2];
#endif

/************************ MC SYSFS parts ***********************************/

Expand Down Expand Up @@ -789,19 +791,20 @@ static void __devinit mpc85xx_init_csrows(struct mem_ctl_info *mci)
csrow = &mci->csrows[index];
cs_bnds = in_be32(pdata->mc_vbase + MPC85XX_MC_CS_BNDS_0 +
(index * MPC85XX_MC_CS_BNDS_OFS));
start = (cs_bnds & 0xfff0000) << 4;
end = ((cs_bnds & 0xfff) << 20);
if (start)
start |= 0xfffff;
if (end)
end |= 0xfffff;

start = (cs_bnds & 0xffff0000) >> 16;
end = (cs_bnds & 0x0000ffff);

if (start == end)
continue; /* not populated */

start <<= (24 - PAGE_SHIFT);
end <<= (24 - PAGE_SHIFT);
end |= (1 << (24 - PAGE_SHIFT)) - 1;

csrow->first_page = start >> PAGE_SHIFT;
csrow->last_page = end >> PAGE_SHIFT;
csrow->nr_pages = csrow->last_page + 1 - csrow->first_page;
csrow->nr_pages = end + 1 - start;
csrow->grain = 8;
csrow->mtype = mtype;
csrow->dtype = DEV_UNKNOWN;
Expand Down Expand Up @@ -985,6 +988,7 @@ static struct of_device_id mpc85xx_mc_err_of_match[] = {
{ .compatible = "fsl,mpc8560-memory-controller", },
{ .compatible = "fsl,mpc8568-memory-controller", },
{ .compatible = "fsl,mpc8572-memory-controller", },
{ .compatible = "fsl,mpc8349-memory-controller", },
{ .compatible = "fsl,p2020-memory-controller", },
{},
};
Expand All @@ -1001,13 +1005,13 @@ static struct of_platform_driver mpc85xx_mc_err_driver = {
},
};


#ifdef CONFIG_MPC85xx
static void __init mpc85xx_mc_clear_rfxe(void *data)
{
orig_hid1[smp_processor_id()] = mfspr(SPRN_HID1);
mtspr(SPRN_HID1, (orig_hid1[smp_processor_id()] & ~0x20000));
}

#endif

static int __init mpc85xx_mc_init(void)
{
Expand Down Expand Up @@ -1040,26 +1044,32 @@ static int __init mpc85xx_mc_init(void)
printk(KERN_WARNING EDAC_MOD_STR "PCI fails to register\n");
#endif

#ifdef CONFIG_MPC85xx
/*
* need to clear HID1[RFXE] to disable machine check int
* so we can catch it
*/
if (edac_op_state == EDAC_OPSTATE_INT)
on_each_cpu(mpc85xx_mc_clear_rfxe, NULL, 0);
#endif

return 0;
}

module_init(mpc85xx_mc_init);

#ifdef CONFIG_MPC85xx
static void __exit mpc85xx_mc_restore_hid1(void *data)
{
mtspr(SPRN_HID1, orig_hid1[smp_processor_id()]);
}
#endif

static void __exit mpc85xx_mc_exit(void)
{
#ifdef CONFIG_MPC85xx
on_each_cpu(mpc85xx_mc_restore_hid1, NULL, 0);
#endif
#ifdef CONFIG_PCI
of_unregister_platform_driver(&mpc85xx_pci_err_driver);
#endif
Expand Down

0 comments on commit 677a247

Please sign in to comment.