Skip to contentSkip to conversation

edac: mpc85xx: Add support for MPC8572

PATCH In review Nate Case 4 participants 5 messages Sep 19, 2008 – Oct 8, 2008

Subsystems (2)
lore
Share & tools
lore

Nate Case

author
#0 lore raw

PATCH v2 1/1 edac: mpc85xx: Add support for MPC8572

From: Andrew Kilkenny <[email protected]>

This adds support for the dual-core MPC8572 processor. We have to support making SPR changes on each core. Also, since we can have multiple memory controllers sharing an interrupt, flag the interrupts with IRQF_SHARED.

---
 drivers/edac/mpc85xx_edac.c |   28 +++++++++++++++++++++++-----
 1 files changed, 23 insertions(+), 5 deletions(-)
drivers/edac/mpc85xx_edac.c +23 -5
index 2265d9c..63bdc47 100644
@@ -17,6 +17,7 @@
 #include <linux/io.h>
 #include <linux/mod_devicetable.h>
 #include <linux/edac.h>
+#include <linux/smp.h>
 
 #include <linux/of_platform.h>
 #include <linux/of_device.h>
@@ -40,7 +41,7 @@ static u32 orig_pci_err_en;
 #endif
 
 static u32 orig_l2_err_disable;
-static u32 orig_hid1;
+static u32 orig_hid1[2];
 
 /************************ MC SYSFS parts ***********************************/
 
@@ -647,6 +648,9 @@ static struct of_device_id mpc85xx_l2_err_of_match[] = {
 	{
 	 .compatible = "fsl,8568-l2-cache-controller",
 	 },
+	{
+	 .compatible = "fsl,mpc8572-l2-cache-controller",
+	 },
 	{},
 };
 
@@ -912,7 +916,8 @@ static int __devinit mpc85xx_mc_err_probe(struct of_device *op,
 		/* register interrupts */
 		pdata->irq = irq_of_parse_and_map(op->node, 0);
 		res = devm_request_irq(&op->dev, pdata->irq,
-				       mpc85xx_mc_isr, IRQF_DISABLED,
+				       mpc85xx_mc_isr,
+				       IRQF_DISABLED | IRQF_SHARED,
 				       "[EDAC] MC err", mci);
 		if (res < 0) {
 			printk(KERN_ERR "%s: Unable to request irq %d for "
@@ -980,6 +985,9 @@ static struct of_device_id mpc85xx_mc_err_of_match[] = {
 	{
 	 .compatible = "fsl,8568-memory-controller",
 	 },
+	{
+	 .compatible = "fsl,mpc8572-memory-controller",
+	 },
 	{},
 };
 
@@ -995,6 +1003,12 @@ static struct of_platform_driver mpc85xx_mc_err_driver = {
 		   },
 };
 
+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));
+}
+
 static int __init mpc85xx_mc_init(void)
 {
 	int res = 0;
@@ -1031,8 +1045,7 @@ static int __init mpc85xx_mc_init(void)
 	 * so we can catch it
 	 */
 	if (edac_op_state == EDAC_OPSTATE_INT) {
-		orig_hid1 = mfspr(SPRN_HID1);
-		mtspr(SPRN_HID1, (orig_hid1 & ~0x20000));
+		on_each_cpu(mpc85xx_mc_clear_rfxe, NULL, 0);
 	}
 
 	return 0;
@@ -1040,9 +1053,14 @@ static int __init mpc85xx_mc_init(void)
 
 module_init(mpc85xx_mc_init);
 
+static void __exit mpc85xx_mc_restore_hid1(void *data)
+{
+	mtspr(SPRN_HID1, orig_hid1[smp_processor_id()]);
+}
+
 static void __exit mpc85xx_mc_exit(void)
 {
-	mtspr(SPRN_HID1, orig_hid1);
+	on_each_cpu(mpc85xx_mc_restore_hid1, NULL, 0);
 #ifdef CONFIG_PCI
 	of_unregister_platform_driver(&mpc85xx_pci_err_driver);
 #endif
Signature · 1 line
1.6.0.2
Acked-by on v2 1/1
#1 lore raw
Quoted 7 lines · Nate Case

From: Andrew Kilkenny <[email protected]>

This adds support for the dual-core MPC8572 processor. We have to support making SPR changes on each core. Also, since we can have multiple memory controllers sharing an interrupt, flag the interrupts with IRQF_SHARED.

Quoted 5 lines

---
drivers/edac/mpc85xx_edac.c | 28 +++++++++++++++++++++++-----

1 files changed, 23 insertions(+), 5 deletions(-)

Guys, is there an edac git tree or something to create patches against? I've got one I've been sitting on but it should be updated based on Nate's patch.

- k

#2 lore raw

There's an SVN+quilt tree via sourceforge for EDAC. I have asked Doug to push this patch upstream to the mm tree.

Quoted 21 lines · Kumar Gala
Quoted 7 lines · Nate Case

From: Andrew Kilkenny <[email protected]>

This adds support for the dual-core MPC8572 processor. We have to support making SPR changes on each core. Also, since we can have multiple memory controllers sharing an interrupt, flag the interrupts with IRQF_SHARED.

Quoted 5 lines

---
drivers/edac/mpc85xx_edac.c | 28 +++++++++++++++++++++++-----

1 files changed, 23 insertions(+), 5 deletions(-)

Guys, is there an edac git tree or something to create patches against? I've got one I've been sitting on but it should be updated based on Nate's patch.

- k

Signature · 6 lines
------------------------------------------------------
Dave Jiang
Software Engineer
MontaVista Software, Inc.
http://www.mvista.com
------------------------------------------------------
#3 lore raw

Dave Jiang <[email protected]> wrote: There's an SVN+quilt tree via sourceforge for EDAC. I have asked Doug to push this patch upstream to the mm tree.

Quoted 16 lines · Kumar Gala
Quoted 7 lines · Nate Case

From: Andrew Kilkenny

This adds support for the dual-core MPC8572 processor. We have to support making SPR changes on each core. Also, since we can have multiple memory controllers sharing an interrupt, flag the interrupts with IRQF_SHARED.

Quoted 5 lines
Signed-off-by Andrew Kilkenny
Signed-off-by Nate Case

---
drivers/edac/mpc85xx_edac.c | 28 +++++++++++++++++++++++-----

1 files changed, 23 insertions(+), 5 deletions(-)
Quoted 7 lines
Acked-by Kumar Gala

Guys, is there an edac git tree or something to create patches against? I've got one I've been sitting on but it should be updated based on Nate's patch.

- k

the SVN repos is

svn checkout https://bluesmoke.svn.sourceforge.net/svnroot/bluesmoke/trunk

the info page is

http://bluesmoke.sourceforge.net/

doug t

W1DUG