Thread (40 messages) 40 messages, 5 authors, 2011-07-25

Re: [PATCH 01/14] 83xx: consolidate init_IRQ functions

From: Kumar Gala <hidden>
Date: 2011-07-19 14:22:08

On Jul 19, 2011, at 3:53 AM, Dmitry Eremin-Solenikov wrote:
On mpc83xx platform nearly all _init_IRQ functions look alike. They =
either
just setup ipic, or setup ipic and QE PIC. Separate this to special =
functions
to be either referenced from ppc_md, or called from board file.
=20
Signed-off-by: Dmitry Eremin-Solenikov <redacted>
---
arch/powerpc/platforms/83xx/asp834x.c     |   20 +------------
arch/powerpc/platforms/83xx/km83xx.c      |   33 +--------------------
arch/powerpc/platforms/83xx/misc.c        |   46 =
+++++++++++++++++++++++++++++
quoted hunk ↗ jump to hunk
arch/powerpc/platforms/83xx/mpc830x_rdb.c |   18 +----------
arch/powerpc/platforms/83xx/mpc831x_rdb.c |   18 +----------
arch/powerpc/platforms/83xx/mpc832x_mds.c |   30 +------------------
arch/powerpc/platforms/83xx/mpc832x_rdb.c |   31 +-------------------
arch/powerpc/platforms/83xx/mpc834x_itx.c |   18 +----------
arch/powerpc/platforms/83xx/mpc834x_mds.c |   18 +----------
arch/powerpc/platforms/83xx/mpc836x_mds.c |   30 +------------------
arch/powerpc/platforms/83xx/mpc836x_rdk.c |   28 +-----------------
arch/powerpc/platforms/83xx/mpc837x_mds.c |   18 +----------
arch/powerpc/platforms/83xx/mpc837x_rdb.c |   18 +----------
arch/powerpc/platforms/83xx/mpc83xx.h     |    9 +++++
arch/powerpc/platforms/83xx/sbc834x.c     |   20 +------------
15 files changed, 68 insertions(+), 287 deletions(-)
=20
diff --git a/arch/powerpc/platforms/83xx/asp834x.c =
b/arch/powerpc/platforms/83xx/asp834x.c
quoted hunk ↗ jump to hunk
index aa0d84d..90b6c06 100644
--- a/arch/powerpc/platforms/83xx/asp834x.c
+++ b/arch/powerpc/platforms/83xx/asp834x.c
@@ -36,24 +36,6 @@ static void __init asp834x_setup_arch(void)
	mpc834x_usb_cfg();
}
=20
-static void __init asp834x_init_IRQ(void)
-{
-	struct device_node *np;
-
-	np =3D of_find_node_by_type(NULL, "ipic");
-	if (!np)
-		return;
-
-	ipic_init(np, 0);
-
-	of_node_put(np);
-
-	/* Initialize the default interrupt mapping priorities,
-	 * in case the boot rom changed something on us.
-	 */
-	ipic_set_default_priority();
-}
-
static struct __initdata of_device_id asp8347_ids[] =3D {
	{ .type =3D "soc", },
	{ .compatible =3D "soc", },
@@ -82,7 +64,7 @@ define_machine(asp834x) {
	.name			=3D "ASP8347E",
	.probe			=3D asp834x_probe,
	.setup_arch		=3D asp834x_setup_arch,
-	.init_IRQ		=3D asp834x_init_IRQ,
+	.init_IRQ		=3D mpc83xx_ipic_init_IRQ,
	.get_irq		=3D ipic_get_irq,
	.restart		=3D mpc83xx_restart,
	.time_init		=3D mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/km83xx.c =
b/arch/powerpc/platforms/83xx/km83xx.c
quoted hunk ↗ jump to hunk
index a2b9b9e..71ba863 100644
--- a/arch/powerpc/platforms/83xx/km83xx.c
+++ b/arch/powerpc/platforms/83xx/km83xx.c
@@ -140,37 +140,6 @@ static int __init =
kmeter_declare_of_platform_devices(void)
}
machine_device_initcall(mpc83xx_km, =
kmeter_declare_of_platform_devices);
=20
-static void __init mpc83xx_km_init_IRQ(void)
-{
-	struct device_node *np;
-
-	np =3D of_find_compatible_node(NULL, NULL, "fsl,pq2pro-pic");
-	if (!np) {
-		np =3D of_find_node_by_type(NULL, "ipic");
-		if (!np)
-			return;
-	}
-
-	ipic_init(np, 0);
-
-	/* Initialize the default interrupt mapping priorities,
-	 * in case the boot rom changed something on us.
-	 */
-	ipic_set_default_priority();
-	of_node_put(np);
-
-#ifdef CONFIG_QUICC_ENGINE
-	np =3D of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
-	if (!np) {
-		np =3D of_find_node_by_type(NULL, "qeic");
-		if (!np)
-			return;
-	}
-	qe_ic_init(np, 0, qe_ic_cascade_low_ipic, =
qe_ic_cascade_high_ipic);
quoted hunk ↗ jump to hunk
-	of_node_put(np);
-#endif				/* CONFIG_QUICC_ENGINE */
-}
-
/* list of the supported boards */
static char *board[] __initdata =3D {
	"Keymile,KMETER1",
@@ -198,7 +167,7 @@ define_machine(mpc83xx_km) {
	.name		=3D "mpc83xx-km-platform",
	.probe		=3D mpc83xx_km_probe,
	.setup_arch	=3D mpc83xx_km_setup_arch,
-	.init_IRQ	=3D mpc83xx_km_init_IRQ,
+	.init_IRQ	=3D mpc83xx_both_init_IRQ,
make this mpc83xx_ipic_and_qe_init_IRQ
quoted hunk ↗ jump to hunk
	.get_irq	=3D ipic_get_irq,
	.restart	=3D mpc83xx_restart,
	.time_init	=3D mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/misc.c =
b/arch/powerpc/platforms/83xx/misc.c
quoted hunk ↗ jump to hunk
index f01806c..95f2274 100644
--- a/arch/powerpc/platforms/83xx/misc.c
+++ b/arch/powerpc/platforms/83xx/misc.c
@@ -11,9 +11,12 @@
=20
#include <linux/stddef.h>
#include <linux/kernel.h>
+#include <linux/of_platform.h>
=20
#include <asm/io.h>
#include <asm/hw_irq.h>
+#include <asm/ipic.h>
+#include <asm/qe_ic.h>
#include <sysdev/fsl_soc.h>
=20
#include "mpc83xx.h"
@@ -65,3 +68,46 @@ long __init mpc83xx_time_init(void)
=20
	return 0;
}
+
+void __init mpc83xx_ipic_init_IRQ(void)
+{
+	struct device_node *np;
+
+	/* looking for fsl,pq2pro-pic which is asl compatible with =
fsl,ipic */
+	np =3D of_find_compatible_node(NULL, NULL, "fsl,ipic");
+	if (!np)
+		np =3D of_find_node_by_type(NULL, "ipic");
+	if (!np)
+		return;
+
+	ipic_init(np, 0);
+
+	of_node_put(np);
+
+	/* Initialize the default interrupt mapping priorities,
+	 * in case the boot rom changed something on us.
+	 */
+	ipic_set_default_priority();
+}
+
+#ifdef CONFIG_QUICC_ENGINE
+void __init mpc83xx_qe_init_IRQ(void)
+{
+	struct device_node *np;
+
+	np =3D of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
+	if (!np) {
+		np =3D of_find_node_by_type(NULL, "qeic");
+		if (!np)
+			return;
+	}
+	qe_ic_init(np, 0, qe_ic_cascade_low_ipic, =
qe_ic_cascade_high_ipic);
+	of_node_put(np);
+}
+
+void __init mpc83xx_both_init_IRQ(void)
make this mpc83xx_ipic_and_qe_init_IRQ
+{
+	mpc83xx_ipic_init_IRQ();
+	mpc83xx_qe_init_IRQ();
+}
+#endif /* CONFIG_QUICC_ENGINE */
- k
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help