* [PATCH 01/14] 83xx: consolidate init_IRQ functions
2011-07-19 8:53 [PATCH 00/14] Consolidation of 83xx/85xx board files Dmitry Eremin-Solenikov
@ 2011-07-19 8:53 ` Dmitry Eremin-Solenikov
2011-07-19 14:21 ` Kumar Gala
2011-07-19 8:53 ` [PATCH 02/14] 83xx: consolidate of_platform_bus_probe calls Dmitry Eremin-Solenikov
` (14 subsequent siblings)
15 siblings, 1 reply; 40+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-07-19 8:53 UTC (permalink / raw)
To: Linux PPC Development; +Cc: Paul Mackerras
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.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/powerpc/platforms/83xx/asp834x.c | 20 +------------
arch/powerpc/platforms/83xx/km83xx.c | 33 +--------------------
arch/powerpc/platforms/83xx/misc.c | 46 +++++++++++++++++++++++++++++
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(-)
diff --git a/arch/powerpc/platforms/83xx/asp834x.c b/arch/powerpc/platforms/83xx/asp834x.c
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();
}
-static void __init asp834x_init_IRQ(void)
-{
- struct device_node *np;
-
- np = 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[] = {
{ .type = "soc", },
{ .compatible = "soc", },
@@ -82,7 +64,7 @@ define_machine(asp834x) {
.name = "ASP8347E",
.probe = asp834x_probe,
.setup_arch = asp834x_setup_arch,
- .init_IRQ = asp834x_init_IRQ,
+ .init_IRQ = mpc83xx_ipic_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
.time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/km83xx.c b/arch/powerpc/platforms/83xx/km83xx.c
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);
-static void __init mpc83xx_km_init_IRQ(void)
-{
- struct device_node *np;
-
- np = of_find_compatible_node(NULL, NULL, "fsl,pq2pro-pic");
- if (!np) {
- np = 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 = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
- if (!np) {
- np = 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);
-#endif /* CONFIG_QUICC_ENGINE */
-}
-
/* list of the supported boards */
static char *board[] __initdata = {
"Keymile,KMETER1",
@@ -198,7 +167,7 @@ define_machine(mpc83xx_km) {
.name = "mpc83xx-km-platform",
.probe = mpc83xx_km_probe,
.setup_arch = mpc83xx_km_setup_arch,
- .init_IRQ = mpc83xx_km_init_IRQ,
+ .init_IRQ = mpc83xx_both_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
.time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/misc.c b/arch/powerpc/platforms/83xx/misc.c
index f01806c..95f2274 100644
--- a/arch/powerpc/platforms/83xx/misc.c
+++ b/arch/powerpc/platforms/83xx/misc.c
@@ -11,9 +11,12 @@
#include <linux/stddef.h>
#include <linux/kernel.h>
+#include <linux/of_platform.h>
#include <asm/io.h>
#include <asm/hw_irq.h>
+#include <asm/ipic.h>
+#include <asm/qe_ic.h>
#include <sysdev/fsl_soc.h>
#include "mpc83xx.h"
@@ -65,3 +68,46 @@ long __init mpc83xx_time_init(void)
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 = of_find_compatible_node(NULL, NULL, "fsl,ipic");
+ if (!np)
+ np = 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 = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
+ if (!np) {
+ np = 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)
+{
+ mpc83xx_ipic_init_IRQ();
+ mpc83xx_qe_init_IRQ();
+}
+#endif /* CONFIG_QUICC_ENGINE */
diff --git a/arch/powerpc/platforms/83xx/mpc830x_rdb.c b/arch/powerpc/platforms/83xx/mpc830x_rdb.c
index d0c4e15..b453c15 100644
--- a/arch/powerpc/platforms/83xx/mpc830x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc830x_rdb.c
@@ -41,22 +41,6 @@ static void __init mpc830x_rdb_setup_arch(void)
mpc831x_usb_cfg();
}
-static void __init mpc830x_rdb_init_IRQ(void)
-{
- struct device_node *np;
-
- np = 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();
-}
-
static const char *board[] __initdata = {
"MPC8308RDB",
"fsl,mpc8308rdb",
@@ -89,7 +73,7 @@ define_machine(mpc830x_rdb) {
.name = "MPC830x RDB",
.probe = mpc830x_rdb_probe,
.setup_arch = mpc830x_rdb_setup_arch,
- .init_IRQ = mpc830x_rdb_init_IRQ,
+ .init_IRQ = mpc83xx_ipic_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
.time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc831x_rdb.c b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
index f859ead..386bde8 100644
--- a/arch/powerpc/platforms/83xx/mpc831x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
@@ -44,22 +44,6 @@ static void __init mpc831x_rdb_setup_arch(void)
mpc831x_usb_cfg();
}
-static void __init mpc831x_rdb_init_IRQ(void)
-{
- struct device_node *np;
-
- np = 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();
-}
-
static const char *board[] __initdata = {
"MPC8313ERDB",
"fsl,mpc8315erdb",
@@ -92,7 +76,7 @@ define_machine(mpc831x_rdb) {
.name = "MPC831x RDB",
.probe = mpc831x_rdb_probe,
.setup_arch = mpc831x_rdb_setup_arch,
- .init_IRQ = mpc831x_rdb_init_IRQ,
+ .init_IRQ = mpc83xx_ipic_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
.time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index ec0b401b..85c120c 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -119,34 +119,6 @@ static int __init mpc832x_declare_of_platform_devices(void)
}
machine_device_initcall(mpc832x_mds, mpc832x_declare_of_platform_devices);
-static void __init mpc832x_sys_init_IRQ(void)
-{
- struct device_node *np;
-
- np = 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 = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
- if (!np) {
- np = 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);
-#endif /* CONFIG_QUICC_ENGINE */
-}
-
/*
* Called very early, MMU is off, device-tree isn't unflattened
*/
@@ -161,7 +133,7 @@ define_machine(mpc832x_mds) {
.name = "MPC832x MDS",
.probe = mpc832x_sys_probe,
.setup_arch = mpc832x_sys_setup_arch,
- .init_IRQ = mpc832x_sys_init_IRQ,
+ .init_IRQ = mpc83xx_both_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
.time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index 17f9974..03d015d 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -236,35 +236,6 @@ static int __init mpc832x_declare_of_platform_devices(void)
}
machine_device_initcall(mpc832x_rdb, mpc832x_declare_of_platform_devices);
-static void __init mpc832x_rdb_init_IRQ(void)
-{
-
- struct device_node *np;
-
- np = 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 = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
- if (!np) {
- np = 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);
-#endif /* CONFIG_QUICC_ENGINE */
-}
-
/*
* Called very early, MMU is off, device-tree isn't unflattened
*/
@@ -279,7 +250,7 @@ define_machine(mpc832x_rdb) {
.name = "MPC832x RDB",
.probe = mpc832x_rdb_probe,
.setup_arch = mpc832x_rdb_setup_arch,
- .init_IRQ = mpc832x_rdb_init_IRQ,
+ .init_IRQ = mpc83xx_both_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
.time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c
index 81e44fa..2e2dc73 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_itx.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c
@@ -74,22 +74,6 @@ static void __init mpc834x_itx_setup_arch(void)
mpc834x_usb_cfg();
}
-static void __init mpc834x_itx_init_IRQ(void)
-{
- struct device_node *np;
-
- np = 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();
-}
-
/*
* Called very early, MMU is off, device-tree isn't unflattened
*/
@@ -104,7 +88,7 @@ define_machine(mpc834x_itx) {
.name = "MPC834x ITX",
.probe = mpc834x_itx_probe,
.setup_arch = mpc834x_itx_setup_arch,
- .init_IRQ = mpc834x_itx_init_IRQ,
+ .init_IRQ = mpc83xx_ipic_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
.time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc834x_mds.c b/arch/powerpc/platforms/83xx/mpc834x_mds.c
index d0a634b..94702e6 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_mds.c
@@ -92,22 +92,6 @@ static void __init mpc834x_mds_setup_arch(void)
mpc834xemds_usb_cfg();
}
-static void __init mpc834x_mds_init_IRQ(void)
-{
- struct device_node *np;
-
- np = 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();
-}
-
static struct of_device_id mpc834x_ids[] = {
{ .type = "soc", },
{ .compatible = "soc", },
@@ -137,7 +121,7 @@ define_machine(mpc834x_mds) {
.name = "MPC834x MDS",
.probe = mpc834x_mds_probe,
.setup_arch = mpc834x_mds_setup_arch,
- .init_IRQ = mpc834x_mds_init_IRQ,
+ .init_IRQ = mpc83xx_ipic_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
.time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c
index 09e9d6f..a968d78 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
@@ -226,34 +226,6 @@ err:
machine_arch_initcall(mpc836x_mds, mpc836x_usb_cfg);
#endif /* CONFIG_QE_USB */
-static void __init mpc836x_mds_init_IRQ(void)
-{
- struct device_node *np;
-
- np = 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 = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
- if (!np) {
- np = 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);
-#endif /* CONFIG_QUICC_ENGINE */
-}
-
/*
* Called very early, MMU is off, device-tree isn't unflattened
*/
@@ -268,7 +240,7 @@ define_machine(mpc836x_mds) {
.name = "MPC836x MDS",
.probe = mpc836x_mds_probe,
.setup_arch = mpc836x_mds_setup_arch,
- .init_IRQ = mpc836x_mds_init_IRQ,
+ .init_IRQ = mpc83xx_both_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
.time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc836x_rdk.c b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
index b0090aa..e4d3a75 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_rdk.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
@@ -56,32 +56,6 @@ static void __init mpc836x_rdk_setup_arch(void)
#endif
}
-static void __init mpc836x_rdk_init_IRQ(void)
-{
- struct device_node *np;
-
- np = of_find_compatible_node(NULL, NULL, "fsl,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 = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
- if (!np)
- return;
-
- qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic);
- of_node_put(np);
-#endif
-}
-
/*
* Called very early, MMU is off, device-tree isn't unflattened.
*/
@@ -96,7 +70,7 @@ define_machine(mpc836x_rdk) {
.name = "MPC836x RDK",
.probe = mpc836x_rdk_probe,
.setup_arch = mpc836x_rdk_setup_arch,
- .init_IRQ = mpc836x_rdk_init_IRQ,
+ .init_IRQ = mpc83xx_both_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
.time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc837x_mds.c b/arch/powerpc/platforms/83xx/mpc837x_mds.c
index 8306832..3be7f3a 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_mds.c
@@ -112,22 +112,6 @@ static int __init mpc837x_declare_of_platform_devices(void)
}
machine_device_initcall(mpc837x_mds, mpc837x_declare_of_platform_devices);
-static void __init mpc837x_mds_init_IRQ(void)
-{
- struct device_node *np;
-
- np = of_find_compatible_node(NULL, NULL, "fsl,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();
-}
-
/*
* Called very early, MMU is off, device-tree isn't unflattened
*/
@@ -142,7 +126,7 @@ define_machine(mpc837x_mds) {
.name = "MPC837x MDS",
.probe = mpc837x_mds_probe,
.setup_arch = mpc837x_mds_setup_arch,
- .init_IRQ = mpc837x_mds_init_IRQ,
+ .init_IRQ = mpc83xx_ipic_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
.time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc837x_rdb.c b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
index 7bafbf2..eebfd81 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
@@ -85,22 +85,6 @@ static int __init mpc837x_declare_of_platform_devices(void)
}
machine_device_initcall(mpc837x_rdb, mpc837x_declare_of_platform_devices);
-static void __init mpc837x_rdb_init_IRQ(void)
-{
- struct device_node *np;
-
- np = of_find_compatible_node(NULL, NULL, "fsl,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();
-}
-
static const char *board[] __initdata = {
"fsl,mpc8377rdb",
"fsl,mpc8378rdb",
@@ -121,7 +105,7 @@ define_machine(mpc837x_rdb) {
.name = "MPC837x RDB/WLAN",
.probe = mpc837x_rdb_probe,
.setup_arch = mpc837x_rdb_setup_arch,
- .init_IRQ = mpc837x_rdb_init_IRQ,
+ .init_IRQ = mpc83xx_ipic_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
.time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc83xx.h b/arch/powerpc/platforms/83xx/mpc83xx.h
index 82a4345..9d77ddb 100644
--- a/arch/powerpc/platforms/83xx/mpc83xx.h
+++ b/arch/powerpc/platforms/83xx/mpc83xx.h
@@ -70,5 +70,14 @@ extern long mpc83xx_time_init(void);
extern int mpc837x_usb_cfg(void);
extern int mpc834x_usb_cfg(void);
extern int mpc831x_usb_cfg(void);
+extern void mpc83xx_ipic_init_IRQ(void);
+#ifdef CONFIG_QUICC_ENGINE
+extern void mpc83xx_qe_init_IRQ(void);
+extern void mpc83xx_both_init_IRQ(void);
+#else
+static inline void __init mpc83xx_qe_init_IRQ(void) {}
+#define mpc83xx_both_init_IRQ mpc83xx_ipic_init_IRQ
+#endif /* CONFIG_QUICC_ENGINE */
+
#endif /* __MPC83XX_H__ */
diff --git a/arch/powerpc/platforms/83xx/sbc834x.c b/arch/powerpc/platforms/83xx/sbc834x.c
index 49023db..205a28d 100644
--- a/arch/powerpc/platforms/83xx/sbc834x.c
+++ b/arch/powerpc/platforms/83xx/sbc834x.c
@@ -62,24 +62,6 @@ static void __init sbc834x_setup_arch(void)
}
-static void __init sbc834x_init_IRQ(void)
-{
- struct device_node *np;
-
- np = 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);
-}
-
static struct __initdata of_device_id sbc834x_ids[] = {
{ .type = "soc", },
{ .compatible = "soc", },
@@ -109,7 +91,7 @@ define_machine(sbc834x) {
.name = "SBC834x",
.probe = sbc834x_probe,
.setup_arch = sbc834x_setup_arch,
- .init_IRQ = sbc834x_init_IRQ,
+ .init_IRQ = mpc83xx_ipic_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
.time_init = mpc83xx_time_init,
--
1.7.2.5
^ permalink raw reply related [flat|nested] 40+ messages in thread
* Re: [PATCH 01/14] 83xx: consolidate init_IRQ functions
2011-07-19 8:53 ` [PATCH 01/14] 83xx: consolidate init_IRQ functions Dmitry Eremin-Solenikov
@ 2011-07-19 14:21 ` Kumar Gala
0 siblings, 0 replies; 40+ messages in thread
From: Kumar Gala @ 2011-07-19 14:21 UTC (permalink / raw)
To: Dmitry Eremin-Solenikov; +Cc: Linux PPC Development, Paul Mackerras
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 <dbaryshkov@gmail.com>
> ---
> arch/powerpc/platforms/83xx/asp834x.c | 20 +------------
> arch/powerpc/platforms/83xx/km83xx.c | 33 +--------------------
> arch/powerpc/platforms/83xx/misc.c | 46 =
+++++++++++++++++++++++++++++
> 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
> 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
> 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);
> - 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
> .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
> 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
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 02/14] 83xx: consolidate of_platform_bus_probe calls
2011-07-19 8:53 [PATCH 00/14] Consolidation of 83xx/85xx board files Dmitry Eremin-Solenikov
2011-07-19 8:53 ` [PATCH 01/14] 83xx: consolidate init_IRQ functions Dmitry Eremin-Solenikov
@ 2011-07-19 8:53 ` Dmitry Eremin-Solenikov
2011-07-19 8:53 ` [PATCH 03/14] mpc8349emitx: mark localbus as compatible with simple-bus Dmitry Eremin-Solenikov
` (13 subsequent siblings)
15 siblings, 0 replies; 40+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-07-19 8:53 UTC (permalink / raw)
To: Linux PPC Development; +Cc: Paul Mackerras
83xx board files have a lot of duplication in
*_declare_of_platform_devices() functions. Merge that into a single
function common to most of the boards.
The only leftover is mpc834x_itx.c board file which explicitly asks for
fsl,pq2pro-localbus, as corresponding bindings don't provide
"simple-bus" compatibility in localbus node.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/powerpc/platforms/83xx/asp834x.c | 15 +--------------
arch/powerpc/platforms/83xx/km83xx.c | 18 +-----------------
arch/powerpc/platforms/83xx/misc.c | 17 +++++++++++++++++
arch/powerpc/platforms/83xx/mpc830x_rdb.c | 13 +------------
arch/powerpc/platforms/83xx/mpc831x_rdb.c | 14 +-------------
arch/powerpc/platforms/83xx/mpc832x_mds.c | 18 +-----------------
arch/powerpc/platforms/83xx/mpc832x_rdb.c | 18 +-----------------
arch/powerpc/platforms/83xx/mpc834x_itx.c | 3 +--
arch/powerpc/platforms/83xx/mpc834x_mds.c | 15 +--------------
arch/powerpc/platforms/83xx/mpc836x_mds.c | 18 +-----------------
arch/powerpc/platforms/83xx/mpc836x_rdk.c | 11 +----------
arch/powerpc/platforms/83xx/mpc837x_mds.c | 17 +----------------
arch/powerpc/platforms/83xx/mpc837x_rdb.c | 18 +-----------------
arch/powerpc/platforms/83xx/mpc83xx.h | 1 +
arch/powerpc/platforms/83xx/sbc834x.c | 15 +--------------
15 files changed, 31 insertions(+), 180 deletions(-)
diff --git a/arch/powerpc/platforms/83xx/asp834x.c b/arch/powerpc/platforms/83xx/asp834x.c
index 90b6c06..464ea8e 100644
--- a/arch/powerpc/platforms/83xx/asp834x.c
+++ b/arch/powerpc/platforms/83xx/asp834x.c
@@ -36,20 +36,7 @@ static void __init asp834x_setup_arch(void)
mpc834x_usb_cfg();
}
-static struct __initdata of_device_id asp8347_ids[] = {
- { .type = "soc", },
- { .compatible = "soc", },
- { .compatible = "simple-bus", },
- { .compatible = "gianfar", },
- {},
-};
-
-static int __init asp8347_declare_of_platform_devices(void)
-{
- of_platform_bus_probe(NULL, asp8347_ids, NULL);
- return 0;
-}
-machine_device_initcall(asp834x, asp8347_declare_of_platform_devices);
+machine_device_initcall(asp834x, mpc83xx_declare_of_platform_devices);
/*
* Called very early, MMU is off, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/83xx/km83xx.c b/arch/powerpc/platforms/83xx/km83xx.c
index 71ba863..b9aaa50 100644
--- a/arch/powerpc/platforms/83xx/km83xx.c
+++ b/arch/powerpc/platforms/83xx/km83xx.c
@@ -122,23 +122,7 @@ static void __init mpc83xx_km_setup_arch(void)
#endif /* CONFIG_QUICC_ENGINE */
}
-static struct of_device_id kmpbec83xx_ids[] = {
- { .type = "soc", },
- { .compatible = "soc", },
- { .compatible = "simple-bus", },
- { .type = "qe", },
- { .compatible = "fsl,qe", },
- {},
-};
-
-static int __init kmeter_declare_of_platform_devices(void)
-{
- /* Publish the QE devices */
- of_platform_bus_probe(NULL, kmpbec83xx_ids, NULL);
-
- return 0;
-}
-machine_device_initcall(mpc83xx_km, kmeter_declare_of_platform_devices);
+machine_device_initcall(mpc83xx_km, mpc83xx_declare_of_platform_devices);
/* list of the supported boards */
static char *board[] __initdata = {
diff --git a/arch/powerpc/platforms/83xx/misc.c b/arch/powerpc/platforms/83xx/misc.c
index 95f2274..cd65f5a 100644
--- a/arch/powerpc/platforms/83xx/misc.c
+++ b/arch/powerpc/platforms/83xx/misc.c
@@ -111,3 +111,20 @@ void __init mpc83xx_both_init_IRQ(void)
mpc83xx_qe_init_IRQ();
}
#endif /* CONFIG_QUICC_ENGINE */
+
+static struct of_device_id __initdata of_bus_ids[] = {
+ { .type = "soc", },
+ { .compatible = "soc", },
+ { .compatible = "simple-bus" },
+ { .compatible = "gianfar" },
+ { .compatible = "gpio-leds", },
+ { .type = "qe", },
+ { .compatible = "fsl,qe", },
+ {},
+};
+
+int __init mpc83xx_declare_of_platform_devices(void)
+{
+ of_platform_bus_probe(NULL, of_bus_ids, NULL);
+ return 0;
+}
diff --git a/arch/powerpc/platforms/83xx/mpc830x_rdb.c b/arch/powerpc/platforms/83xx/mpc830x_rdb.c
index b453c15..ef595f1 100644
--- a/arch/powerpc/platforms/83xx/mpc830x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc830x_rdb.c
@@ -56,18 +56,7 @@ static int __init mpc830x_rdb_probe(void)
return of_flat_dt_match(of_get_flat_dt_root(), board);
}
-static struct of_device_id __initdata of_bus_ids[] = {
- { .compatible = "simple-bus" },
- { .compatible = "gianfar" },
- {},
-};
-
-static int __init declare_of_platform_devices(void)
-{
- of_platform_bus_probe(NULL, of_bus_ids, NULL);
- return 0;
-}
-machine_device_initcall(mpc830x_rdb, declare_of_platform_devices);
+machine_device_initcall(mpc830x_rdb, mpc83xx_declare_of_platform_devices);
define_machine(mpc830x_rdb) {
.name = "MPC830x RDB",
diff --git a/arch/powerpc/platforms/83xx/mpc831x_rdb.c b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
index 386bde8..ce87406 100644
--- a/arch/powerpc/platforms/83xx/mpc831x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
@@ -58,19 +58,7 @@ static int __init mpc831x_rdb_probe(void)
return of_flat_dt_match(of_get_flat_dt_root(), board);
}
-static struct of_device_id __initdata of_bus_ids[] = {
- { .compatible = "simple-bus" },
- { .compatible = "gianfar" },
- { .compatible = "gpio-leds", },
- {},
-};
-
-static int __init declare_of_platform_devices(void)
-{
- of_platform_bus_probe(NULL, of_bus_ids, NULL);
- return 0;
-}
-machine_device_initcall(mpc831x_rdb, declare_of_platform_devices);
+machine_device_initcall(mpc831x_rdb, mpc83xx_declare_of_platform_devices);
define_machine(mpc831x_rdb) {
.name = "MPC831x RDB",
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index 85c120c..8ee1440 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -101,23 +101,7 @@ static void __init mpc832x_sys_setup_arch(void)
#endif /* CONFIG_QUICC_ENGINE */
}
-static struct of_device_id mpc832x_ids[] = {
- { .type = "soc", },
- { .compatible = "soc", },
- { .compatible = "simple-bus", },
- { .type = "qe", },
- { .compatible = "fsl,qe", },
- {},
-};
-
-static int __init mpc832x_declare_of_platform_devices(void)
-{
- /* Publish the QE devices */
- of_platform_bus_probe(NULL, mpc832x_ids, NULL);
-
- return 0;
-}
-machine_device_initcall(mpc832x_mds, mpc832x_declare_of_platform_devices);
+machine_device_initcall(mpc832x_mds, mpc83xx_declare_of_platform_devices);
/*
* Called very early, MMU is off, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index 03d015d..c10d0c4 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -218,23 +218,7 @@ static void __init mpc832x_rdb_setup_arch(void)
#endif /* CONFIG_QUICC_ENGINE */
}
-static struct of_device_id mpc832x_ids[] = {
- { .type = "soc", },
- { .compatible = "soc", },
- { .compatible = "simple-bus", },
- { .type = "qe", },
- { .compatible = "fsl,qe", },
- {},
-};
-
-static int __init mpc832x_declare_of_platform_devices(void)
-{
- /* Publish the QE devices */
- of_platform_bus_probe(NULL, mpc832x_ids, NULL);
-
- return 0;
-}
-machine_device_initcall(mpc832x_rdb, mpc832x_declare_of_platform_devices);
+machine_device_initcall(mpc832x_rdb, mpc83xx_declare_of_platform_devices);
/*
* Called very early, MMU is off, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c
index 2e2dc73..c853f66 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_itx.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c
@@ -41,13 +41,12 @@
static struct of_device_id __initdata mpc834x_itx_ids[] = {
{ .compatible = "fsl,pq2pro-localbus", },
- { .compatible = "simple-bus", },
- { .compatible = "gianfar", },
{},
};
static int __init mpc834x_itx_declare_of_platform_devices(void)
{
+ mpc83xx_declare_of_platform_devices();
return of_platform_bus_probe(NULL, mpc834x_itx_ids, NULL);
}
machine_device_initcall(mpc834x_itx, mpc834x_itx_declare_of_platform_devices);
diff --git a/arch/powerpc/platforms/83xx/mpc834x_mds.c b/arch/powerpc/platforms/83xx/mpc834x_mds.c
index 94702e6..381e94e 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_mds.c
@@ -92,20 +92,7 @@ static void __init mpc834x_mds_setup_arch(void)
mpc834xemds_usb_cfg();
}
-static struct of_device_id mpc834x_ids[] = {
- { .type = "soc", },
- { .compatible = "soc", },
- { .compatible = "simple-bus", },
- { .compatible = "gianfar", },
- {},
-};
-
-static int __init mpc834x_declare_of_platform_devices(void)
-{
- of_platform_bus_probe(NULL, mpc834x_ids, NULL);
- return 0;
-}
-machine_device_initcall(mpc834x_mds, mpc834x_declare_of_platform_devices);
+machine_device_initcall(mpc834x_mds, mpc83xx_declare_of_platform_devices);
/*
* Called very early, MMU is off, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c
index a968d78..1b90701 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
@@ -144,23 +144,7 @@ static void __init mpc836x_mds_setup_arch(void)
#endif /* CONFIG_QUICC_ENGINE */
}
-static struct of_device_id mpc836x_ids[] = {
- { .type = "soc", },
- { .compatible = "soc", },
- { .compatible = "simple-bus", },
- { .type = "qe", },
- { .compatible = "fsl,qe", },
- {},
-};
-
-static int __init mpc836x_declare_of_platform_devices(void)
-{
- /* Publish the QE devices */
- of_platform_bus_probe(NULL, mpc836x_ids, NULL);
-
- return 0;
-}
-machine_device_initcall(mpc836x_mds, mpc836x_declare_of_platform_devices);
+machine_device_initcall(mpc836x_mds, mpc83xx_declare_of_platform_devices);
#ifdef CONFIG_QE_USB
static int __init mpc836x_usb_cfg(void)
diff --git a/arch/powerpc/platforms/83xx/mpc836x_rdk.c b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
index e4d3a75..2563174 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_rdk.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
@@ -27,16 +27,7 @@
#include "mpc83xx.h"
-static struct of_device_id __initdata mpc836x_rdk_ids[] = {
- { .compatible = "simple-bus", },
- {},
-};
-
-static int __init mpc836x_rdk_declare_of_platform_devices(void)
-{
- return of_platform_bus_probe(NULL, mpc836x_rdk_ids, NULL);
-}
-machine_device_initcall(mpc836x_rdk, mpc836x_rdk_declare_of_platform_devices);
+machine_device_initcall(mpc836x_rdk, mpc83xx_declare_of_platform_devices);
static void __init mpc836x_rdk_setup_arch(void)
{
diff --git a/arch/powerpc/platforms/83xx/mpc837x_mds.c b/arch/powerpc/platforms/83xx/mpc837x_mds.c
index 3be7f3a..7463183 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_mds.c
@@ -95,22 +95,7 @@ static void __init mpc837x_mds_setup_arch(void)
mpc837xmds_usb_cfg();
}
-static struct of_device_id mpc837x_ids[] = {
- { .type = "soc", },
- { .compatible = "soc", },
- { .compatible = "simple-bus", },
- { .compatible = "gianfar", },
- {},
-};
-
-static int __init mpc837x_declare_of_platform_devices(void)
-{
- /* Publish platform_device */
- of_platform_bus_probe(NULL, mpc837x_ids, NULL);
-
- return 0;
-}
-machine_device_initcall(mpc837x_mds, mpc837x_declare_of_platform_devices);
+machine_device_initcall(mpc837x_mds, mpc83xx_declare_of_platform_devices);
/*
* Called very early, MMU is off, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/83xx/mpc837x_rdb.c b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
index eebfd81..a4a5336 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
@@ -67,23 +67,7 @@ static void __init mpc837x_rdb_setup_arch(void)
mpc837x_rdb_sd_cfg();
}
-static struct of_device_id mpc837x_ids[] = {
- { .type = "soc", },
- { .compatible = "soc", },
- { .compatible = "simple-bus", },
- { .compatible = "gianfar", },
- { .compatible = "gpio-leds", },
- {},
-};
-
-static int __init mpc837x_declare_of_platform_devices(void)
-{
- /* Publish platform_device */
- of_platform_bus_probe(NULL, mpc837x_ids, NULL);
-
- return 0;
-}
-machine_device_initcall(mpc837x_rdb, mpc837x_declare_of_platform_devices);
+machine_device_initcall(mpc837x_rdb, mpc83xx_declare_of_platform_devices);
static const char *board[] __initdata = {
"fsl,mpc8377rdb",
diff --git a/arch/powerpc/platforms/83xx/mpc83xx.h b/arch/powerpc/platforms/83xx/mpc83xx.h
index 9d77ddb..039ffa3 100644
--- a/arch/powerpc/platforms/83xx/mpc83xx.h
+++ b/arch/powerpc/platforms/83xx/mpc83xx.h
@@ -79,5 +79,6 @@ static inline void __init mpc83xx_qe_init_IRQ(void) {}
#define mpc83xx_both_init_IRQ mpc83xx_ipic_init_IRQ
#endif /* CONFIG_QUICC_ENGINE */
+extern int mpc83xx_declare_of_platform_devices(void);
#endif /* __MPC83XX_H__ */
diff --git a/arch/powerpc/platforms/83xx/sbc834x.c b/arch/powerpc/platforms/83xx/sbc834x.c
index 205a28d..3d98bd9 100644
--- a/arch/powerpc/platforms/83xx/sbc834x.c
+++ b/arch/powerpc/platforms/83xx/sbc834x.c
@@ -62,20 +62,7 @@ static void __init sbc834x_setup_arch(void)
}
-static struct __initdata of_device_id sbc834x_ids[] = {
- { .type = "soc", },
- { .compatible = "soc", },
- { .compatible = "simple-bus", },
- { .compatible = "gianfar", },
- {},
-};
-
-static int __init sbc834x_declare_of_platform_devices(void)
-{
- of_platform_bus_probe(NULL, sbc834x_ids, NULL);
- return 0;
-}
-machine_device_initcall(sbc834x, sbc834x_declare_of_platform_devices);
+machine_device_initcall(sbc834x, mpc83xx_declare_of_platform_devices);
/*
* Called very early, MMU is off, device-tree isn't unflattened
--
1.7.2.5
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 03/14] mpc8349emitx: mark localbus as compatible with simple-bus
2011-07-19 8:53 [PATCH 00/14] Consolidation of 83xx/85xx board files Dmitry Eremin-Solenikov
2011-07-19 8:53 ` [PATCH 01/14] 83xx: consolidate init_IRQ functions Dmitry Eremin-Solenikov
2011-07-19 8:53 ` [PATCH 02/14] 83xx: consolidate of_platform_bus_probe calls Dmitry Eremin-Solenikov
@ 2011-07-19 8:53 ` Dmitry Eremin-Solenikov
2011-07-19 14:23 ` Kumar Gala
2011-07-19 8:53 ` [PATCH 04/14] 83xx/mpc834x_itx: drop pq2pro-localbus-specific code Dmitry Eremin-Solenikov
` (12 subsequent siblings)
15 siblings, 1 reply; 40+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-07-19 8:53 UTC (permalink / raw)
To: Linux PPC Development; +Cc: Paul Mackerras
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/powerpc/boot/dts/mpc8349emitx.dts | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/boot/dts/mpc8349emitx.dts b/arch/powerpc/boot/dts/mpc8349emitx.dts
index b53d1df..505dc84 100644
--- a/arch/powerpc/boot/dts/mpc8349emitx.dts
+++ b/arch/powerpc/boot/dts/mpc8349emitx.dts
@@ -390,7 +390,8 @@
#address-cells = <2>;
#size-cells = <1>;
compatible = "fsl,mpc8349e-localbus",
- "fsl,pq2pro-localbus";
+ "fsl,pq2pro-localbus",
+ "simple-bus";
reg = <0xe0005000 0xd8>;
ranges = <0x0 0x0 0xfe000000 0x1000000 /* flash */
0x1 0x0 0xf8000000 0x20000 /* VSC 7385 */
--
1.7.2.5
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 04/14] 83xx/mpc834x_itx: drop pq2pro-localbus-specific code
2011-07-19 8:53 [PATCH 00/14] Consolidation of 83xx/85xx board files Dmitry Eremin-Solenikov
` (2 preceding siblings ...)
2011-07-19 8:53 ` [PATCH 03/14] mpc8349emitx: mark localbus as compatible with simple-bus Dmitry Eremin-Solenikov
@ 2011-07-19 8:53 ` Dmitry Eremin-Solenikov
2011-07-19 16:55 ` Scott Wood
2011-07-19 8:53 ` [PATCH 05/14] 83xx: headers cleanup Dmitry Eremin-Solenikov
` (11 subsequent siblings)
15 siblings, 1 reply; 40+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-07-19 8:53 UTC (permalink / raw)
To: Linux PPC Development; +Cc: Paul Mackerras
As localbus on mpc8349e-mitx now provides simple-bus compatibility, we
can drop code asking for pq2pro-localbus devices on mpc834x_itx boards.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/powerpc/platforms/83xx/mpc834x_itx.c | 12 +-----------
1 files changed, 1 insertions(+), 11 deletions(-)
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c
index c853f66..d9ea7b7 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_itx.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c
@@ -39,17 +39,7 @@
#include "mpc83xx.h"
-static struct of_device_id __initdata mpc834x_itx_ids[] = {
- { .compatible = "fsl,pq2pro-localbus", },
- {},
-};
-
-static int __init mpc834x_itx_declare_of_platform_devices(void)
-{
- mpc83xx_declare_of_platform_devices();
- return of_platform_bus_probe(NULL, mpc834x_itx_ids, NULL);
-}
-machine_device_initcall(mpc834x_itx, mpc834x_itx_declare_of_platform_devices);
+machine_device_initcall(mpc834x_itx, mpc83xx_declare_of_platform_devices);
/* ************************************************************************
*
--
1.7.2.5
^ permalink raw reply related [flat|nested] 40+ messages in thread
* Re: [PATCH 04/14] 83xx/mpc834x_itx: drop pq2pro-localbus-specific code
2011-07-19 8:53 ` [PATCH 04/14] 83xx/mpc834x_itx: drop pq2pro-localbus-specific code Dmitry Eremin-Solenikov
@ 2011-07-19 16:55 ` Scott Wood
2011-07-22 19:41 ` Dmitry Eremin-Solenikov
0 siblings, 1 reply; 40+ messages in thread
From: Scott Wood @ 2011-07-19 16:55 UTC (permalink / raw)
To: Dmitry Eremin-Solenikov; +Cc: Paul Mackerras, Linux PPC Development
On Tue, 19 Jul 2011 12:53:41 +0400
Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> wrote:
> As localbus on mpc8349e-mitx now provides simple-bus compatibility, we
> can drop code asking for pq2pro-localbus devices on mpc834x_itx boards.
Do we have a good reason for breaking compatibility with older device trees?
-Scott
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 04/14] 83xx/mpc834x_itx: drop pq2pro-localbus-specific code
2011-07-19 16:55 ` Scott Wood
@ 2011-07-22 19:41 ` Dmitry Eremin-Solenikov
0 siblings, 0 replies; 40+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-07-22 19:41 UTC (permalink / raw)
To: Scott Wood; +Cc: Paul Mackerras, Linux PPC Development
On 7/19/11, Scott Wood <scottwood@freescale.com> wrote:
> On Tue, 19 Jul 2011 12:53:41 +0400
> Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> wrote:
>
>> As localbus on mpc8349e-mitx now provides simple-bus compatibility, we
>> can drop code asking for pq2pro-localbus devices on mpc834x_itx boards.
>
> Do we have a good reason for breaking compatibility with older device trees?
Hmm. No real reason if you look from this POV. Just didn't thought in
this direction.
BTW: Documentation/devicetree/fsl/lbc.txt doesn't talk at all about "compatible"
property. Maybe one can add there something (like asking to add simple-bus
for new platforms). I feel myself too unexperienced to fix that.
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 05/14] 83xx: headers cleanup
2011-07-19 8:53 [PATCH 00/14] Consolidation of 83xx/85xx board files Dmitry Eremin-Solenikov
` (3 preceding siblings ...)
2011-07-19 8:53 ` [PATCH 04/14] 83xx/mpc834x_itx: drop pq2pro-localbus-specific code Dmitry Eremin-Solenikov
@ 2011-07-19 8:53 ` Dmitry Eremin-Solenikov
2011-07-19 8:53 ` [PATCH 06/14] 85xx/sbc8560: correct compilation if CONFIG_PHYS_ADDR_T_64BIT is set Dmitry Eremin-Solenikov
` (10 subsequent siblings)
15 siblings, 0 replies; 40+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-07-19 8:53 UTC (permalink / raw)
To: Linux PPC Development; +Cc: Paul Mackerras
Drop lots of unused headers after board files merge/splitup
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/powerpc/platforms/83xx/asp834x.c | 2 -
arch/powerpc/platforms/83xx/km83xx.c | 24 +------------------
arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c | 5 ----
arch/powerpc/platforms/83xx/misc.c | 1 -
arch/powerpc/platforms/83xx/mpc830x_rdb.c | 5 +--
arch/powerpc/platforms/83xx/mpc831x_rdb.c | 2 -
arch/powerpc/platforms/83xx/mpc832x_mds.c | 30 ------------------------
arch/powerpc/platforms/83xx/mpc832x_rdb.c | 11 --------
arch/powerpc/platforms/83xx/mpc834x_itx.c | 20 ----------------
arch/powerpc/platforms/83xx/mpc834x_mds.c | 20 ----------------
arch/powerpc/platforms/83xx/mpc836x_mds.c | 29 -----------------------
arch/powerpc/platforms/83xx/mpc836x_rdk.c | 8 +-----
arch/powerpc/platforms/83xx/mpc837x_mds.c | 4 ---
arch/powerpc/platforms/83xx/mpc837x_rdb.c | 2 -
arch/powerpc/platforms/83xx/sbc834x.c | 20 ----------------
arch/powerpc/platforms/83xx/suspend.c | 8 ------
arch/powerpc/platforms/83xx/usb.c | 8 ------
17 files changed, 4 insertions(+), 195 deletions(-)
diff --git a/arch/powerpc/platforms/83xx/asp834x.c b/arch/powerpc/platforms/83xx/asp834x.c
index 464ea8e..a7c0188 100644
--- a/arch/powerpc/platforms/83xx/asp834x.c
+++ b/arch/powerpc/platforms/83xx/asp834x.c
@@ -14,10 +14,8 @@
* option) any later version.
*/
-#include <linux/pci.h>
#include <linux/of_platform.h>
-#include <asm/time.h>
#include <asm/ipic.h>
#include <asm/udbg.h>
diff --git a/arch/powerpc/platforms/83xx/km83xx.c b/arch/powerpc/platforms/83xx/km83xx.c
index b9aaa50..e6c70e3 100644
--- a/arch/powerpc/platforms/83xx/km83xx.c
+++ b/arch/powerpc/platforms/83xx/km83xx.c
@@ -11,35 +11,13 @@
* option) any later version.
*/
-#include <linux/stddef.h>
#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/errno.h>
-#include <linux/reboot.h>
#include <linux/pci.h>
-#include <linux/kdev_t.h>
-#include <linux/major.h>
-#include <linux/console.h>
-#include <linux/delay.h>
-#include <linux/seq_file.h>
-#include <linux/root_dev.h>
-#include <linux/initrd.h>
-#include <linux/of_platform.h>
-#include <linux/of_device.h>
-
-#include <asm/system.h>
-#include <asm/atomic.h>
-#include <asm/time.h>
-#include <asm/io.h>
-#include <asm/machdep.h>
+
#include <asm/ipic.h>
-#include <asm/irq.h>
-#include <asm/prom.h>
#include <asm/udbg.h>
-#include <sysdev/fsl_soc.h>
-#include <sysdev/fsl_pci.h>
#include <asm/qe.h>
-#include <asm/qe_ic.h>
+#include <sysdev/fsl_pci.h>
#include "mpc83xx.h"
diff --git a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
index 70798ac..f47aac2 100644
--- a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
+++ b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
@@ -11,17 +11,12 @@
* (at your option) any later version.
*/
-#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
-#include <linux/device.h>
-#include <linux/mutex.h>
#include <linux/i2c.h>
-#include <linux/gpio.h>
#include <linux/of.h>
#include <linux/of_gpio.h>
#include <linux/slab.h>
-#include <asm/prom.h>
#include <asm/machdep.h>
/*
diff --git a/arch/powerpc/platforms/83xx/misc.c b/arch/powerpc/platforms/83xx/misc.c
index cd65f5a..ae61e10 100644
--- a/arch/powerpc/platforms/83xx/misc.c
+++ b/arch/powerpc/platforms/83xx/misc.c
@@ -9,7 +9,6 @@
* option) any later version.
*/
-#include <linux/stddef.h>
#include <linux/kernel.h>
#include <linux/of_platform.h>
diff --git a/arch/powerpc/platforms/83xx/mpc830x_rdb.c b/arch/powerpc/platforms/83xx/mpc830x_rdb.c
index ef595f1..6e4783d 100644
--- a/arch/powerpc/platforms/83xx/mpc830x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc830x_rdb.c
@@ -14,12 +14,11 @@
*/
#include <linux/pci.h>
-#include <linux/of_platform.h>
-#include <asm/time.h>
+
#include <asm/ipic.h>
#include <asm/udbg.h>
#include <sysdev/fsl_pci.h>
-#include <sysdev/fsl_soc.h>
+
#include "mpc83xx.h"
/*
diff --git a/arch/powerpc/platforms/83xx/mpc831x_rdb.c b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
index ce87406..ac38b14 100644
--- a/arch/powerpc/platforms/83xx/mpc831x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
@@ -14,9 +14,7 @@
*/
#include <linux/pci.h>
-#include <linux/of_platform.h>
-#include <asm/time.h>
#include <asm/ipic.h>
#include <asm/udbg.h>
#include <sysdev/fsl_pci.h>
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index 8ee1440..bea4d0c 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -10,45 +10,15 @@
* option) any later version.
*/
-#include <linux/stddef.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/errno.h>
-#include <linux/reboot.h>
#include <linux/pci.h>
-#include <linux/kdev_t.h>
-#include <linux/major.h>
-#include <linux/console.h>
-#include <linux/delay.h>
-#include <linux/seq_file.h>
-#include <linux/root_dev.h>
-#include <linux/initrd.h>
-#include <linux/of_platform.h>
-#include <linux/of_device.h>
-
-#include <asm/system.h>
-#include <asm/atomic.h>
-#include <asm/time.h>
-#include <asm/io.h>
-#include <asm/machdep.h>
+
#include <asm/ipic.h>
-#include <asm/irq.h>
-#include <asm/prom.h>
#include <asm/udbg.h>
-#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
#include <asm/qe.h>
-#include <asm/qe_ic.h>
#include "mpc83xx.h"
-#undef DEBUG
-#ifdef DEBUG
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
/* ************************************************************************
*
* Setup the architecture
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index c10d0c4..8672d41 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -15,30 +15,19 @@
*/
#include <linux/pci.h>
-#include <linux/interrupt.h>
#include <linux/spi/spi.h>
#include <linux/spi/mmc_spi.h>
#include <linux/mmc/host.h>
-#include <linux/of_platform.h>
#include <linux/fsl_devices.h>
-#include <asm/time.h>
#include <asm/ipic.h>
#include <asm/udbg.h>
#include <asm/qe.h>
-#include <asm/qe_ic.h>
#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
#include "mpc83xx.h"
-#undef DEBUG
-#ifdef DEBUG
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
#ifdef CONFIG_QUICC_ENGINE
static int __init of_fsl_spi_probe(char *type, char *compatible, u32 sysclk,
struct spi_board_info *board_infos,
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c
index d9ea7b7..53e403b 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_itx.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c
@@ -11,30 +11,10 @@
* option) any later version.
*/
-#include <linux/stddef.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/errno.h>
-#include <linux/reboot.h>
#include <linux/pci.h>
-#include <linux/kdev_t.h>
-#include <linux/major.h>
-#include <linux/console.h>
-#include <linux/delay.h>
-#include <linux/seq_file.h>
-#include <linux/root_dev.h>
-#include <linux/of_platform.h>
-#include <asm/system.h>
-#include <asm/atomic.h>
-#include <asm/time.h>
-#include <asm/io.h>
-#include <asm/machdep.h>
#include <asm/ipic.h>
-#include <asm/irq.h>
-#include <asm/prom.h>
#include <asm/udbg.h>
-#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
#include "mpc83xx.h"
diff --git a/arch/powerpc/platforms/83xx/mpc834x_mds.c b/arch/powerpc/platforms/83xx/mpc834x_mds.c
index 381e94e..6aedff9 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_mds.c
@@ -11,30 +11,10 @@
* option) any later version.
*/
-#include <linux/stddef.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/errno.h>
-#include <linux/reboot.h>
#include <linux/pci.h>
-#include <linux/kdev_t.h>
-#include <linux/major.h>
-#include <linux/console.h>
-#include <linux/delay.h>
-#include <linux/seq_file.h>
-#include <linux/root_dev.h>
-#include <linux/of_platform.h>
-#include <asm/system.h>
-#include <asm/atomic.h>
-#include <asm/time.h>
-#include <asm/io.h>
-#include <asm/machdep.h>
#include <asm/ipic.h>
-#include <asm/irq.h>
-#include <asm/prom.h>
#include <asm/udbg.h>
-#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
#include "mpc83xx.h"
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c
index 1b90701..c9624b5 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
@@ -16,31 +16,9 @@
* option) any later version.
*/
-#include <linux/stddef.h>
-#include <linux/kernel.h>
-#include <linux/compiler.h>
-#include <linux/init.h>
-#include <linux/errno.h>
-#include <linux/reboot.h>
#include <linux/pci.h>
-#include <linux/kdev_t.h>
-#include <linux/major.h>
-#include <linux/console.h>
-#include <linux/delay.h>
-#include <linux/seq_file.h>
-#include <linux/root_dev.h>
-#include <linux/initrd.h>
-#include <linux/of_platform.h>
-#include <linux/of_device.h>
-
-#include <asm/system.h>
-#include <asm/atomic.h>
-#include <asm/time.h>
-#include <asm/io.h>
-#include <asm/machdep.h>
+
#include <asm/ipic.h>
-#include <asm/irq.h>
-#include <asm/prom.h>
#include <asm/udbg.h>
#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
@@ -50,13 +28,6 @@
#include "mpc83xx.h"
-#undef DEBUG
-#ifdef DEBUG
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
/* ************************************************************************
*
* Setup the architecture
diff --git a/arch/powerpc/platforms/83xx/mpc836x_rdk.c b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
index 2563174..cafb0c6 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_rdk.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
@@ -12,17 +12,11 @@
* option) any later version.
*/
-#include <linux/kernel.h>
#include <linux/pci.h>
-#include <linux/of_platform.h>
-#include <linux/io.h>
-#include <asm/prom.h>
-#include <asm/time.h>
+
#include <asm/ipic.h>
#include <asm/udbg.h>
#include <asm/qe.h>
-#include <asm/qe_ic.h>
-#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
#include "mpc83xx.h"
diff --git a/arch/powerpc/platforms/83xx/mpc837x_mds.c b/arch/powerpc/platforms/83xx/mpc837x_mds.c
index 7463183..fe76bd7 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_mds.c
@@ -12,13 +12,9 @@
*/
#include <linux/pci.h>
-#include <linux/of.h>
-#include <linux/of_platform.h>
-#include <asm/time.h>
#include <asm/ipic.h>
#include <asm/udbg.h>
-#include <asm/prom.h>
#include <sysdev/fsl_pci.h>
#include "mpc83xx.h"
diff --git a/arch/powerpc/platforms/83xx/mpc837x_rdb.c b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
index a4a5336..a6e649e 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
@@ -12,9 +12,7 @@
*/
#include <linux/pci.h>
-#include <linux/of_platform.h>
-#include <asm/time.h>
#include <asm/ipic.h>
#include <asm/udbg.h>
#include <sysdev/fsl_soc.h>
diff --git a/arch/powerpc/platforms/83xx/sbc834x.c b/arch/powerpc/platforms/83xx/sbc834x.c
index 3d98bd9..ea02022 100644
--- a/arch/powerpc/platforms/83xx/sbc834x.c
+++ b/arch/powerpc/platforms/83xx/sbc834x.c
@@ -13,30 +13,10 @@
* option) any later version.
*/
-#include <linux/stddef.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/errno.h>
-#include <linux/reboot.h>
#include <linux/pci.h>
-#include <linux/kdev_t.h>
-#include <linux/major.h>
-#include <linux/console.h>
-#include <linux/delay.h>
-#include <linux/seq_file.h>
-#include <linux/root_dev.h>
-#include <linux/of_platform.h>
-#include <asm/system.h>
-#include <asm/atomic.h>
-#include <asm/time.h>
-#include <asm/io.h>
-#include <asm/machdep.h>
#include <asm/ipic.h>
-#include <asm/irq.h>
-#include <asm/prom.h>
#include <asm/udbg.h>
-#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
#include "mpc83xx.h"
diff --git a/arch/powerpc/platforms/83xx/suspend.c b/arch/powerpc/platforms/83xx/suspend.c
index 104faa8..d0c814a 100644
--- a/arch/powerpc/platforms/83xx/suspend.c
+++ b/arch/powerpc/platforms/83xx/suspend.c
@@ -10,21 +10,13 @@
* by the Free Software Foundation.
*/
-#include <linux/init.h>
-#include <linux/pm.h>
-#include <linux/types.h>
-#include <linux/ioport.h>
#include <linux/interrupt.h>
#include <linux/wait.h>
#include <linux/kthread.h>
#include <linux/freezer.h>
#include <linux/suspend.h>
-#include <linux/fsl_devices.h>
#include <linux/of_platform.h>
-#include <asm/reg.h>
-#include <asm/io.h>
-#include <asm/time.h>
#include <asm/mpc6xx.h>
#include <sysdev/fsl_soc.h>
diff --git a/arch/powerpc/platforms/83xx/usb.c b/arch/powerpc/platforms/83xx/usb.c
index 2c64164..b2fda49 100644
--- a/arch/powerpc/platforms/83xx/usb.c
+++ b/arch/powerpc/platforms/83xx/usb.c
@@ -10,14 +10,6 @@
* option) any later version.
*/
-
-#include <linux/stddef.h>
-#include <linux/kernel.h>
-#include <linux/errno.h>
-#include <linux/of.h>
-
-#include <asm/io.h>
-#include <asm/prom.h>
#include <sysdev/fsl_soc.h>
#include "mpc83xx.h"
--
1.7.2.5
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 06/14] 85xx/sbc8560: correct compilation if CONFIG_PHYS_ADDR_T_64BIT is set
2011-07-19 8:53 [PATCH 00/14] Consolidation of 83xx/85xx board files Dmitry Eremin-Solenikov
` (4 preceding siblings ...)
2011-07-19 8:53 ` [PATCH 05/14] 83xx: headers cleanup Dmitry Eremin-Solenikov
@ 2011-07-19 8:53 ` Dmitry Eremin-Solenikov
2011-07-19 14:18 ` Kumar Gala
2011-07-19 8:53 ` [PATCH 07/14] 85xx/ksi8560: declare that localbus is compatbile with simple-bus Dmitry Eremin-Solenikov
` (9 subsequent siblings)
15 siblings, 1 reply; 40+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-07-19 8:53 UTC (permalink / raw)
To: Linux PPC Development; +Cc: Paul Mackerras
If CONFIG_PHYS_ADDR_T_64BIT is set, compilation of sbc8560 fails with
the following error:
arch/powerpc/platforms/85xx/sbc8560.c: In function ‘sbc8560_bdrstcr_init’:
arch/powerpc/platforms/85xx/sbc8560.c:286: error: format ‘%x’ expects type ‘unsigned int’, but argument 2 has type ‘resource_size_t’
Fix that by using %pR format instead of just printing the start of
resource.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/powerpc/platforms/85xx/sbc8560.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/platforms/85xx/sbc8560.c b/arch/powerpc/platforms/85xx/sbc8560.c
index d2dfd46..678f5a8 100644
--- a/arch/powerpc/platforms/85xx/sbc8560.c
+++ b/arch/powerpc/platforms/85xx/sbc8560.c
@@ -283,7 +283,7 @@ static int __init sbc8560_bdrstcr_init(void)
of_address_to_resource(np, 0, &res);
- printk(KERN_INFO "sbc8560: Found BRSTCR at i/o 0x%x\n", res.start);
+ printk(KERN_INFO "sbc8560: Found BRSTCR at %pR\n", &res);
brstcr = ioremap(res.start, res.end - res.start);
if(!brstcr)
--
1.7.2.5
^ permalink raw reply related [flat|nested] 40+ messages in thread
* Re: [PATCH 06/14] 85xx/sbc8560: correct compilation if CONFIG_PHYS_ADDR_T_64BIT is set
2011-07-19 8:53 ` [PATCH 06/14] 85xx/sbc8560: correct compilation if CONFIG_PHYS_ADDR_T_64BIT is set Dmitry Eremin-Solenikov
@ 2011-07-19 14:18 ` Kumar Gala
0 siblings, 0 replies; 40+ messages in thread
From: Kumar Gala @ 2011-07-19 14:18 UTC (permalink / raw)
To: Dmitry Eremin-Solenikov; +Cc: Linux PPC Development, Paul Mackerras
On Jul 19, 2011, at 3:53 AM, Dmitry Eremin-Solenikov wrote:
> If CONFIG_PHYS_ADDR_T_64BIT is set, compilation of sbc8560 fails with
> the following error:
>=20
> arch/powerpc/platforms/85xx/sbc8560.c: In function =
=91sbc8560_bdrstcr_init=92:
> arch/powerpc/platforms/85xx/sbc8560.c:286: error: format =91%x=92 =
expects type =91unsigned int=92, but argument 2 has type =
=91resource_size_t=92
>=20
> Fix that by using %pR format instead of just printing the start of
> resource.
>=20
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
> arch/powerpc/platforms/85xx/sbc8560.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
applied to next-3.2
- k=
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 07/14] 85xx/ksi8560: declare that localbus is compatbile with simple-bus
2011-07-19 8:53 [PATCH 00/14] Consolidation of 83xx/85xx board files Dmitry Eremin-Solenikov
` (5 preceding siblings ...)
2011-07-19 8:53 ` [PATCH 06/14] 85xx/sbc8560: correct compilation if CONFIG_PHYS_ADDR_T_64BIT is set Dmitry Eremin-Solenikov
@ 2011-07-19 8:53 ` Dmitry Eremin-Solenikov
2011-07-19 14:19 ` Kumar Gala
2011-07-19 8:53 ` [PATCH 08/14] 85xx/sbc8560: " Dmitry Eremin-Solenikov
` (8 subsequent siblings)
15 siblings, 1 reply; 40+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-07-19 8:53 UTC (permalink / raw)
To: Linux PPC Development; +Cc: Paul Mackerras
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/powerpc/boot/dts/ksi8560.dts | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/boot/dts/ksi8560.dts b/arch/powerpc/boot/dts/ksi8560.dts
index bdb7fc0..296c572 100644
--- a/arch/powerpc/boot/dts/ksi8560.dts
+++ b/arch/powerpc/boot/dts/ksi8560.dts
@@ -306,7 +306,7 @@
localbus@fdf05000 {
#address-cells = <2>;
#size-cells = <1>;
- compatible = "fsl,mpc8560-localbus";
+ compatible = "fsl,mpc8560-localbus", "simple-bus";
reg = <0xfdf05000 0x68>;
ranges = <0x0 0x0 0xe0000000 0x00800000
--
1.7.2.5
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 08/14] 85xx/sbc8560: declare that localbus is compatbile with simple-bus
2011-07-19 8:53 [PATCH 00/14] Consolidation of 83xx/85xx board files Dmitry Eremin-Solenikov
` (6 preceding siblings ...)
2011-07-19 8:53 ` [PATCH 07/14] 85xx/ksi8560: declare that localbus is compatbile with simple-bus Dmitry Eremin-Solenikov
@ 2011-07-19 8:53 ` Dmitry Eremin-Solenikov
2011-07-19 14:19 ` Kumar Gala
2011-07-22 1:53 ` Paul Gortmaker
2011-07-19 8:53 ` [PATCH 09/14] 85xx/sbc8548: read hardware revision when it's required for first time Dmitry Eremin-Solenikov
` (7 subsequent siblings)
15 siblings, 2 replies; 40+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-07-19 8:53 UTC (permalink / raw)
To: Linux PPC Development; +Cc: Paul Mackerras
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/powerpc/boot/dts/sbc8560.dts | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/boot/dts/sbc8560.dts b/arch/powerpc/boot/dts/sbc8560.dts
index 9e13ed8..72078eb 100644
--- a/arch/powerpc/boot/dts/sbc8560.dts
+++ b/arch/powerpc/boot/dts/sbc8560.dts
@@ -331,7 +331,7 @@
};
localbus@ff705000 {
- compatible = "fsl,mpc8560-localbus";
+ compatible = "fsl,mpc8560-localbus", "simple-bus";
#address-cells = <2>;
#size-cells = <1>;
reg = <0xff705000 0x100>; // BRx, ORx, etc.
--
1.7.2.5
^ permalink raw reply related [flat|nested] 40+ messages in thread
* Re: [PATCH 08/14] 85xx/sbc8560: declare that localbus is compatbile with simple-bus
2011-07-19 8:53 ` [PATCH 08/14] 85xx/sbc8560: " Dmitry Eremin-Solenikov
@ 2011-07-19 14:19 ` Kumar Gala
2011-07-22 1:53 ` Paul Gortmaker
1 sibling, 0 replies; 40+ messages in thread
From: Kumar Gala @ 2011-07-19 14:19 UTC (permalink / raw)
To: Dmitry Eremin-Solenikov; +Cc: Linux PPC Development, Paul Mackerras
On Jul 19, 2011, at 3:53 AM, Dmitry Eremin-Solenikov wrote:
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
> arch/powerpc/boot/dts/sbc8560.dts | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
applied to next-3.2
- k
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 08/14] 85xx/sbc8560: declare that localbus is compatbile with simple-bus
2011-07-19 8:53 ` [PATCH 08/14] 85xx/sbc8560: " Dmitry Eremin-Solenikov
2011-07-19 14:19 ` Kumar Gala
@ 2011-07-22 1:53 ` Paul Gortmaker
1 sibling, 0 replies; 40+ messages in thread
From: Paul Gortmaker @ 2011-07-22 1:53 UTC (permalink / raw)
To: Dmitry Eremin-Solenikov; +Cc: Paul Mackerras, Linux PPC Development
Something has gone off the rails with getmaintainer.pl or similar --
I'm guessing that
PaulM doesn't care about dts patches for some aging sbc8560 board,
P.
On Tue, Jul 19, 2011 at 4:53 AM, Dmitry Eremin-Solenikov
<dbaryshkov@gmail.com> wrote:
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
> =A0arch/powerpc/boot/dts/sbc8560.dts | =A0 =A02 +-
> =A01 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/powerpc/boot/dts/sbc8560.dts b/arch/powerpc/boot/dts/sb=
c8560.dts
> index 9e13ed8..72078eb 100644
> --- a/arch/powerpc/boot/dts/sbc8560.dts
> +++ b/arch/powerpc/boot/dts/sbc8560.dts
> @@ -331,7 +331,7 @@
> =A0 =A0 =A0 =A0};
>
> =A0 =A0 =A0 =A0localbus@ff705000 {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 compatible =3D "fsl,mpc8560-localbus";
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 compatible =3D "fsl,mpc8560-localbus", "sim=
ple-bus";
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#address-cells =3D <2>;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#size-cells =3D <1>;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0reg =3D <0xff705000 0x100>; =A0 =A0 =A0 //=
BRx, ORx, etc.
> --
> 1.7.2.5
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
>
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 09/14] 85xx/sbc8548: read hardware revision when it's required for first time
2011-07-19 8:53 [PATCH 00/14] Consolidation of 83xx/85xx board files Dmitry Eremin-Solenikov
` (7 preceding siblings ...)
2011-07-19 8:53 ` [PATCH 08/14] 85xx/sbc8560: " Dmitry Eremin-Solenikov
@ 2011-07-19 8:53 ` Dmitry Eremin-Solenikov
2011-07-19 14:12 ` Kumar Gala
2011-07-19 8:53 ` [PATCH 10/14] 85xx/mpc85xx_rdb: merge p1020_rdb and p2020_rdb machine entries Dmitry Eremin-Solenikov
` (6 subsequent siblings)
15 siblings, 1 reply; 40+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-07-19 8:53 UTC (permalink / raw)
To: Linux PPC Development; +Cc: Paul Mackerras
Currently sbc8548 reads hardware revision during bootup. To simplify
things read it when it's first required when the kernel is up and
running.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/powerpc/platforms/85xx/sbc8548.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/platforms/85xx/sbc8548.c b/arch/powerpc/platforms/85xx/sbc8548.c
index ecdd8c0..2eeb376 100644
--- a/arch/powerpc/platforms/85xx/sbc8548.c
+++ b/arch/powerpc/platforms/85xx/sbc8548.c
@@ -49,7 +49,7 @@
#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
-static int sbc_rev;
+static int sbc_rev = -EINVAL;
static void __init sbc8548_pic_init(void)
{
@@ -82,7 +82,7 @@ static void __init sbc8548_pic_init(void)
}
/* Extract the HW Rev from the EPLD on the board */
-static int __init sbc8548_hw_rev(void)
+static int sbc8548_hw_rev(void)
{
struct device_node *np;
struct resource res;
@@ -130,7 +130,6 @@ static void __init sbc8548_setup_arch(void)
}
}
#endif
- sbc_rev = sbc8548_hw_rev();
}
static void sbc8548_show_cpuinfo(struct seq_file *m)
@@ -140,6 +139,9 @@ static void sbc8548_show_cpuinfo(struct seq_file *m)
pvid = mfspr(SPRN_PVR);
svid = mfspr(SPRN_SVR);
+ if (sbc_rev == -EINVAL)
+ sbc_rev = sbc8548_hw_rev();
+
seq_printf(m, "Vendor\t\t: Wind River\n");
seq_printf(m, "Machine\t\t: SBC8548 v%d\n", sbc_rev);
seq_printf(m, "PVR\t\t: 0x%x\n", pvid);
--
1.7.2.5
^ permalink raw reply related [flat|nested] 40+ messages in thread
* Re: [PATCH 09/14] 85xx/sbc8548: read hardware revision when it's required for first time
2011-07-19 8:53 ` [PATCH 09/14] 85xx/sbc8548: read hardware revision when it's required for first time Dmitry Eremin-Solenikov
@ 2011-07-19 14:12 ` Kumar Gala
2011-07-22 1:59 ` Paul Gortmaker
0 siblings, 1 reply; 40+ messages in thread
From: Kumar Gala @ 2011-07-19 14:12 UTC (permalink / raw)
To: Dmitry Eremin-Solenikov; +Cc: Linux PPC Development, Paul Mackerras
On Jul 19, 2011, at 3:53 AM, Dmitry Eremin-Solenikov wrote:
> Currently sbc8548 reads hardware revision during bootup. To simplify
> things read it when it's first required when the kernel is up and
> running.
>=20
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
> arch/powerpc/platforms/85xx/sbc8548.c | 8 +++++---
> 1 files changed, 5 insertions(+), 3 deletions(-)
How is this simplifying things, seems more complicated to add an =
additional if() check.
- k
>=20
> diff --git a/arch/powerpc/platforms/85xx/sbc8548.c =
b/arch/powerpc/platforms/85xx/sbc8548.c
> index ecdd8c0..2eeb376 100644
> --- a/arch/powerpc/platforms/85xx/sbc8548.c
> +++ b/arch/powerpc/platforms/85xx/sbc8548.c
> @@ -49,7 +49,7 @@
> #include <sysdev/fsl_soc.h>
> #include <sysdev/fsl_pci.h>
>=20
> -static int sbc_rev;
> +static int sbc_rev =3D -EINVAL;
>=20
> static void __init sbc8548_pic_init(void)
> {
> @@ -82,7 +82,7 @@ static void __init sbc8548_pic_init(void)
> }
>=20
> /* Extract the HW Rev from the EPLD on the board */
> -static int __init sbc8548_hw_rev(void)
> +static int sbc8548_hw_rev(void)
> {
> struct device_node *np;
> struct resource res;
> @@ -130,7 +130,6 @@ static void __init sbc8548_setup_arch(void)
> }
> }
> #endif
> - sbc_rev =3D sbc8548_hw_rev();
> }
>=20
> static void sbc8548_show_cpuinfo(struct seq_file *m)
> @@ -140,6 +139,9 @@ static void sbc8548_show_cpuinfo(struct seq_file =
*m)
> pvid =3D mfspr(SPRN_PVR);
> svid =3D mfspr(SPRN_SVR);
>=20
> + if (sbc_rev =3D=3D -EINVAL)
> + sbc_rev =3D sbc8548_hw_rev();
> +
> seq_printf(m, "Vendor\t\t: Wind River\n");
> seq_printf(m, "Machine\t\t: SBC8548 v%d\n", sbc_rev);
> seq_printf(m, "PVR\t\t: 0x%x\n", pvid);
> --=20
> 1.7.2.5
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 09/14] 85xx/sbc8548: read hardware revision when it's required for first time
2011-07-19 14:12 ` Kumar Gala
@ 2011-07-22 1:59 ` Paul Gortmaker
0 siblings, 0 replies; 40+ messages in thread
From: Paul Gortmaker @ 2011-07-22 1:59 UTC (permalink / raw)
To: Kumar Gala; +Cc: Dmitry Eremin-Solenikov, Paul Mackerras, Linux PPC Development
On Tue, Jul 19, 2011 at 10:12 AM, Kumar Gala <galak@kernel.crashing.org> wr=
ote:
>
> On Jul 19, 2011, at 3:53 AM, Dmitry Eremin-Solenikov wrote:
>
>> Currently sbc8548 reads hardware revision during bootup. To simplify
>> things read it when it's first required when the kernel is up and
>> running.
>>
>> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
>> ---
>> arch/powerpc/platforms/85xx/sbc8548.c | =A0 =A08 +++++---
>> 1 files changed, 5 insertions(+), 3 deletions(-)
>
> How is this simplifying things, seems more complicated to add an addition=
al if() check.
Agreed -- I don't see what this is meant to achieve.
Paul.
>
> - k
>
>>
>> diff --git a/arch/powerpc/platforms/85xx/sbc8548.c b/arch/powerpc/platfo=
rms/85xx/sbc8548.c
>> index ecdd8c0..2eeb376 100644
>> --- a/arch/powerpc/platforms/85xx/sbc8548.c
>> +++ b/arch/powerpc/platforms/85xx/sbc8548.c
>> @@ -49,7 +49,7 @@
>> #include <sysdev/fsl_soc.h>
>> #include <sysdev/fsl_pci.h>
>>
>> -static int sbc_rev;
>> +static int sbc_rev =3D -EINVAL;
>>
>> static void __init sbc8548_pic_init(void)
>> {
>> @@ -82,7 +82,7 @@ static void __init sbc8548_pic_init(void)
>> }
>>
>> /* Extract the HW Rev from the EPLD on the board */
>> -static int __init sbc8548_hw_rev(void)
>> +static int sbc8548_hw_rev(void)
>> {
>> =A0 =A0 =A0 struct device_node *np;
>> =A0 =A0 =A0 struct resource res;
>> @@ -130,7 +130,6 @@ static void __init sbc8548_setup_arch(void)
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 }
>> =A0 =A0 =A0 }
>> #endif
>> - =A0 =A0 sbc_rev =3D sbc8548_hw_rev();
>> }
>>
>> static void sbc8548_show_cpuinfo(struct seq_file *m)
>> @@ -140,6 +139,9 @@ static void sbc8548_show_cpuinfo(struct seq_file *m)
>> =A0 =A0 =A0 pvid =3D mfspr(SPRN_PVR);
>> =A0 =A0 =A0 svid =3D mfspr(SPRN_SVR);
>>
>> + =A0 =A0 if (sbc_rev =3D=3D -EINVAL)
>> + =A0 =A0 =A0 =A0 =A0 =A0 sbc_rev =3D sbc8548_hw_rev();
>> +
>> =A0 =A0 =A0 seq_printf(m, "Vendor\t\t: Wind River\n");
>> =A0 =A0 =A0 seq_printf(m, "Machine\t\t: SBC8548 v%d\n", sbc_rev);
>> =A0 =A0 =A0 seq_printf(m, "PVR\t\t: 0x%x\n", pvid);
>> --
>> 1.7.2.5
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
>
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 10/14] 85xx/mpc85xx_rdb: merge p1020_rdb and p2020_rdb machine entries
2011-07-19 8:53 [PATCH 00/14] Consolidation of 83xx/85xx board files Dmitry Eremin-Solenikov
` (8 preceding siblings ...)
2011-07-19 8:53 ` [PATCH 09/14] 85xx/sbc8548: read hardware revision when it's required for first time Dmitry Eremin-Solenikov
@ 2011-07-19 8:53 ` Dmitry Eremin-Solenikov
2011-07-19 14:00 ` Kumar Gala
2011-07-19 8:53 ` [PATCH 11/14] 85xx: merge 32-bit QorIQ with DPA boards support Dmitry Eremin-Solenikov
` (5 subsequent siblings)
15 siblings, 1 reply; 40+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-07-19 8:53 UTC (permalink / raw)
To: Linux PPC Development; +Cc: Paul Mackerras
p1020_rdb and p2020_rdb machine entries bear no in-kernel differencies
other than dt compatible strings. Merge them into single machine entry
named mpc85xx_rdb
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 40 ++++++----------------------
1 files changed, 9 insertions(+), 31 deletions(-)
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
index 088f30b..7a3a37b 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
@@ -120,47 +120,25 @@ static int __init mpc85xxrdb_publish_devices(void)
{
return of_platform_bus_probe(NULL, mpc85xxrdb_ids, NULL);
}
-machine_device_initcall(p2020_rdb, mpc85xxrdb_publish_devices);
-machine_device_initcall(p1020_rdb, mpc85xxrdb_publish_devices);
+machine_device_initcall(mpc85xx_rdb, mpc85xxrdb_publish_devices);
/*
* Called very early, device-tree isn't unflattened
*/
-static int __init p2020_rdb_probe(void)
+static int __init mpc85xx_rdb_probe(void)
{
unsigned long root = of_get_flat_dt_root();
- if (of_flat_dt_is_compatible(root, "fsl,P2020RDB"))
+ if (of_flat_dt_is_compatible(root, "fsl,P1020RDB") ||
+ of_flat_dt_is_compatible(root, "fsl,P2020RDB")) {
return 1;
- return 0;
+ } else
+ return 0;
}
-static int __init p1020_rdb_probe(void)
-{
- unsigned long root = of_get_flat_dt_root();
-
- if (of_flat_dt_is_compatible(root, "fsl,P1020RDB"))
- return 1;
- return 0;
-}
-
-define_machine(p2020_rdb) {
- .name = "P2020 RDB",
- .probe = p2020_rdb_probe,
- .setup_arch = mpc85xx_rdb_setup_arch,
- .init_IRQ = mpc85xx_rdb_pic_init,
-#ifdef CONFIG_PCI
- .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
-#endif
- .get_irq = mpic_get_irq,
- .restart = fsl_rstcr_restart,
- .calibrate_decr = generic_calibrate_decr,
- .progress = udbg_progress,
-};
-
-define_machine(p1020_rdb) {
- .name = "P1020 RDB",
- .probe = p1020_rdb_probe,
+define_machine(mpc85xx_rdb) {
+ .name = "MPC85xx RDB",
+ .probe = mpc85xx_rdb_probe,
.setup_arch = mpc85xx_rdb_setup_arch,
.init_IRQ = mpc85xx_rdb_pic_init,
#ifdef CONFIG_PCI
--
1.7.2.5
^ permalink raw reply related [flat|nested] 40+ messages in thread
* Re: [PATCH 10/14] 85xx/mpc85xx_rdb: merge p1020_rdb and p2020_rdb machine entries
2011-07-19 8:53 ` [PATCH 10/14] 85xx/mpc85xx_rdb: merge p1020_rdb and p2020_rdb machine entries Dmitry Eremin-Solenikov
@ 2011-07-19 14:00 ` Kumar Gala
2011-07-22 19:47 ` Dmitry Eremin-Solenikov
2011-07-22 20:11 ` Dmitry Eremin-Solenikov
0 siblings, 2 replies; 40+ messages in thread
From: Kumar Gala @ 2011-07-19 14:00 UTC (permalink / raw)
To: Dmitry Eremin-Solenikov; +Cc: Linux PPC Development, Paul Mackerras
On Jul 19, 2011, at 3:53 AM, Dmitry Eremin-Solenikov wrote:
> p1020_rdb and p2020_rdb machine entries bear no in-kernel differencies
> other than dt compatible strings. Merge them into single machine entry
> named mpc85xx_rdb
>=20
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
> arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 40 =
++++++----------------------
> 1 files changed, 9 insertions(+), 31 deletions(-)
>=20
> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c =
b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
> index 088f30b..7a3a37b 100644
> --- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
> +++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
> @@ -120,47 +120,25 @@ static int __init =
mpc85xxrdb_publish_devices(void)
> {
> return of_platform_bus_probe(NULL, mpc85xxrdb_ids, NULL);
> }
> -machine_device_initcall(p2020_rdb, mpc85xxrdb_publish_devices);
> -machine_device_initcall(p1020_rdb, mpc85xxrdb_publish_devices);
> +machine_device_initcall(mpc85xx_rdb, mpc85xxrdb_publish_devices);
>=20
> /*
> * Called very early, device-tree isn't unflattened
> */
> -static int __init p2020_rdb_probe(void)
> +static int __init mpc85xx_rdb_probe(void)
> {
> unsigned long root =3D of_get_flat_dt_root();
>=20
> - if (of_flat_dt_is_compatible(root, "fsl,P2020RDB"))
> + if (of_flat_dt_is_compatible(root, "fsl,P1020RDB") ||
> + of_flat_dt_is_compatible(root, "fsl,P2020RDB")) {
> return 1;
> - return 0;
> + } else
> + return 0;
> }
>=20
> -static int __init p1020_rdb_probe(void)
> -{
> - unsigned long root =3D of_get_flat_dt_root();
> -
> - if (of_flat_dt_is_compatible(root, "fsl,P1020RDB"))
> - return 1;
> - return 0;
> -}
> -
> -define_machine(p2020_rdb) {
> - .name =3D "P2020 RDB",
> - .probe =3D p2020_rdb_probe,
> - .setup_arch =3D mpc85xx_rdb_setup_arch,
> - .init_IRQ =3D mpc85xx_rdb_pic_init,
> -#ifdef CONFIG_PCI
> - .pcibios_fixup_bus =3D fsl_pcibios_fixup_bus,
> -#endif
> - .get_irq =3D mpic_get_irq,
> - .restart =3D fsl_rstcr_restart,
> - .calibrate_decr =3D generic_calibrate_decr,
> - .progress =3D udbg_progress,
> -};
> -
> -define_machine(p1020_rdb) {
> - .name =3D "P1020 RDB",
> - .probe =3D p1020_rdb_probe,
> +define_machine(mpc85xx_rdb) {
> + .name =3D "MPC85xx RDB",
breaking 'name' this way isn't acceptable.
> + .probe =3D mpc85xx_rdb_probe,
> .setup_arch =3D mpc85xx_rdb_setup_arch,
> .init_IRQ =3D mpc85xx_rdb_pic_init,
> #ifdef CONFIG_PCI
> --=20
> 1.7.2.5
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 10/14] 85xx/mpc85xx_rdb: merge p1020_rdb and p2020_rdb machine entries
2011-07-19 14:00 ` Kumar Gala
@ 2011-07-22 19:47 ` Dmitry Eremin-Solenikov
2011-07-22 20:11 ` Dmitry Eremin-Solenikov
1 sibling, 0 replies; 40+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-07-22 19:47 UTC (permalink / raw)
To: Kumar Gala; +Cc: Linux PPC Development, Paul Mackerras
On 7/19/11, Kumar Gala <galak@kernel.crashing.org> wrote:
>
> On Jul 19, 2011, at 3:53 AM, Dmitry Eremin-Solenikov wrote:
>
>> p1020_rdb and p2020_rdb machine entries bear no in-kernel differencies
>> other than dt compatible strings. Merge them into single machine entry
>> named mpc85xx_rdb
>>
>> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
>> ---
>> arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 40
>> ++++++----------------------
>> 1 files changed, 9 insertions(+), 31 deletions(-)
>>
>> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
>> b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
>> index 088f30b..7a3a37b 100644
>> --- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
>> +++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
>> @@ -120,47 +120,25 @@ static int __init mpc85xxrdb_publish_devices(void)
>> {
>> return of_platform_bus_probe(NULL, mpc85xxrdb_ids, NULL);
>> }
>> -machine_device_initcall(p2020_rdb, mpc85xxrdb_publish_devices);
>> -machine_device_initcall(p1020_rdb, mpc85xxrdb_publish_devices);
>> +machine_device_initcall(mpc85xx_rdb, mpc85xxrdb_publish_devices);
>>
>> /*
>> * Called very early, device-tree isn't unflattened
>> */
>> -static int __init p2020_rdb_probe(void)
>> +static int __init mpc85xx_rdb_probe(void)
>> {
>> unsigned long root = of_get_flat_dt_root();
>>
>> - if (of_flat_dt_is_compatible(root, "fsl,P2020RDB"))
>> + if (of_flat_dt_is_compatible(root, "fsl,P1020RDB") ||
>> + of_flat_dt_is_compatible(root, "fsl,P2020RDB")) {
>> return 1;
>> - return 0;
>> + } else
>> + return 0;
>> }
>>
>> -static int __init p1020_rdb_probe(void)
>> -{
>> - unsigned long root = of_get_flat_dt_root();
>> -
>> - if (of_flat_dt_is_compatible(root, "fsl,P1020RDB"))
>> - return 1;
>> - return 0;
>> -}
>> -
>> -define_machine(p2020_rdb) {
>> - .name = "P2020 RDB",
>> - .probe = p2020_rdb_probe,
>> - .setup_arch = mpc85xx_rdb_setup_arch,
>> - .init_IRQ = mpc85xx_rdb_pic_init,
>> -#ifdef CONFIG_PCI
>> - .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
>> -#endif
>> - .get_irq = mpic_get_irq,
>> - .restart = fsl_rstcr_restart,
>> - .calibrate_decr = generic_calibrate_decr,
>> - .progress = udbg_progress,
>> -};
>> -
>> -define_machine(p1020_rdb) {
>> - .name = "P1020 RDB",
>> - .probe = p1020_rdb_probe,
>> +define_machine(mpc85xx_rdb) {
>> + .name = "MPC85xx RDB",
>
> breaking 'name' this way isn't acceptable.
What would be suitable from your point of view? Does "Px020 RDB" look good?
Or something like it?
>
>> + .probe = mpc85xx_rdb_probe,
>> .setup_arch = mpc85xx_rdb_setup_arch,
>> .init_IRQ = mpc85xx_rdb_pic_init,
>> #ifdef CONFIG_PCI
>> --
>> 1.7.2.5
>
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 10/14] 85xx/mpc85xx_rdb: merge p1020_rdb and p2020_rdb machine entries
2011-07-19 14:00 ` Kumar Gala
2011-07-22 19:47 ` Dmitry Eremin-Solenikov
@ 2011-07-22 20:11 ` Dmitry Eremin-Solenikov
1 sibling, 0 replies; 40+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-07-22 20:11 UTC (permalink / raw)
To: Kumar Gala; +Cc: Linux PPC Development, Paul Mackerras
On 7/19/11, Kumar Gala <galak@kernel.crashing.org> wrote:
>
> On Jul 19, 2011, at 3:53 AM, Dmitry Eremin-Solenikov wrote:
>
>> p1020_rdb and p2020_rdb machine entries bear no in-kernel differencies
>> other than dt compatible strings. Merge them into single machine entry
>> named mpc85xx_rdb
>>
>> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
>> ---
>> arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 40
>> ++++++----------------------
>> 1 files changed, 9 insertions(+), 31 deletions(-)
>>
>> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
>> b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
>> index 088f30b..7a3a37b 100644
>> --- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
>> +++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
>> @@ -120,47 +120,25 @@ static int __init mpc85xxrdb_publish_devices(void)
>> {
>> return of_platform_bus_probe(NULL, mpc85xxrdb_ids, NULL);
>> }
>> -machine_device_initcall(p2020_rdb, mpc85xxrdb_publish_devices);
>> -machine_device_initcall(p1020_rdb, mpc85xxrdb_publish_devices);
>> +machine_device_initcall(mpc85xx_rdb, mpc85xxrdb_publish_devices);
>>
>> /*
>> * Called very early, device-tree isn't unflattened
>> */
>> -static int __init p2020_rdb_probe(void)
>> +static int __init mpc85xx_rdb_probe(void)
>> {
>> unsigned long root = of_get_flat_dt_root();
>>
>> - if (of_flat_dt_is_compatible(root, "fsl,P2020RDB"))
>> + if (of_flat_dt_is_compatible(root, "fsl,P1020RDB") ||
>> + of_flat_dt_is_compatible(root, "fsl,P2020RDB")) {
>> return 1;
>> - return 0;
>> + } else
>> + return 0;
>> }
>>
>> -static int __init p1020_rdb_probe(void)
>> -{
>> - unsigned long root = of_get_flat_dt_root();
>> -
>> - if (of_flat_dt_is_compatible(root, "fsl,P1020RDB"))
>> - return 1;
>> - return 0;
>> -}
>> -
>> -define_machine(p2020_rdb) {
>> - .name = "P2020 RDB",
>> - .probe = p2020_rdb_probe,
>> - .setup_arch = mpc85xx_rdb_setup_arch,
>> - .init_IRQ = mpc85xx_rdb_pic_init,
>> -#ifdef CONFIG_PCI
>> - .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
>> -#endif
>> - .get_irq = mpic_get_irq,
>> - .restart = fsl_rstcr_restart,
>> - .calibrate_decr = generic_calibrate_decr,
>> - .progress = udbg_progress,
>> -};
>> -
>> -define_machine(p1020_rdb) {
>> - .name = "P1020 RDB",
>> - .probe = p1020_rdb_probe,
>> +define_machine(mpc85xx_rdb) {
>> + .name = "MPC85xx RDB",
>
> breaking 'name' this way isn't acceptable.
BTW: what is so special in p1010rdb, so it's not
merged into this file, but exists as a separate .c file?
>
>> + .probe = mpc85xx_rdb_probe,
>> .setup_arch = mpc85xx_rdb_setup_arch,
>> .init_IRQ = mpc85xx_rdb_pic_init,
>> #ifdef CONFIG_PCI
>> --
>> 1.7.2.5
>
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 11/14] 85xx: merge 32-bit QorIQ with DPA boards support
2011-07-19 8:53 [PATCH 00/14] Consolidation of 83xx/85xx board files Dmitry Eremin-Solenikov
` (9 preceding siblings ...)
2011-07-19 8:53 ` [PATCH 10/14] 85xx/mpc85xx_rdb: merge p1020_rdb and p2020_rdb machine entries Dmitry Eremin-Solenikov
@ 2011-07-19 8:53 ` Dmitry Eremin-Solenikov
2011-07-19 14:12 ` Kumar Gala
2011-07-19 8:53 ` [PATCH 12/14] 85xx/mpc85xx_ds, ads, cds: move .pci_exclude_device setting to machine definitions Dmitry Eremin-Solenikov
` (4 subsequent siblings)
15 siblings, 1 reply; 40+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-07-19 8:53 UTC (permalink / raw)
To: Linux PPC Development; +Cc: Paul Mackerras
Board support files for p4080ds, p3041ds and p2040rdb don't differ at
all (all differencies are hidden in dts files). So merge them into
single board file containing all necessary stuff.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/powerpc/platforms/85xx/Kconfig | 32 +------
arch/powerpc/platforms/85xx/Makefile | 4 +-
arch/powerpc/platforms/85xx/p2040_rdb.c | 88 -------------------
arch/powerpc/platforms/85xx/p3041_ds.c | 90 --------------------
.../platforms/85xx/{p4080_ds.c => qoriq_dpa_ds.c} | 24 +++--
5 files changed, 20 insertions(+), 218 deletions(-)
delete mode 100644 arch/powerpc/platforms/85xx/p2040_rdb.c
delete mode 100644 arch/powerpc/platforms/85xx/p3041_ds.c
rename arch/powerpc/platforms/85xx/{p4080_ds.c => qoriq_dpa_ds.c} (72%)
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index 498534c..7b9c042 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -171,8 +171,8 @@ config SBC8560
help
This option enables support for the Wind River SBC8560 board
-config P2040_RDB
- bool "Freescale P2040 RDB"
+config QORIQ_DPA_DS
+ bool "Freescale QorIQ with DPA development systems"
select DEFAULT_UIMAGE
select PPC_E500MC
select PHYS_64BIT
@@ -181,31 +181,9 @@ config P2040_RDB
select HAS_RAPIDIO
select PPC_EPAPR_HV_PIC
help
- This option enables support for the P2040 RDB board
-
-config P3041_DS
- bool "Freescale P3041 DS"
- select DEFAULT_UIMAGE
- select PPC_E500MC
- select PHYS_64BIT
- select SWIOTLB
- select MPC8xxx_GPIO
- select HAS_RAPIDIO
- select PPC_EPAPR_HV_PIC
- help
- This option enables support for the P3041 DS board
-
-config P4080_DS
- bool "Freescale P4080 DS"
- select DEFAULT_UIMAGE
- select PPC_E500MC
- select PHYS_64BIT
- select SWIOTLB
- select MPC8xxx_GPIO
- select HAS_RAPIDIO
- select PPC_EPAPR_HV_PIC
- help
- This option enables support for the P4080 DS board
+ This option enables support for the Freescale boards
+ based on the QorIQ CPU with DPA: P2040 RDB, P3041 DS and
+ P4080 DS boards
endif # PPC32
diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile
index a971b32..43b2162 100644
--- a/arch/powerpc/platforms/85xx/Makefile
+++ b/arch/powerpc/platforms/85xx/Makefile
@@ -13,9 +13,7 @@ obj-$(CONFIG_MPC85xx_RDB) += mpc85xx_rdb.o
obj-$(CONFIG_P1010_RDB) += p1010rdb.o
obj-$(CONFIG_P1022_DS) += p1022_ds.o
obj-$(CONFIG_P1023_RDS) += p1023_rds.o
-obj-$(CONFIG_P2040_RDB) += p2040_rdb.o corenet_ds.o
-obj-$(CONFIG_P3041_DS) += p3041_ds.o corenet_ds.o
-obj-$(CONFIG_P4080_DS) += p4080_ds.o corenet_ds.o
+obj-$(CONFIG_QORIQ_DPA_DS) += qoriq_dpa_ds.o corenet_ds.o
obj-$(CONFIG_P5020_DS) += p5020_ds.o corenet_ds.o
obj-$(CONFIG_STX_GP3) += stx_gp3.o
obj-$(CONFIG_TQM85xx) += tqm85xx.o
diff --git a/arch/powerpc/platforms/85xx/p2040_rdb.c b/arch/powerpc/platforms/85xx/p2040_rdb.c
deleted file mode 100644
index 32b56ac..0000000
--- a/arch/powerpc/platforms/85xx/p2040_rdb.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * P2040 RDB Setup
- *
- * Copyright 2011 Freescale Semiconductor Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- */
-
-#include <linux/kernel.h>
-#include <linux/pci.h>
-#include <linux/kdev_t.h>
-#include <linux/delay.h>
-#include <linux/interrupt.h>
-#include <linux/phy.h>
-
-#include <asm/system.h>
-#include <asm/time.h>
-#include <asm/machdep.h>
-#include <asm/pci-bridge.h>
-#include <mm/mmu_decl.h>
-#include <asm/prom.h>
-#include <asm/udbg.h>
-#include <asm/mpic.h>
-
-#include <linux/of_platform.h>
-#include <sysdev/fsl_soc.h>
-#include <sysdev/fsl_pci.h>
-#include <asm/ehv_pic.h>
-
-#include "corenet_ds.h"
-
-/*
- * Called very early, device-tree isn't unflattened
- */
-static int __init p2040_rdb_probe(void)
-{
- unsigned long root = of_get_flat_dt_root();
-#ifdef CONFIG_SMP
- extern struct smp_ops_t smp_85xx_ops;
-#endif
-
- if (of_flat_dt_is_compatible(root, "fsl,P2040RDB"))
- return 1;
-
- /* Check if we're running under the Freescale hypervisor */
- if (of_flat_dt_is_compatible(root, "fsl,P2040RDB-hv")) {
- ppc_md.init_IRQ = ehv_pic_init;
- ppc_md.get_irq = ehv_pic_get_irq;
- ppc_md.restart = fsl_hv_restart;
- ppc_md.power_off = fsl_hv_halt;
- ppc_md.halt = fsl_hv_halt;
-#ifdef CONFIG_SMP
- /*
- * Disable the timebase sync operations because we can't write
- * to the timebase registers under the hypervisor.
- */
- smp_85xx_ops.give_timebase = NULL;
- smp_85xx_ops.take_timebase = NULL;
-#endif
- return 1;
- }
-
- return 0;
-}
-
-define_machine(p2040_rdb) {
- .name = "P2040 RDB",
- .probe = p2040_rdb_probe,
- .setup_arch = corenet_ds_setup_arch,
- .init_IRQ = corenet_ds_pic_init,
-#ifdef CONFIG_PCI
- .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
-#endif
- .get_irq = mpic_get_coreint_irq,
- .restart = fsl_rstcr_restart,
- .calibrate_decr = generic_calibrate_decr,
- .progress = udbg_progress,
- .power_save = e500_idle,
-};
-
-machine_device_initcall(p2040_rdb, corenet_ds_publish_devices);
-
-#ifdef CONFIG_SWIOTLB
-machine_arch_initcall(p2040_rdb, swiotlb_setup_bus_notifier);
-#endif
diff --git a/arch/powerpc/platforms/85xx/p3041_ds.c b/arch/powerpc/platforms/85xx/p3041_ds.c
deleted file mode 100644
index 96d99a3..0000000
--- a/arch/powerpc/platforms/85xx/p3041_ds.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * P3041 DS Setup
- *
- * Maintained by Kumar Gala (see MAINTAINERS for contact information)
- *
- * Copyright 2009-2010 Freescale Semiconductor Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- */
-
-#include <linux/kernel.h>
-#include <linux/pci.h>
-#include <linux/kdev_t.h>
-#include <linux/delay.h>
-#include <linux/interrupt.h>
-#include <linux/phy.h>
-
-#include <asm/system.h>
-#include <asm/time.h>
-#include <asm/machdep.h>
-#include <asm/pci-bridge.h>
-#include <mm/mmu_decl.h>
-#include <asm/prom.h>
-#include <asm/udbg.h>
-#include <asm/mpic.h>
-
-#include <linux/of_platform.h>
-#include <sysdev/fsl_soc.h>
-#include <sysdev/fsl_pci.h>
-#include <asm/ehv_pic.h>
-
-#include "corenet_ds.h"
-
-/*
- * Called very early, device-tree isn't unflattened
- */
-static int __init p3041_ds_probe(void)
-{
- unsigned long root = of_get_flat_dt_root();
-#ifdef CONFIG_SMP
- extern struct smp_ops_t smp_85xx_ops;
-#endif
-
- if (of_flat_dt_is_compatible(root, "fsl,P3041DS"))
- return 1;
-
- /* Check if we're running under the Freescale hypervisor */
- if (of_flat_dt_is_compatible(root, "fsl,P3041DS-hv")) {
- ppc_md.init_IRQ = ehv_pic_init;
- ppc_md.get_irq = ehv_pic_get_irq;
- ppc_md.restart = fsl_hv_restart;
- ppc_md.power_off = fsl_hv_halt;
- ppc_md.halt = fsl_hv_halt;
-#ifdef CONFIG_SMP
- /*
- * Disable the timebase sync operations because we can't write
- * to the timebase registers under the hypervisor.
- */
- smp_85xx_ops.give_timebase = NULL;
- smp_85xx_ops.take_timebase = NULL;
-#endif
- return 1;
- }
-
- return 0;
-}
-
-define_machine(p3041_ds) {
- .name = "P3041 DS",
- .probe = p3041_ds_probe,
- .setup_arch = corenet_ds_setup_arch,
- .init_IRQ = corenet_ds_pic_init,
-#ifdef CONFIG_PCI
- .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
-#endif
- .get_irq = mpic_get_coreint_irq,
- .restart = fsl_rstcr_restart,
- .calibrate_decr = generic_calibrate_decr,
- .progress = udbg_progress,
- .power_save = e500_idle,
-};
-
-machine_device_initcall(p3041_ds, corenet_ds_publish_devices);
-
-#ifdef CONFIG_SWIOTLB
-machine_arch_initcall(p3041_ds, swiotlb_setup_bus_notifier);
-#endif
diff --git a/arch/powerpc/platforms/85xx/p4080_ds.c b/arch/powerpc/platforms/85xx/qoriq_dpa_ds.c
similarity index 72%
rename from arch/powerpc/platforms/85xx/p4080_ds.c
rename to arch/powerpc/platforms/85xx/qoriq_dpa_ds.c
index d1b21d7..2f5eaea 100644
--- a/arch/powerpc/platforms/85xx/p4080_ds.c
+++ b/arch/powerpc/platforms/85xx/qoriq_dpa_ds.c
@@ -1,9 +1,9 @@
/*
- * P4080 DS Setup
+ * Setup for Freescale boards based on QorIQ with DPA
*
* Maintained by Kumar Gala (see MAINTAINERS for contact information)
*
- * Copyright 2009 Freescale Semiconductor Inc.
+ * Copyright 2009-2011 Freescale Semiconductor Inc.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -36,18 +36,22 @@
/*
* Called very early, device-tree isn't unflattened
*/
-static int __init p4080_ds_probe(void)
+static int __init qoriq_dpa_probe(void)
{
unsigned long root = of_get_flat_dt_root();
#ifdef CONFIG_SMP
extern struct smp_ops_t smp_85xx_ops;
#endif
- if (of_flat_dt_is_compatible(root, "fsl,P4080DS"))
+ if (of_flat_dt_is_compatible(root, "fsl,P2040RDB") ||
+ of_flat_dt_is_compatible(root, "fsl,P3041DS") ||
+ of_flat_dt_is_compatible(root, "fsl,P4080DS")) {
return 1;
/* Check if we're running under the Freescale hypervisor */
- if (of_flat_dt_is_compatible(root, "fsl,P4080DS-hv")) {
+ if (of_flat_dt_is_compatible(root, "fsl,P2040RDB-hv") ||
+ of_flat_dt_is_compatible(root, "fsl,P3041DS-hv") ||
+ of_flat_dt_is_compatible(root, "fsl,P4080DS-hv")) {
ppc_md.init_IRQ = ehv_pic_init;
ppc_md.get_irq = ehv_pic_get_irq;
ppc_md.restart = fsl_hv_restart;
@@ -67,9 +71,9 @@ static int __init p4080_ds_probe(void)
return 0;
}
-define_machine(p4080_ds) {
- .name = "P4080 DS",
- .probe = p4080_ds_probe,
+define_machine(qoriq_dpa) {
+ .name = "QorIQ with DPA DS",
+ .probe = qoriq_dpa_probe,
.setup_arch = corenet_ds_setup_arch,
.init_IRQ = corenet_ds_pic_init,
#ifdef CONFIG_PCI
@@ -82,7 +86,7 @@ define_machine(p4080_ds) {
.power_save = e500_idle,
};
-machine_device_initcall(p4080_ds, corenet_ds_publish_devices);
+machine_device_initcall(qoriq_dpa, corenet_ds_publish_devices);
#ifdef CONFIG_SWIOTLB
-machine_arch_initcall(p4080_ds, swiotlb_setup_bus_notifier);
+machine_arch_initcall(qoriq_dpa, swiotlb_setup_bus_notifier);
#endif
--
1.7.2.5
^ permalink raw reply related [flat|nested] 40+ messages in thread
* Re: [PATCH 11/14] 85xx: merge 32-bit QorIQ with DPA boards support
2011-07-19 8:53 ` [PATCH 11/14] 85xx: merge 32-bit QorIQ with DPA boards support Dmitry Eremin-Solenikov
@ 2011-07-19 14:12 ` Kumar Gala
0 siblings, 0 replies; 40+ messages in thread
From: Kumar Gala @ 2011-07-19 14:12 UTC (permalink / raw)
To: Dmitry Eremin-Solenikov; +Cc: Linux PPC Development, Paul Mackerras
On Jul 19, 2011, at 3:53 AM, Dmitry Eremin-Solenikov wrote:
> Board support files for p4080ds, p3041ds and p2040rdb don't differ at
> all (all differencies are hidden in dts files). So merge them into
> single board file containing all necessary stuff.
>=20
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
> arch/powerpc/platforms/85xx/Kconfig | 32 +------
> arch/powerpc/platforms/85xx/Makefile | 4 +-
> arch/powerpc/platforms/85xx/p2040_rdb.c | 88 =
-------------------
> arch/powerpc/platforms/85xx/p3041_ds.c | 90 =
--------------------
> .../platforms/85xx/{p4080_ds.c =3D> qoriq_dpa_ds.c} | 24 +++--
> 5 files changed, 20 insertions(+), 218 deletions(-)
> delete mode 100644 arch/powerpc/platforms/85xx/p2040_rdb.c
> delete mode 100644 arch/powerpc/platforms/85xx/p3041_ds.c
> rename arch/powerpc/platforms/85xx/{p4080_ds.c =3D> qoriq_dpa_ds.c} =
(72%)
NAK, there are other reasons these are split like they are today.
- k=
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 12/14] 85xx/mpc85xx_ds, ads, cds: move .pci_exclude_device setting to machine definitions
2011-07-19 8:53 [PATCH 00/14] Consolidation of 83xx/85xx board files Dmitry Eremin-Solenikov
` (10 preceding siblings ...)
2011-07-19 8:53 ` [PATCH 11/14] 85xx: merge 32-bit QorIQ with DPA boards support Dmitry Eremin-Solenikov
@ 2011-07-19 8:53 ` Dmitry Eremin-Solenikov
2011-07-19 13:59 ` Kumar Gala
2011-07-19 8:53 ` [PATCH 13/14] 85xx: consolidate of_platform_bus_probe calls Dmitry Eremin-Solenikov
` (3 subsequent siblings)
15 siblings, 1 reply; 40+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-07-19 8:53 UTC (permalink / raw)
To: Linux PPC Development; +Cc: Paul Mackerras
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/powerpc/platforms/85xx/mpc85xx_ads.c | 5 +++--
arch/powerpc/platforms/85xx/mpc85xx_cds.c | 5 ++---
arch/powerpc/platforms/85xx/mpc85xx_ds.c | 5 +++--
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index 3b2c9bb..2483929 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -200,8 +200,6 @@ static void __init mpc85xx_ads_setup_arch(void)
#ifdef CONFIG_PCI
for_each_compatible_node(np, "pci", "fsl,mpc8540-pci")
fsl_add_bridge(np, 1);
-
- ppc_md.pci_exclude_device = mpc85xx_exclude_device;
#endif
}
@@ -254,6 +252,9 @@ define_machine(mpc85xx_ads) {
.probe = mpc85xx_ads_probe,
.setup_arch = mpc85xx_ads_setup_arch,
.init_IRQ = mpc85xx_ads_pic_init,
+#ifdef CONFIG_PCI
+ .pci_exclude_device = mpc85xx_exclude_device,
+#endif
.show_cpuinfo = mpc85xx_ads_show_cpuinfo,
.get_irq = mpic_get_irq,
.restart = fsl_rstcr_restart,
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index 6299a2a..e209c23 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -297,9 +297,6 @@ static void __init mpc85xx_cds_setup_arch(void)
fsl_add_bridge(np, 0);
}
}
-
- ppc_md.pci_irq_fixup = mpc85xx_cds_pci_irq_fixup;
- ppc_md.pci_exclude_device = mpc85xx_exclude_device;
#endif
}
@@ -355,6 +352,8 @@ define_machine(mpc85xx_cds) {
#ifdef CONFIG_PCI
.restart = mpc85xx_cds_restart,
.pcibios_fixup_bus = fsl_pcibios_fixup_bus,
+ .pci_irq_fixup = mpc85xx_cds_pci_irq_fixup,
+ .pci_exclude_device = mpc85xx_exclude_device,
#else
.restart = fsl_rstcr_restart,
#endif
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
index c7b97f7..53bf07d 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
@@ -182,8 +182,6 @@ static void __init mpc85xx_ds_setup_arch(void)
hose->dma_window_size);
}
}
-
- ppc_md.pci_exclude_device = mpc85xx_exclude_device;
#endif
#ifdef CONFIG_SMP
@@ -279,6 +277,7 @@ define_machine(mpc8544_ds) {
.init_IRQ = mpc85xx_ds_pic_init,
#ifdef CONFIG_PCI
.pcibios_fixup_bus = fsl_pcibios_fixup_bus,
+ .pci_exclude_device = mpc85xx_exclude_device,
#endif
.get_irq = mpic_get_irq,
.restart = fsl_rstcr_restart,
@@ -293,6 +292,7 @@ define_machine(mpc8572_ds) {
.init_IRQ = mpc85xx_ds_pic_init,
#ifdef CONFIG_PCI
.pcibios_fixup_bus = fsl_pcibios_fixup_bus,
+ .pci_exclude_device = mpc85xx_exclude_device,
#endif
.get_irq = mpic_get_irq,
.restart = fsl_rstcr_restart,
@@ -307,6 +307,7 @@ define_machine(p2020_ds) {
.init_IRQ = mpc85xx_ds_pic_init,
#ifdef CONFIG_PCI
.pcibios_fixup_bus = fsl_pcibios_fixup_bus,
+ .pci_exclude_device = mpc85xx_exclude_device,
#endif
.get_irq = mpic_get_irq,
.restart = fsl_rstcr_restart,
--
1.7.2.5
^ permalink raw reply related [flat|nested] 40+ messages in thread
* Re: [PATCH 12/14] 85xx/mpc85xx_ds, ads, cds: move .pci_exclude_device setting to machine definitions
2011-07-19 8:53 ` [PATCH 12/14] 85xx/mpc85xx_ds, ads, cds: move .pci_exclude_device setting to machine definitions Dmitry Eremin-Solenikov
@ 2011-07-19 13:59 ` Kumar Gala
2011-07-22 20:08 ` [PATCH 12/14] 85xx/mpc85xx_ds,ads,cds: " Dmitry Eremin-Solenikov
0 siblings, 1 reply; 40+ messages in thread
From: Kumar Gala @ 2011-07-19 13:59 UTC (permalink / raw)
To: Dmitry Eremin-Solenikov; +Cc: Linux PPC Development, Paul Mackerras
On Jul 19, 2011, at 3:53 AM, Dmitry Eremin-Solenikov wrote:
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
> arch/powerpc/platforms/85xx/mpc85xx_ads.c | 5 +++--
> arch/powerpc/platforms/85xx/mpc85xx_cds.c | 5 ++---
> arch/powerpc/platforms/85xx/mpc85xx_ds.c | 5 +++--
> 3 files changed, 8 insertions(+), 7 deletions(-)
I believe these are done this way for a reason (its been some time). I =
can't remember if it maters or not, but having pci_exclude_device() =
means that any code in fsl_add_bridge() would not be impacted by the =
exclude function.
Not sure what value making this change has at this point.
- k
>=20
> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c =
b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
> index 3b2c9bb..2483929 100644
> --- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
> +++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
> @@ -200,8 +200,6 @@ static void __init mpc85xx_ads_setup_arch(void)
> #ifdef CONFIG_PCI
> for_each_compatible_node(np, "pci", "fsl,mpc8540-pci")
> fsl_add_bridge(np, 1);
> -
> - ppc_md.pci_exclude_device =3D mpc85xx_exclude_device;
> #endif
> }
>=20
> @@ -254,6 +252,9 @@ define_machine(mpc85xx_ads) {
> .probe =3D mpc85xx_ads_probe,
> .setup_arch =3D mpc85xx_ads_setup_arch,
> .init_IRQ =3D mpc85xx_ads_pic_init,
> +#ifdef CONFIG_PCI
> + .pci_exclude_device =3D mpc85xx_exclude_device,
> +#endif
> .show_cpuinfo =3D mpc85xx_ads_show_cpuinfo,
> .get_irq =3D mpic_get_irq,
> .restart =3D fsl_rstcr_restart,
> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c =
b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
> index 6299a2a..e209c23 100644
> --- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
> +++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
> @@ -297,9 +297,6 @@ static void __init mpc85xx_cds_setup_arch(void)
> fsl_add_bridge(np, 0);
> }
> }
> -
> - ppc_md.pci_irq_fixup =3D mpc85xx_cds_pci_irq_fixup;
> - ppc_md.pci_exclude_device =3D mpc85xx_exclude_device;
> #endif
> }
>=20
> @@ -355,6 +352,8 @@ define_machine(mpc85xx_cds) {
> #ifdef CONFIG_PCI
> .restart =3D mpc85xx_cds_restart,
> .pcibios_fixup_bus =3D fsl_pcibios_fixup_bus,
> + .pci_irq_fixup =3D mpc85xx_cds_pci_irq_fixup,
> + .pci_exclude_device =3D mpc85xx_exclude_device,
> #else
> .restart =3D fsl_rstcr_restart,
> #endif
> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c =
b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
> index c7b97f7..53bf07d 100644
> --- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
> +++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
> @@ -182,8 +182,6 @@ static void __init mpc85xx_ds_setup_arch(void)
> hose->dma_window_size);
> }
> }
> -
> - ppc_md.pci_exclude_device =3D mpc85xx_exclude_device;
> #endif
>=20
> #ifdef CONFIG_SMP
> @@ -279,6 +277,7 @@ define_machine(mpc8544_ds) {
> .init_IRQ =3D mpc85xx_ds_pic_init,
> #ifdef CONFIG_PCI
> .pcibios_fixup_bus =3D fsl_pcibios_fixup_bus,
> + .pci_exclude_device =3D mpc85xx_exclude_device,
> #endif
> .get_irq =3D mpic_get_irq,
> .restart =3D fsl_rstcr_restart,
> @@ -293,6 +292,7 @@ define_machine(mpc8572_ds) {
> .init_IRQ =3D mpc85xx_ds_pic_init,
> #ifdef CONFIG_PCI
> .pcibios_fixup_bus =3D fsl_pcibios_fixup_bus,
> + .pci_exclude_device =3D mpc85xx_exclude_device,
> #endif
> .get_irq =3D mpic_get_irq,
> .restart =3D fsl_rstcr_restart,
> @@ -307,6 +307,7 @@ define_machine(p2020_ds) {
> .init_IRQ =3D mpc85xx_ds_pic_init,
> #ifdef CONFIG_PCI
> .pcibios_fixup_bus =3D fsl_pcibios_fixup_bus,
> + .pci_exclude_device =3D mpc85xx_exclude_device,
> #endif
> .get_irq =3D mpic_get_irq,
> .restart =3D fsl_rstcr_restart,
> --=20
> 1.7.2.5
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 12/14] 85xx/mpc85xx_ds,ads,cds: move .pci_exclude_device setting to machine definitions
2011-07-19 13:59 ` Kumar Gala
@ 2011-07-22 20:08 ` Dmitry Eremin-Solenikov
0 siblings, 0 replies; 40+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-07-22 20:08 UTC (permalink / raw)
To: Kumar Gala; +Cc: Linux PPC Development, Paul Mackerras
On 7/19/11, Kumar Gala <galak@kernel.crashing.org> wrote:
>
> On Jul 19, 2011, at 3:53 AM, Dmitry Eremin-Solenikov wrote:
>
>> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
>> ---
>> arch/powerpc/platforms/85xx/mpc85xx_ads.c | 5 +++--
>> arch/powerpc/platforms/85xx/mpc85xx_cds.c | 5 ++---
>> arch/powerpc/platforms/85xx/mpc85xx_ds.c | 5 +++--
>> 3 files changed, 8 insertions(+), 7 deletions(-)
>
> I believe these are done this way for a reason (its been some time). I
> can't remember if it maters or not, but having pci_exclude_device() means
> that any code in fsl_add_bridge() would not be impacted by the exclude
> function.
Hmm. I have to check this.
BTW: what is the point in disabling access to bus == 0 && PCI_SLOT == 0 on some
of those boards (esp. ads)? Other boards lack this check/exclude. Does it mean
something historical (and so can be dropped), is it some workaround/bugfix
(then it should be propagated to other boards??) or something else?
>
> Not sure what value making this change has at this point.
One of my big goals is to drop most of differencies from setup_arch functions
(one simple function can handle all things like PCI, SWIOTLB, etc).
Not yet ready
for submission though (not enough time to clean all the things). And moving
this assignment to static code would allow me to drop setup_arch()
function completely
(more or less) on these boards.
>
> - k
>
>>
>> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
>> b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
>> index 3b2c9bb..2483929 100644
>> --- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
>> +++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
>> @@ -200,8 +200,6 @@ static void __init mpc85xx_ads_setup_arch(void)
>> #ifdef CONFIG_PCI
>> for_each_compatible_node(np, "pci", "fsl,mpc8540-pci")
>> fsl_add_bridge(np, 1);
>> -
>> - ppc_md.pci_exclude_device = mpc85xx_exclude_device;
>> #endif
>> }
>>
>> @@ -254,6 +252,9 @@ define_machine(mpc85xx_ads) {
>> .probe = mpc85xx_ads_probe,
>> .setup_arch = mpc85xx_ads_setup_arch,
>> .init_IRQ = mpc85xx_ads_pic_init,
>> +#ifdef CONFIG_PCI
>> + .pci_exclude_device = mpc85xx_exclude_device,
>> +#endif
>> .show_cpuinfo = mpc85xx_ads_show_cpuinfo,
>> .get_irq = mpic_get_irq,
>> .restart = fsl_rstcr_restart,
>> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
>> b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
>> index 6299a2a..e209c23 100644
>> --- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
>> +++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
>> @@ -297,9 +297,6 @@ static void __init mpc85xx_cds_setup_arch(void)
>> fsl_add_bridge(np, 0);
>> }
>> }
>> -
>> - ppc_md.pci_irq_fixup = mpc85xx_cds_pci_irq_fixup;
>> - ppc_md.pci_exclude_device = mpc85xx_exclude_device;
>> #endif
>> }
>>
>> @@ -355,6 +352,8 @@ define_machine(mpc85xx_cds) {
>> #ifdef CONFIG_PCI
>> .restart = mpc85xx_cds_restart,
>> .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
>> + .pci_irq_fixup = mpc85xx_cds_pci_irq_fixup,
>> + .pci_exclude_device = mpc85xx_exclude_device,
>> #else
>> .restart = fsl_rstcr_restart,
>> #endif
>> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
>> b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
>> index c7b97f7..53bf07d 100644
>> --- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
>> +++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
>> @@ -182,8 +182,6 @@ static void __init mpc85xx_ds_setup_arch(void)
>> hose->dma_window_size);
>> }
>> }
>> -
>> - ppc_md.pci_exclude_device = mpc85xx_exclude_device;
>> #endif
>>
>> #ifdef CONFIG_SMP
>> @@ -279,6 +277,7 @@ define_machine(mpc8544_ds) {
>> .init_IRQ = mpc85xx_ds_pic_init,
>> #ifdef CONFIG_PCI
>> .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
>> + .pci_exclude_device = mpc85xx_exclude_device,
>> #endif
>> .get_irq = mpic_get_irq,
>> .restart = fsl_rstcr_restart,
>> @@ -293,6 +292,7 @@ define_machine(mpc8572_ds) {
>> .init_IRQ = mpc85xx_ds_pic_init,
>> #ifdef CONFIG_PCI
>> .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
>> + .pci_exclude_device = mpc85xx_exclude_device,
>> #endif
>> .get_irq = mpic_get_irq,
>> .restart = fsl_rstcr_restart,
>> @@ -307,6 +307,7 @@ define_machine(p2020_ds) {
>> .init_IRQ = mpc85xx_ds_pic_init,
>> #ifdef CONFIG_PCI
>> .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
>> + .pci_exclude_device = mpc85xx_exclude_device,
>> #endif
>> .get_irq = mpic_get_irq,
>> .restart = fsl_rstcr_restart,
>> --
>> 1.7.2.5
>
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 13/14] 85xx: consolidate of_platform_bus_probe calls
2011-07-19 8:53 [PATCH 00/14] Consolidation of 83xx/85xx board files Dmitry Eremin-Solenikov
` (11 preceding siblings ...)
2011-07-19 8:53 ` [PATCH 12/14] 85xx/mpc85xx_ds, ads, cds: move .pci_exclude_device setting to machine definitions Dmitry Eremin-Solenikov
@ 2011-07-19 8:53 ` Dmitry Eremin-Solenikov
2011-07-19 14:15 ` Kumar Gala
2011-07-19 17:54 ` Scott Wood
2011-07-19 8:53 ` [PATCH 14/14] 85xx: separate cpm2 pic init Dmitry Eremin-Solenikov
` (2 subsequent siblings)
15 siblings, 2 replies; 40+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-07-19 8:53 UTC (permalink / raw)
To: Linux PPC Development; +Cc: Paul Mackerras
85xx board files have a lot of duplication in *_publish_devices()/
*_declare_of_platform_devices() functions. Merge that into a single
function common to most of the boards.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/powerpc/platforms/85xx/Makefile | 2 +
arch/powerpc/platforms/85xx/ksi8560.c | 18 +---------
arch/powerpc/platforms/85xx/mpc8536_ds.c | 16 ++-------
arch/powerpc/platforms/85xx/mpc85xx.h | 4 ++
arch/powerpc/platforms/85xx/mpc85xx_ads.c | 20 ++---------
arch/powerpc/platforms/85xx/mpc85xx_cds.c | 16 ++-------
arch/powerpc/platforms/85xx/mpc85xx_common.c | 26 ++++++++++++++
arch/powerpc/platforms/85xx/mpc85xx_ds.c | 20 +++--------
arch/powerpc/platforms/85xx/mpc85xx_mds.c | 46 ++-----------------------
arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 16 ++-------
arch/powerpc/platforms/85xx/p1022_ds.c | 7 ++--
arch/powerpc/platforms/85xx/sbc8548.c | 18 ++--------
arch/powerpc/platforms/85xx/sbc8560.c | 20 ++---------
arch/powerpc/platforms/85xx/socrates.c | 13 +------
arch/powerpc/platforms/85xx/stx_gp3.c | 16 ++-------
arch/powerpc/platforms/85xx/tqm85xx.c | 16 ++-------
arch/powerpc/platforms/85xx/xes_mpc85xx.c | 20 +++--------
17 files changed, 77 insertions(+), 217 deletions(-)
create mode 100644 arch/powerpc/platforms/85xx/mpc85xx.h
create mode 100644 arch/powerpc/platforms/85xx/mpc85xx_common.c
diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile
index 43b2162..ca4b1b9 100644
--- a/arch/powerpc/platforms/85xx/Makefile
+++ b/arch/powerpc/platforms/85xx/Makefile
@@ -3,6 +3,8 @@
#
obj-$(CONFIG_SMP) += smp.o
+obj-y += mpc85xx_common.o
+
obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads.o
obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o
obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o
diff --git a/arch/powerpc/platforms/85xx/ksi8560.c b/arch/powerpc/platforms/85xx/ksi8560.c
index c46f935..7657e1a 100644
--- a/arch/powerpc/platforms/85xx/ksi8560.c
+++ b/arch/powerpc/platforms/85xx/ksi8560.c
@@ -35,6 +35,7 @@
#include <asm/cpm2.h>
#include <sysdev/cpm2_pic.h>
+#include "mpc85xx.h"
#define KSI8560_CPLD_HVR 0x04 /* Hardware Version Register */
#define KSI8560_CPLD_PVR 0x08 /* PLD Version Register */
@@ -215,22 +216,7 @@ static void ksi8560_show_cpuinfo(struct seq_file *m)
seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
}
-static struct of_device_id __initdata of_bus_ids[] = {
- { .type = "soc", },
- { .type = "simple-bus", },
- { .name = "cpm", },
- { .name = "localbus", },
- { .compatible = "gianfar", },
- {},
-};
-
-static int __init declare_of_platform_devices(void)
-{
- of_platform_bus_probe(NULL, of_bus_ids, NULL);
-
- return 0;
-}
-machine_device_initcall(ksi8560, declare_of_platform_devices);
+machine_device_initcall(ksi8560, mpc85xx_common_publish_devices);
/*
* Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/85xx/mpc8536_ds.c b/arch/powerpc/platforms/85xx/mpc8536_ds.c
index f79f2f1..9ee6455 100644
--- a/arch/powerpc/platforms/85xx/mpc8536_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc8536_ds.c
@@ -32,6 +32,8 @@
#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
+#include "mpc85xx.h"
+
void __init mpc8536_ds_pic_init(void)
{
struct mpic *mpic;
@@ -104,19 +106,7 @@ static void __init mpc8536_ds_setup_arch(void)
printk("MPC8536 DS board from Freescale Semiconductor\n");
}
-static struct of_device_id __initdata mpc8536_ds_ids[] = {
- { .type = "soc", },
- { .compatible = "soc", },
- { .compatible = "simple-bus", },
- { .compatible = "gianfar", },
- {},
-};
-
-static int __init mpc8536_ds_publish_devices(void)
-{
- return of_platform_bus_probe(NULL, mpc8536_ds_ids, NULL);
-}
-machine_device_initcall(mpc8536_ds, mpc8536_ds_publish_devices);
+machine_device_initcall(mpc8536_ds, mpc85xx_common_publish_devices);
machine_arch_initcall(mpc8536_ds, swiotlb_setup_bus_notifier);
diff --git a/arch/powerpc/platforms/85xx/mpc85xx.h b/arch/powerpc/platforms/85xx/mpc85xx.h
new file mode 100644
index 0000000..1a1b4eb
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/mpc85xx.h
@@ -0,0 +1,4 @@
+#ifndef MPC85xx_H
+#define MPC85xx_H
+extern int mpc85xx_common_publish_devices(void);
+#endif
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index 2483929..3bc2acc 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -35,6 +35,8 @@
#include <sysdev/cpm2_pic.h>
#endif
+#include "mpc85xx.h"
+
#ifdef CONFIG_PCI
static int mpc85xx_exclude_device(struct pci_controller *hose,
u_char bus, u_char devfn)
@@ -219,23 +221,7 @@ static void mpc85xx_ads_show_cpuinfo(struct seq_file *m)
seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
}
-static struct of_device_id __initdata of_bus_ids[] = {
- { .name = "soc", },
- { .type = "soc", },
- { .name = "cpm", },
- { .name = "localbus", },
- { .compatible = "simple-bus", },
- { .compatible = "gianfar", },
- {},
-};
-
-static int __init declare_of_platform_devices(void)
-{
- of_platform_bus_probe(NULL, of_bus_ids, NULL);
-
- return 0;
-}
-machine_device_initcall(mpc85xx_ads, declare_of_platform_devices);
+machine_device_initcall(mpc85xx_ads, mpc85xx_common_publish_devices);
/*
* Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index e209c23..281ecc5 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -47,6 +47,8 @@
#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
+#include "mpc85xx.h"
+
/* CADMUS info */
/* xxx - galak, move into device tree */
#define CADMUS_BASE (0xf8004000)
@@ -328,19 +330,7 @@ static int __init mpc85xx_cds_probe(void)
return of_flat_dt_is_compatible(root, "MPC85xxCDS");
}
-static struct of_device_id __initdata of_bus_ids[] = {
- { .type = "soc", },
- { .compatible = "soc", },
- { .compatible = "simple-bus", },
- { .compatible = "gianfar", },
- {},
-};
-
-static int __init declare_of_platform_devices(void)
-{
- return of_platform_bus_probe(NULL, of_bus_ids, NULL);
-}
-machine_device_initcall(mpc85xx_cds, declare_of_platform_devices);
+machine_device_initcall(mpc85xx_cds, mpc85xx_common_publish_devices);
define_machine(mpc85xx_cds) {
.name = "MPC85xx CDS",
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_common.c b/arch/powerpc/platforms/85xx/mpc85xx_common.c
new file mode 100644
index 0000000..999567a
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/mpc85xx_common.c
@@ -0,0 +1,26 @@
+/*
+ * Routines common to most mpc85xx-based boards.
+ *
+ * This is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <linux/kernel.h>
+#include <linux/of_platform.h>
+
+#include "mpc85xx.h"
+
+static struct of_device_id __initdata mpc85xx_common_ids[] = {
+ { .type = "soc", },
+ { .compatible = "soc", },
+ { .compatible = "simple-bus", },
+ { .compatible = "gianfar", },
+ { .compatible = "fsl,qe", },
+ { .compatible = "fsl,cpm2", },
+ {},
+};
+
+int __init mpc85xx_common_publish_devices(void)
+{
+ return of_platform_bus_probe(NULL, mpc85xx_common_ids, NULL);
+}
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
index 53bf07d..7a0b728 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
@@ -36,6 +36,8 @@
#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
+#include "mpc85xx.h"
+
#undef DEBUG
#ifdef DEBUG
@@ -216,21 +218,9 @@ static int __init mpc8544_ds_probe(void)
return 0;
}
-static struct of_device_id __initdata mpc85xxds_ids[] = {
- { .type = "soc", },
- { .compatible = "soc", },
- { .compatible = "simple-bus", },
- { .compatible = "gianfar", },
- {},
-};
-
-static int __init mpc85xxds_publish_devices(void)
-{
- return of_platform_bus_probe(NULL, mpc85xxds_ids, NULL);
-}
-machine_device_initcall(mpc8544_ds, mpc85xxds_publish_devices);
-machine_device_initcall(mpc8572_ds, mpc85xxds_publish_devices);
-machine_device_initcall(p2020_ds, mpc85xxds_publish_devices);
+machine_device_initcall(mpc8544_ds, mpc85xx_common_publish_devices);
+machine_device_initcall(mpc8572_ds, mpc85xx_common_publish_devices);
+machine_device_initcall(p2020_ds, mpc85xx_common_publish_devices);
machine_arch_initcall(mpc8544_ds, swiotlb_setup_bus_notifier);
machine_arch_initcall(mpc8572_ds, swiotlb_setup_bus_notifier);
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index 747d1ee..fde37e5 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -53,6 +53,8 @@
#include <asm/mpic.h>
#include <asm/swiotlb.h>
+#include "mpc85xx.h"
+
#undef DEBUG
#ifdef DEBUG
#define DBG(fmt...) udbg_printf(fmt)
@@ -159,25 +161,6 @@ extern void __init mpc85xx_smp_init(void);
#endif
#ifdef CONFIG_QUICC_ENGINE
-static struct of_device_id mpc85xx_qe_ids[] __initdata = {
- { .type = "qe", },
- { .compatible = "fsl,qe", },
- { },
-};
-
-static void __init mpc85xx_publish_qe_devices(void)
-{
- struct device_node *np;
-
- np = of_find_compatible_node(NULL, NULL, "fsl,qe");
- if (!of_device_is_available(np)) {
- of_node_put(np);
- return;
- }
-
- of_platform_bus_probe(NULL, mpc85xx_qe_ids, NULL);
-}
-
static void __init mpc85xx_mds_reset_ucc_phys(void)
{
struct device_node *np;
@@ -348,7 +331,6 @@ static void __init mpc85xx_mds_qeic_init(void)
of_node_put(np);
}
#else
-static void __init mpc85xx_publish_qe_devices(void) { }
static void __init mpc85xx_mds_qe_init(void) { }
static void __init mpc85xx_mds_qeic_init(void) { }
#endif /* CONFIG_QUICC_ENGINE */
@@ -430,24 +412,12 @@ machine_arch_initcall(mpc8568_mds, board_fixups);
machine_arch_initcall(mpc8569_mds, board_fixups);
static struct of_device_id mpc85xx_ids[] = {
- { .type = "soc", },
- { .compatible = "soc", },
- { .compatible = "simple-bus", },
- { .compatible = "gianfar", },
{ .compatible = "fsl,rapidio-delta", },
{ .compatible = "fsl,mpc8548-guts", },
{ .compatible = "gpio-leds", },
{},
};
-static struct of_device_id p1021_ids[] = {
- { .type = "soc", },
- { .compatible = "soc", },
- { .compatible = "simple-bus", },
- { .compatible = "gianfar", },
- {},
-};
-
static int __init mpc85xx_publish_devices(void)
{
if (machine_is(mpc8568_mds))
@@ -455,23 +425,15 @@ static int __init mpc85xx_publish_devices(void)
if (machine_is(mpc8569_mds))
simple_gpiochip_init("fsl,mpc8569mds-bcsr-gpio");
+ mpc85xx_common_publish_devices();
of_platform_bus_probe(NULL, mpc85xx_ids, NULL);
- mpc85xx_publish_qe_devices();
-
- return 0;
-}
-
-static int __init p1021_publish_devices(void)
-{
- of_platform_bus_probe(NULL, p1021_ids, NULL);
- mpc85xx_publish_qe_devices();
return 0;
}
machine_device_initcall(mpc8568_mds, mpc85xx_publish_devices);
machine_device_initcall(mpc8569_mds, mpc85xx_publish_devices);
-machine_device_initcall(p1021_mds, p1021_publish_devices);
+machine_device_initcall(p1021_mds, mpc85xx_common_publish_devices);
machine_arch_initcall(mpc8568_mds, swiotlb_setup_bus_notifier);
machine_arch_initcall(mpc8569_mds, swiotlb_setup_bus_notifier);
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
index 7a3a37b..5846025 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
@@ -30,6 +30,8 @@
#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
+#include "mpc85xx.h"
+
#undef DEBUG
#ifdef DEBUG
@@ -108,19 +110,7 @@ static void __init mpc85xx_rdb_setup_arch(void)
printk(KERN_INFO "MPC85xx RDB board from Freescale Semiconductor\n");
}
-static struct of_device_id __initdata mpc85xxrdb_ids[] = {
- { .type = "soc", },
- { .compatible = "soc", },
- { .compatible = "simple-bus", },
- { .compatible = "gianfar", },
- {},
-};
-
-static int __init mpc85xxrdb_publish_devices(void)
-{
- return of_platform_bus_probe(NULL, mpc85xxrdb_ids, NULL);
-}
-machine_device_initcall(mpc85xx_rdb, mpc85xxrdb_publish_devices);
+machine_device_initcall(mpc85xx_rdb, mpc85xx_common_publish_devices);
/*
* Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/85xx/p1022_ds.c b/arch/powerpc/platforms/85xx/p1022_ds.c
index 266b3aa..26e6f75 100644
--- a/arch/powerpc/platforms/85xx/p1022_ds.c
+++ b/arch/powerpc/platforms/85xx/p1022_ds.c
@@ -27,6 +27,8 @@
#include <sysdev/fsl_pci.h>
#include <asm/fsl_guts.h>
+#include "mpc85xx.h"
+
#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
/*
@@ -325,10 +327,6 @@ static void __init p1022_ds_setup_arch(void)
}
static struct of_device_id __initdata p1022_ds_ids[] = {
- { .type = "soc", },
- { .compatible = "soc", },
- { .compatible = "simple-bus", },
- { .compatible = "gianfar", },
/* So that the DMA channel nodes can be probed individually: */
{ .compatible = "fsl,eloplus-dma", },
{},
@@ -338,6 +336,7 @@ static int __init p1022_ds_publish_devices(void)
{
return of_platform_bus_probe(NULL, p1022_ds_ids, NULL);
}
+machine_device_initcall(p1022_ds, mpc85xx_common_publish_devices);
machine_device_initcall(p1022_ds, p1022_ds_publish_devices);
machine_arch_initcall(p1022_ds, swiotlb_setup_bus_notifier);
diff --git a/arch/powerpc/platforms/85xx/sbc8548.c b/arch/powerpc/platforms/85xx/sbc8548.c
index 2eeb376..42343ac 100644
--- a/arch/powerpc/platforms/85xx/sbc8548.c
+++ b/arch/powerpc/platforms/85xx/sbc8548.c
@@ -49,6 +49,8 @@
#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
+#include "mpc85xx.h"
+
static int sbc_rev = -EINVAL;
static void __init sbc8548_pic_init(void)
@@ -152,21 +154,7 @@ static void sbc8548_show_cpuinfo(struct seq_file *m)
seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
}
-static struct of_device_id __initdata of_bus_ids[] = {
- { .name = "soc", },
- { .type = "soc", },
- { .compatible = "simple-bus", },
- { .compatible = "gianfar", },
- {},
-};
-
-static int __init declare_of_platform_devices(void)
-{
- of_platform_bus_probe(NULL, of_bus_ids, NULL);
-
- return 0;
-}
-machine_device_initcall(sbc8548, declare_of_platform_devices);
+machine_device_initcall(sbc8548, mpc85xx_common_publish_devices);
/*
* Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/85xx/sbc8560.c b/arch/powerpc/platforms/85xx/sbc8560.c
index 678f5a8..bbb656f 100644
--- a/arch/powerpc/platforms/85xx/sbc8560.c
+++ b/arch/powerpc/platforms/85xx/sbc8560.c
@@ -37,6 +37,8 @@
#include <sysdev/cpm2_pic.h>
#endif
+#include "mpc85xx.h"
+
#ifdef CONFIG_CPM2
static void cpm2_cascade(unsigned int irq, struct irq_desc *desc)
@@ -208,23 +210,7 @@ static void sbc8560_show_cpuinfo(struct seq_file *m)
seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
}
-static struct of_device_id __initdata of_bus_ids[] = {
- { .name = "soc", },
- { .type = "soc", },
- { .name = "cpm", },
- { .name = "localbus", },
- { .compatible = "simple-bus", },
- { .compatible = "gianfar", },
- {},
-};
-
-static int __init declare_of_platform_devices(void)
-{
- of_platform_bus_probe(NULL, of_bus_ids, NULL);
-
- return 0;
-}
-machine_device_initcall(sbc8560, declare_of_platform_devices);
+machine_device_initcall(sbc8560, mpc85xx_common_publish_devices);
/*
* Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/85xx/socrates.c b/arch/powerpc/platforms/85xx/socrates.c
index 747d8fb..fec496a 100644
--- a/arch/powerpc/platforms/85xx/socrates.c
+++ b/arch/powerpc/platforms/85xx/socrates.c
@@ -41,6 +41,7 @@
#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
+#include "mpc85xx.h"
#include "socrates_fpga_pic.h"
static void __init socrates_pic_init(void)
@@ -96,17 +97,7 @@ static void __init socrates_setup_arch(void)
#endif
}
-static struct of_device_id __initdata socrates_of_bus_ids[] = {
- { .compatible = "simple-bus", },
- { .compatible = "gianfar", },
- {},
-};
-
-static int __init socrates_publish_devices(void)
-{
- return of_platform_bus_probe(NULL, socrates_of_bus_ids, NULL);
-}
-machine_device_initcall(socrates, socrates_publish_devices);
+machine_device_initcall(socrates, mpc85xx_common_publish_devices);
/*
* Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/85xx/stx_gp3.c b/arch/powerpc/platforms/85xx/stx_gp3.c
index 5387e9f..ab80044 100644
--- a/arch/powerpc/platforms/85xx/stx_gp3.c
+++ b/arch/powerpc/platforms/85xx/stx_gp3.c
@@ -40,6 +40,8 @@
#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
+#include "mpc85xx.h"
+
#ifdef CONFIG_CPM2
#include <asm/cpm2.h>
#include <sysdev/cpm2_pic.h>
@@ -144,19 +146,7 @@ static void stx_gp3_show_cpuinfo(struct seq_file *m)
seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
}
-static struct of_device_id __initdata of_bus_ids[] = {
- { .compatible = "simple-bus", },
- { .compatible = "gianfar", },
- {},
-};
-
-static int __init declare_of_platform_devices(void)
-{
- of_platform_bus_probe(NULL, of_bus_ids, NULL);
-
- return 0;
-}
-machine_device_initcall(stx_gp3, declare_of_platform_devices);
+machine_device_initcall(stx_gp3, mpc85xx_common_publish_devices);
/*
* Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/85xx/tqm85xx.c b/arch/powerpc/platforms/85xx/tqm85xx.c
index 325de77..19e711f 100644
--- a/arch/powerpc/platforms/85xx/tqm85xx.c
+++ b/arch/powerpc/platforms/85xx/tqm85xx.c
@@ -38,6 +38,8 @@
#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
+#include "mpc85xx.h"
+
#ifdef CONFIG_CPM2
#include <asm/cpm2.h>
#include <sysdev/cpm2_pic.h>
@@ -173,19 +175,7 @@ static void __init tqm85xx_ti1520_fixup(struct pci_dev *pdev)
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1520,
tqm85xx_ti1520_fixup);
-static struct of_device_id __initdata of_bus_ids[] = {
- { .compatible = "simple-bus", },
- { .compatible = "gianfar", },
- {},
-};
-
-static int __init declare_of_platform_devices(void)
-{
- of_platform_bus_probe(NULL, of_bus_ids, NULL);
-
- return 0;
-}
-machine_device_initcall(tqm85xx, declare_of_platform_devices);
+machine_device_initcall(tqm85xx, mpc85xx_common_publish_devices);
static const char *board[] __initdata = {
"tqc,tqm8540",
diff --git a/arch/powerpc/platforms/85xx/xes_mpc85xx.c b/arch/powerpc/platforms/85xx/xes_mpc85xx.c
index 0125604..0ee3721 100644
--- a/arch/powerpc/platforms/85xx/xes_mpc85xx.c
+++ b/arch/powerpc/platforms/85xx/xes_mpc85xx.c
@@ -33,6 +33,8 @@
#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
+#include "mpc85xx.h"
+
/* A few bit definitions needed for fixups on some boards */
#define MPC85xx_L2CTL_L2E 0x80000000 /* L2 enable */
#define MPC85xx_L2CTL_L2I 0x40000000 /* L2 flash invalidate */
@@ -177,21 +179,9 @@ static void __init xes_mpc85xx_setup_arch(void)
#endif
}
-static struct of_device_id __initdata xes_mpc85xx_ids[] = {
- { .type = "soc", },
- { .compatible = "soc", },
- { .compatible = "simple-bus", },
- { .compatible = "gianfar", },
- {},
-};
-
-static int __init xes_mpc85xx_publish_devices(void)
-{
- return of_platform_bus_probe(NULL, xes_mpc85xx_ids, NULL);
-}
-machine_device_initcall(xes_mpc8572, xes_mpc85xx_publish_devices);
-machine_device_initcall(xes_mpc8548, xes_mpc85xx_publish_devices);
-machine_device_initcall(xes_mpc8540, xes_mpc85xx_publish_devices);
+machine_device_initcall(xes_mpc8572, mpc85xx_common_publish_devices);
+machine_device_initcall(xes_mpc8548, mpc85xx_common_publish_devices);
+machine_device_initcall(xes_mpc8540, mpc85xx_common_publish_devices);
/*
* Called very early, device-tree isn't unflattened
--
1.7.2.5
^ permalink raw reply related [flat|nested] 40+ messages in thread
* Re: [PATCH 13/14] 85xx: consolidate of_platform_bus_probe calls
2011-07-19 8:53 ` [PATCH 13/14] 85xx: consolidate of_platform_bus_probe calls Dmitry Eremin-Solenikov
@ 2011-07-19 14:15 ` Kumar Gala
2011-07-19 17:54 ` Scott Wood
1 sibling, 0 replies; 40+ messages in thread
From: Kumar Gala @ 2011-07-19 14:15 UTC (permalink / raw)
To: Dmitry Eremin-Solenikov; +Cc: Linux PPC Development, Paul Mackerras
On Jul 19, 2011, at 3:53 AM, Dmitry Eremin-Solenikov wrote:
> 85xx board files have a lot of duplication in *_publish_devices()/
> *_declare_of_platform_devices() functions. Merge that into a single
> function common to most of the boards.
>=20
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
> arch/powerpc/platforms/85xx/Makefile | 2 +
> arch/powerpc/platforms/85xx/ksi8560.c | 18 +---------
> arch/powerpc/platforms/85xx/mpc8536_ds.c | 16 ++-------
> arch/powerpc/platforms/85xx/mpc85xx.h | 4 ++
> arch/powerpc/platforms/85xx/mpc85xx_ads.c | 20 ++---------
> arch/powerpc/platforms/85xx/mpc85xx_cds.c | 16 ++-------
> arch/powerpc/platforms/85xx/mpc85xx_common.c | 26 ++++++++++++++
> arch/powerpc/platforms/85xx/mpc85xx_ds.c | 20 +++--------
> arch/powerpc/platforms/85xx/mpc85xx_mds.c | 46 =
++-----------------------
> arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 16 ++-------
> arch/powerpc/platforms/85xx/p1022_ds.c | 7 ++--
> arch/powerpc/platforms/85xx/sbc8548.c | 18 ++--------
> arch/powerpc/platforms/85xx/sbc8560.c | 20 ++---------
> arch/powerpc/platforms/85xx/socrates.c | 13 +------
> arch/powerpc/platforms/85xx/stx_gp3.c | 16 ++-------
> arch/powerpc/platforms/85xx/tqm85xx.c | 16 ++-------
> arch/powerpc/platforms/85xx/xes_mpc85xx.c | 20 +++--------
> 17 files changed, 77 insertions(+), 217 deletions(-)
> create mode 100644 arch/powerpc/platforms/85xx/mpc85xx.h
> create mode 100644 arch/powerpc/platforms/85xx/mpc85xx_common.c
In general this looks ok, can you refactor so its earlier in the patch =
sequence
- k
>=20
> diff --git a/arch/powerpc/platforms/85xx/Makefile =
b/arch/powerpc/platforms/85xx/Makefile
> index 43b2162..ca4b1b9 100644
> --- a/arch/powerpc/platforms/85xx/Makefile
> +++ b/arch/powerpc/platforms/85xx/Makefile
> @@ -3,6 +3,8 @@
> #
> obj-$(CONFIG_SMP) +=3D smp.o
>=20
> +obj-y +=3D mpc85xx_common.o
> +
> obj-$(CONFIG_MPC8540_ADS) +=3D mpc85xx_ads.o
> obj-$(CONFIG_MPC8560_ADS) +=3D mpc85xx_ads.o
> obj-$(CONFIG_MPC85xx_CDS) +=3D mpc85xx_cds.o
> diff --git a/arch/powerpc/platforms/85xx/ksi8560.c =
b/arch/powerpc/platforms/85xx/ksi8560.c
> index c46f935..7657e1a 100644
> --- a/arch/powerpc/platforms/85xx/ksi8560.c
> +++ b/arch/powerpc/platforms/85xx/ksi8560.c
> @@ -35,6 +35,7 @@
> #include <asm/cpm2.h>
> #include <sysdev/cpm2_pic.h>
>=20
> +#include "mpc85xx.h"
>=20
> #define KSI8560_CPLD_HVR 0x04 /* Hardware Version =
Register */
> #define KSI8560_CPLD_PVR 0x08 /* PLD Version Register */
> @@ -215,22 +216,7 @@ static void ksi8560_show_cpuinfo(struct seq_file =
*m)
> seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
> }
>=20
> -static struct of_device_id __initdata of_bus_ids[] =3D {
> - { .type =3D "soc", },
> - { .type =3D "simple-bus", },
> - { .name =3D "cpm", },
> - { .name =3D "localbus", },
> - { .compatible =3D "gianfar", },
> - {},
> -};
> -
> -static int __init declare_of_platform_devices(void)
> -{
> - of_platform_bus_probe(NULL, of_bus_ids, NULL);
> -
> - return 0;
> -}
> -machine_device_initcall(ksi8560, declare_of_platform_devices);
> +machine_device_initcall(ksi8560, mpc85xx_common_publish_devices);
>=20
> /*
> * Called very early, device-tree isn't unflattened
> diff --git a/arch/powerpc/platforms/85xx/mpc8536_ds.c =
b/arch/powerpc/platforms/85xx/mpc8536_ds.c
> index f79f2f1..9ee6455 100644
> --- a/arch/powerpc/platforms/85xx/mpc8536_ds.c
> +++ b/arch/powerpc/platforms/85xx/mpc8536_ds.c
> @@ -32,6 +32,8 @@
> #include <sysdev/fsl_soc.h>
> #include <sysdev/fsl_pci.h>
>=20
> +#include "mpc85xx.h"
> +
> void __init mpc8536_ds_pic_init(void)
> {
> struct mpic *mpic;
> @@ -104,19 +106,7 @@ static void __init mpc8536_ds_setup_arch(void)
> printk("MPC8536 DS board from Freescale Semiconductor\n");
> }
>=20
> -static struct of_device_id __initdata mpc8536_ds_ids[] =3D {
> - { .type =3D "soc", },
> - { .compatible =3D "soc", },
> - { .compatible =3D "simple-bus", },
> - { .compatible =3D "gianfar", },
> - {},
> -};
> -
> -static int __init mpc8536_ds_publish_devices(void)
> -{
> - return of_platform_bus_probe(NULL, mpc8536_ds_ids, NULL);
> -}
> -machine_device_initcall(mpc8536_ds, mpc8536_ds_publish_devices);
> +machine_device_initcall(mpc8536_ds, mpc85xx_common_publish_devices);
>=20
> machine_arch_initcall(mpc8536_ds, swiotlb_setup_bus_notifier);
>=20
> diff --git a/arch/powerpc/platforms/85xx/mpc85xx.h =
b/arch/powerpc/platforms/85xx/mpc85xx.h
> new file mode 100644
> index 0000000..1a1b4eb
> --- /dev/null
> +++ b/arch/powerpc/platforms/85xx/mpc85xx.h
> @@ -0,0 +1,4 @@
> +#ifndef MPC85xx_H
> +#define MPC85xx_H
> +extern int mpc85xx_common_publish_devices(void);
> +#endif
> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c =
b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
> index 2483929..3bc2acc 100644
> --- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
> +++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
> @@ -35,6 +35,8 @@
> #include <sysdev/cpm2_pic.h>
> #endif
>=20
> +#include "mpc85xx.h"
> +
> #ifdef CONFIG_PCI
> static int mpc85xx_exclude_device(struct pci_controller *hose,
> u_char bus, u_char devfn)
> @@ -219,23 +221,7 @@ static void mpc85xx_ads_show_cpuinfo(struct =
seq_file *m)
> seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
> }
>=20
> -static struct of_device_id __initdata of_bus_ids[] =3D {
> - { .name =3D "soc", },
> - { .type =3D "soc", },
> - { .name =3D "cpm", },
> - { .name =3D "localbus", },
> - { .compatible =3D "simple-bus", },
> - { .compatible =3D "gianfar", },
> - {},
> -};
> -
> -static int __init declare_of_platform_devices(void)
> -{
> - of_platform_bus_probe(NULL, of_bus_ids, NULL);
> -
> - return 0;
> -}
> -machine_device_initcall(mpc85xx_ads, declare_of_platform_devices);
> +machine_device_initcall(mpc85xx_ads, mpc85xx_common_publish_devices);
>=20
> /*
> * Called very early, device-tree isn't unflattened
> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c =
b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
> index e209c23..281ecc5 100644
> --- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
> +++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
> @@ -47,6 +47,8 @@
> #include <sysdev/fsl_soc.h>
> #include <sysdev/fsl_pci.h>
>=20
> +#include "mpc85xx.h"
> +
> /* CADMUS info */
> /* xxx - galak, move into device tree */
> #define CADMUS_BASE (0xf8004000)
> @@ -328,19 +330,7 @@ static int __init mpc85xx_cds_probe(void)
> return of_flat_dt_is_compatible(root, "MPC85xxCDS");
> }
>=20
> -static struct of_device_id __initdata of_bus_ids[] =3D {
> - { .type =3D "soc", },
> - { .compatible =3D "soc", },
> - { .compatible =3D "simple-bus", },
> - { .compatible =3D "gianfar", },
> - {},
> -};
> -
> -static int __init declare_of_platform_devices(void)
> -{
> - return of_platform_bus_probe(NULL, of_bus_ids, NULL);
> -}
> -machine_device_initcall(mpc85xx_cds, declare_of_platform_devices);
> +machine_device_initcall(mpc85xx_cds, mpc85xx_common_publish_devices);
>=20
> define_machine(mpc85xx_cds) {
> .name =3D "MPC85xx CDS",
> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_common.c =
b/arch/powerpc/platforms/85xx/mpc85xx_common.c
> new file mode 100644
> index 0000000..999567a
> --- /dev/null
> +++ b/arch/powerpc/platforms/85xx/mpc85xx_common.c
> @@ -0,0 +1,26 @@
> +/*
> + * Routines common to most mpc85xx-based boards.
> + *
> + * This is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +#include <linux/kernel.h>
> +#include <linux/of_platform.h>
> +
> +#include "mpc85xx.h"
> +
> +static struct of_device_id __initdata mpc85xx_common_ids[] =3D {
> + { .type =3D "soc", },
> + { .compatible =3D "soc", },
> + { .compatible =3D "simple-bus", },
> + { .compatible =3D "gianfar", },
> + { .compatible =3D "fsl,qe", },
> + { .compatible =3D "fsl,cpm2", },
> + {},
> +};
> +
> +int __init mpc85xx_common_publish_devices(void)
> +{
> + return of_platform_bus_probe(NULL, mpc85xx_common_ids, NULL);
> +}
> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c =
b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
> index 53bf07d..7a0b728 100644
> --- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
> +++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
> @@ -36,6 +36,8 @@
> #include <sysdev/fsl_soc.h>
> #include <sysdev/fsl_pci.h>
>=20
> +#include "mpc85xx.h"
> +
> #undef DEBUG
>=20
> #ifdef DEBUG
> @@ -216,21 +218,9 @@ static int __init mpc8544_ds_probe(void)
> return 0;
> }
>=20
> -static struct of_device_id __initdata mpc85xxds_ids[] =3D {
> - { .type =3D "soc", },
> - { .compatible =3D "soc", },
> - { .compatible =3D "simple-bus", },
> - { .compatible =3D "gianfar", },
> - {},
> -};
> -
> -static int __init mpc85xxds_publish_devices(void)
> -{
> - return of_platform_bus_probe(NULL, mpc85xxds_ids, NULL);
> -}
> -machine_device_initcall(mpc8544_ds, mpc85xxds_publish_devices);
> -machine_device_initcall(mpc8572_ds, mpc85xxds_publish_devices);
> -machine_device_initcall(p2020_ds, mpc85xxds_publish_devices);
> +machine_device_initcall(mpc8544_ds, mpc85xx_common_publish_devices);
> +machine_device_initcall(mpc8572_ds, mpc85xx_common_publish_devices);
> +machine_device_initcall(p2020_ds, mpc85xx_common_publish_devices);
>=20
> machine_arch_initcall(mpc8544_ds, swiotlb_setup_bus_notifier);
> machine_arch_initcall(mpc8572_ds, swiotlb_setup_bus_notifier);
> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c =
b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
> index 747d1ee..fde37e5 100644
> --- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
> +++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
> @@ -53,6 +53,8 @@
> #include <asm/mpic.h>
> #include <asm/swiotlb.h>
>=20
> +#include "mpc85xx.h"
> +
> #undef DEBUG
> #ifdef DEBUG
> #define DBG(fmt...) udbg_printf(fmt)
> @@ -159,25 +161,6 @@ extern void __init mpc85xx_smp_init(void);
> #endif
>=20
> #ifdef CONFIG_QUICC_ENGINE
> -static struct of_device_id mpc85xx_qe_ids[] __initdata =3D {
> - { .type =3D "qe", },
> - { .compatible =3D "fsl,qe", },
> - { },
> -};
> -
> -static void __init mpc85xx_publish_qe_devices(void)
> -{
> - struct device_node *np;
> -
> - np =3D of_find_compatible_node(NULL, NULL, "fsl,qe");
> - if (!of_device_is_available(np)) {
> - of_node_put(np);
> - return;
> - }
> -
> - of_platform_bus_probe(NULL, mpc85xx_qe_ids, NULL);
> -}
> -
> static void __init mpc85xx_mds_reset_ucc_phys(void)
> {
> struct device_node *np;
> @@ -348,7 +331,6 @@ static void __init mpc85xx_mds_qeic_init(void)
> of_node_put(np);
> }
> #else
> -static void __init mpc85xx_publish_qe_devices(void) { }
> static void __init mpc85xx_mds_qe_init(void) { }
> static void __init mpc85xx_mds_qeic_init(void) { }
> #endif /* CONFIG_QUICC_ENGINE */
> @@ -430,24 +412,12 @@ machine_arch_initcall(mpc8568_mds, =
board_fixups);
> machine_arch_initcall(mpc8569_mds, board_fixups);
>=20
> static struct of_device_id mpc85xx_ids[] =3D {
> - { .type =3D "soc", },
> - { .compatible =3D "soc", },
> - { .compatible =3D "simple-bus", },
> - { .compatible =3D "gianfar", },
> { .compatible =3D "fsl,rapidio-delta", },
> { .compatible =3D "fsl,mpc8548-guts", },
> { .compatible =3D "gpio-leds", },
> {},
> };
>=20
> -static struct of_device_id p1021_ids[] =3D {
> - { .type =3D "soc", },
> - { .compatible =3D "soc", },
> - { .compatible =3D "simple-bus", },
> - { .compatible =3D "gianfar", },
> - {},
> -};
> -
> static int __init mpc85xx_publish_devices(void)
> {
> if (machine_is(mpc8568_mds))
> @@ -455,23 +425,15 @@ static int __init mpc85xx_publish_devices(void)
> if (machine_is(mpc8569_mds))
> simple_gpiochip_init("fsl,mpc8569mds-bcsr-gpio");
>=20
> + mpc85xx_common_publish_devices();
> of_platform_bus_probe(NULL, mpc85xx_ids, NULL);
> - mpc85xx_publish_qe_devices();
> -
> - return 0;
> -}
> -
> -static int __init p1021_publish_devices(void)
> -{
> - of_platform_bus_probe(NULL, p1021_ids, NULL);
> - mpc85xx_publish_qe_devices();
>=20
> return 0;
> }
>=20
> machine_device_initcall(mpc8568_mds, mpc85xx_publish_devices);
> machine_device_initcall(mpc8569_mds, mpc85xx_publish_devices);
> -machine_device_initcall(p1021_mds, p1021_publish_devices);
> +machine_device_initcall(p1021_mds, mpc85xx_common_publish_devices);
>=20
> machine_arch_initcall(mpc8568_mds, swiotlb_setup_bus_notifier);
> machine_arch_initcall(mpc8569_mds, swiotlb_setup_bus_notifier);
> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c =
b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
> index 7a3a37b..5846025 100644
> --- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
> +++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
> @@ -30,6 +30,8 @@
> #include <sysdev/fsl_soc.h>
> #include <sysdev/fsl_pci.h>
>=20
> +#include "mpc85xx.h"
> +
> #undef DEBUG
>=20
> #ifdef DEBUG
> @@ -108,19 +110,7 @@ static void __init mpc85xx_rdb_setup_arch(void)
> printk(KERN_INFO "MPC85xx RDB board from Freescale =
Semiconductor\n");
> }
>=20
> -static struct of_device_id __initdata mpc85xxrdb_ids[] =3D {
> - { .type =3D "soc", },
> - { .compatible =3D "soc", },
> - { .compatible =3D "simple-bus", },
> - { .compatible =3D "gianfar", },
> - {},
> -};
> -
> -static int __init mpc85xxrdb_publish_devices(void)
> -{
> - return of_platform_bus_probe(NULL, mpc85xxrdb_ids, NULL);
> -}
> -machine_device_initcall(mpc85xx_rdb, mpc85xxrdb_publish_devices);
> +machine_device_initcall(mpc85xx_rdb, mpc85xx_common_publish_devices);
>=20
> /*
> * Called very early, device-tree isn't unflattened
> diff --git a/arch/powerpc/platforms/85xx/p1022_ds.c =
b/arch/powerpc/platforms/85xx/p1022_ds.c
> index 266b3aa..26e6f75 100644
> --- a/arch/powerpc/platforms/85xx/p1022_ds.c
> +++ b/arch/powerpc/platforms/85xx/p1022_ds.c
> @@ -27,6 +27,8 @@
> #include <sysdev/fsl_pci.h>
> #include <asm/fsl_guts.h>
>=20
> +#include "mpc85xx.h"
> +
> #if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
>=20
> /*
> @@ -325,10 +327,6 @@ static void __init p1022_ds_setup_arch(void)
> }
>=20
> static struct of_device_id __initdata p1022_ds_ids[] =3D {
> - { .type =3D "soc", },
> - { .compatible =3D "soc", },
> - { .compatible =3D "simple-bus", },
> - { .compatible =3D "gianfar", },
> /* So that the DMA channel nodes can be probed individually: */
> { .compatible =3D "fsl,eloplus-dma", },
> {},
> @@ -338,6 +336,7 @@ static int __init p1022_ds_publish_devices(void)
> {
> return of_platform_bus_probe(NULL, p1022_ds_ids, NULL);
> }
> +machine_device_initcall(p1022_ds, mpc85xx_common_publish_devices);
> machine_device_initcall(p1022_ds, p1022_ds_publish_devices);
>=20
> machine_arch_initcall(p1022_ds, swiotlb_setup_bus_notifier);
> diff --git a/arch/powerpc/platforms/85xx/sbc8548.c =
b/arch/powerpc/platforms/85xx/sbc8548.c
> index 2eeb376..42343ac 100644
> --- a/arch/powerpc/platforms/85xx/sbc8548.c
> +++ b/arch/powerpc/platforms/85xx/sbc8548.c
> @@ -49,6 +49,8 @@
> #include <sysdev/fsl_soc.h>
> #include <sysdev/fsl_pci.h>
>=20
> +#include "mpc85xx.h"
> +
> static int sbc_rev =3D -EINVAL;
>=20
> static void __init sbc8548_pic_init(void)
> @@ -152,21 +154,7 @@ static void sbc8548_show_cpuinfo(struct seq_file =
*m)
> seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
> }
>=20
> -static struct of_device_id __initdata of_bus_ids[] =3D {
> - { .name =3D "soc", },
> - { .type =3D "soc", },
> - { .compatible =3D "simple-bus", },
> - { .compatible =3D "gianfar", },
> - {},
> -};
> -
> -static int __init declare_of_platform_devices(void)
> -{
> - of_platform_bus_probe(NULL, of_bus_ids, NULL);
> -
> - return 0;
> -}
> -machine_device_initcall(sbc8548, declare_of_platform_devices);
> +machine_device_initcall(sbc8548, mpc85xx_common_publish_devices);
>=20
> /*
> * Called very early, device-tree isn't unflattened
> diff --git a/arch/powerpc/platforms/85xx/sbc8560.c =
b/arch/powerpc/platforms/85xx/sbc8560.c
> index 678f5a8..bbb656f 100644
> --- a/arch/powerpc/platforms/85xx/sbc8560.c
> +++ b/arch/powerpc/platforms/85xx/sbc8560.c
> @@ -37,6 +37,8 @@
> #include <sysdev/cpm2_pic.h>
> #endif
>=20
> +#include "mpc85xx.h"
> +
> #ifdef CONFIG_CPM2
>=20
> static void cpm2_cascade(unsigned int irq, struct irq_desc *desc)
> @@ -208,23 +210,7 @@ static void sbc8560_show_cpuinfo(struct seq_file =
*m)
> seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
> }
>=20
> -static struct of_device_id __initdata of_bus_ids[] =3D {
> - { .name =3D "soc", },
> - { .type =3D "soc", },
> - { .name =3D "cpm", },
> - { .name =3D "localbus", },
> - { .compatible =3D "simple-bus", },
> - { .compatible =3D "gianfar", },
> - {},
> -};
> -
> -static int __init declare_of_platform_devices(void)
> -{
> - of_platform_bus_probe(NULL, of_bus_ids, NULL);
> -
> - return 0;
> -}
> -machine_device_initcall(sbc8560, declare_of_platform_devices);
> +machine_device_initcall(sbc8560, mpc85xx_common_publish_devices);
>=20
> /*
> * Called very early, device-tree isn't unflattened
> diff --git a/arch/powerpc/platforms/85xx/socrates.c =
b/arch/powerpc/platforms/85xx/socrates.c
> index 747d8fb..fec496a 100644
> --- a/arch/powerpc/platforms/85xx/socrates.c
> +++ b/arch/powerpc/platforms/85xx/socrates.c
> @@ -41,6 +41,7 @@
> #include <sysdev/fsl_soc.h>
> #include <sysdev/fsl_pci.h>
>=20
> +#include "mpc85xx.h"
> #include "socrates_fpga_pic.h"
>=20
> static void __init socrates_pic_init(void)
> @@ -96,17 +97,7 @@ static void __init socrates_setup_arch(void)
> #endif
> }
>=20
> -static struct of_device_id __initdata socrates_of_bus_ids[] =3D {
> - { .compatible =3D "simple-bus", },
> - { .compatible =3D "gianfar", },
> - {},
> -};
> -
> -static int __init socrates_publish_devices(void)
> -{
> - return of_platform_bus_probe(NULL, socrates_of_bus_ids, NULL);
> -}
> -machine_device_initcall(socrates, socrates_publish_devices);
> +machine_device_initcall(socrates, mpc85xx_common_publish_devices);
>=20
> /*
> * Called very early, device-tree isn't unflattened
> diff --git a/arch/powerpc/platforms/85xx/stx_gp3.c =
b/arch/powerpc/platforms/85xx/stx_gp3.c
> index 5387e9f..ab80044 100644
> --- a/arch/powerpc/platforms/85xx/stx_gp3.c
> +++ b/arch/powerpc/platforms/85xx/stx_gp3.c
> @@ -40,6 +40,8 @@
> #include <sysdev/fsl_soc.h>
> #include <sysdev/fsl_pci.h>
>=20
> +#include "mpc85xx.h"
> +
> #ifdef CONFIG_CPM2
> #include <asm/cpm2.h>
> #include <sysdev/cpm2_pic.h>
> @@ -144,19 +146,7 @@ static void stx_gp3_show_cpuinfo(struct seq_file =
*m)
> seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
> }
>=20
> -static struct of_device_id __initdata of_bus_ids[] =3D {
> - { .compatible =3D "simple-bus", },
> - { .compatible =3D "gianfar", },
> - {},
> -};
> -
> -static int __init declare_of_platform_devices(void)
> -{
> - of_platform_bus_probe(NULL, of_bus_ids, NULL);
> -
> - return 0;
> -}
> -machine_device_initcall(stx_gp3, declare_of_platform_devices);
> +machine_device_initcall(stx_gp3, mpc85xx_common_publish_devices);
>=20
> /*
> * Called very early, device-tree isn't unflattened
> diff --git a/arch/powerpc/platforms/85xx/tqm85xx.c =
b/arch/powerpc/platforms/85xx/tqm85xx.c
> index 325de77..19e711f 100644
> --- a/arch/powerpc/platforms/85xx/tqm85xx.c
> +++ b/arch/powerpc/platforms/85xx/tqm85xx.c
> @@ -38,6 +38,8 @@
> #include <sysdev/fsl_soc.h>
> #include <sysdev/fsl_pci.h>
>=20
> +#include "mpc85xx.h"
> +
> #ifdef CONFIG_CPM2
> #include <asm/cpm2.h>
> #include <sysdev/cpm2_pic.h>
> @@ -173,19 +175,7 @@ static void __init tqm85xx_ti1520_fixup(struct =
pci_dev *pdev)
> DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1520,
> tqm85xx_ti1520_fixup);
>=20
> -static struct of_device_id __initdata of_bus_ids[] =3D {
> - { .compatible =3D "simple-bus", },
> - { .compatible =3D "gianfar", },
> - {},
> -};
> -
> -static int __init declare_of_platform_devices(void)
> -{
> - of_platform_bus_probe(NULL, of_bus_ids, NULL);
> -
> - return 0;
> -}
> -machine_device_initcall(tqm85xx, declare_of_platform_devices);
> +machine_device_initcall(tqm85xx, mpc85xx_common_publish_devices);
>=20
> static const char *board[] __initdata =3D {
> "tqc,tqm8540",
> diff --git a/arch/powerpc/platforms/85xx/xes_mpc85xx.c =
b/arch/powerpc/platforms/85xx/xes_mpc85xx.c
> index 0125604..0ee3721 100644
> --- a/arch/powerpc/platforms/85xx/xes_mpc85xx.c
> +++ b/arch/powerpc/platforms/85xx/xes_mpc85xx.c
> @@ -33,6 +33,8 @@
> #include <sysdev/fsl_soc.h>
> #include <sysdev/fsl_pci.h>
>=20
> +#include "mpc85xx.h"
> +
> /* A few bit definitions needed for fixups on some boards */
> #define MPC85xx_L2CTL_L2E 0x80000000 /* L2 enable */
> #define MPC85xx_L2CTL_L2I 0x40000000 /* L2 flash =
invalidate */
> @@ -177,21 +179,9 @@ static void __init xes_mpc85xx_setup_arch(void)
> #endif
> }
>=20
> -static struct of_device_id __initdata xes_mpc85xx_ids[] =3D {
> - { .type =3D "soc", },
> - { .compatible =3D "soc", },
> - { .compatible =3D "simple-bus", },
> - { .compatible =3D "gianfar", },
> - {},
> -};
> -
> -static int __init xes_mpc85xx_publish_devices(void)
> -{
> - return of_platform_bus_probe(NULL, xes_mpc85xx_ids, NULL);
> -}
> -machine_device_initcall(xes_mpc8572, xes_mpc85xx_publish_devices);
> -machine_device_initcall(xes_mpc8548, xes_mpc85xx_publish_devices);
> -machine_device_initcall(xes_mpc8540, xes_mpc85xx_publish_devices);
> +machine_device_initcall(xes_mpc8572, mpc85xx_common_publish_devices);
> +machine_device_initcall(xes_mpc8548, mpc85xx_common_publish_devices);
> +machine_device_initcall(xes_mpc8540, mpc85xx_common_publish_devices);
>=20
> /*
> * Called very early, device-tree isn't unflattened
> --=20
> 1.7.2.5
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 13/14] 85xx: consolidate of_platform_bus_probe calls
2011-07-19 8:53 ` [PATCH 13/14] 85xx: consolidate of_platform_bus_probe calls Dmitry Eremin-Solenikov
2011-07-19 14:15 ` Kumar Gala
@ 2011-07-19 17:54 ` Scott Wood
2011-07-22 19:44 ` Dmitry Eremin-Solenikov
1 sibling, 1 reply; 40+ messages in thread
From: Scott Wood @ 2011-07-19 17:54 UTC (permalink / raw)
To: Dmitry Eremin-Solenikov; +Cc: Paul Mackerras, Linux PPC Development
On Tue, 19 Jul 2011 12:53:50 +0400
Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> wrote:
> +static struct of_device_id __initdata mpc85xx_common_ids[] = {
> + { .type = "soc", },
> + { .compatible = "soc", },
> + { .compatible = "simple-bus", },
> + { .compatible = "gianfar", },
> + { .compatible = "fsl,qe", },
> + { .compatible = "fsl,cpm2", },
> + {},
> +};
Same comment as for 83xx regarding localbus and compatibility with old
device trees.
-Scott
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 13/14] 85xx: consolidate of_platform_bus_probe calls
2011-07-19 17:54 ` Scott Wood
@ 2011-07-22 19:44 ` Dmitry Eremin-Solenikov
2011-07-22 20:29 ` Scott Wood
0 siblings, 1 reply; 40+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-07-22 19:44 UTC (permalink / raw)
To: Scott Wood; +Cc: Paul Mackerras, Linux PPC Development
On 7/19/11, Scott Wood <scottwood@freescale.com> wrote:
> On Tue, 19 Jul 2011 12:53:50 +0400
> Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> wrote:
>
>> +static struct of_device_id __initdata mpc85xx_common_ids[] = {
>> + { .type = "soc", },
>> + { .compatible = "soc", },
>> + { .compatible = "simple-bus", },
>> + { .compatible = "gianfar", },
>> + { .compatible = "fsl,qe", },
>> + { .compatible = "fsl,cpm2", },
>> + {},
>> +};
>
> Same comment as for 83xx regarding localbus and compatibility with old
> device trees.
I checked for in-kernel device trees. Unless I miss something, there are no
leftovers from this list. (83xx provided no simple-bus property for localbus,
so your argument is valid there). If we should care about strange cases,
not even blessed by kernel trees, I can add some of the old probes back.
What do you thing?
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 13/14] 85xx: consolidate of_platform_bus_probe calls
2011-07-22 19:44 ` Dmitry Eremin-Solenikov
@ 2011-07-22 20:29 ` Scott Wood
2011-07-22 21:45 ` Dmitry Eremin-Solenikov
0 siblings, 1 reply; 40+ messages in thread
From: Scott Wood @ 2011-07-22 20:29 UTC (permalink / raw)
To: Dmitry Eremin-Solenikov; +Cc: Paul Mackerras, Linux PPC Development
On Fri, 22 Jul 2011 23:44:01 +0400
Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> wrote:
> On 7/19/11, Scott Wood <scottwood@freescale.com> wrote:
> > On Tue, 19 Jul 2011 12:53:50 +0400
> > Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> wrote:
> >
> >> +static struct of_device_id __initdata mpc85xx_common_ids[] = {
> >> + { .type = "soc", },
> >> + { .compatible = "soc", },
> >> + { .compatible = "simple-bus", },
> >> + { .compatible = "gianfar", },
> >> + { .compatible = "fsl,qe", },
> >> + { .compatible = "fsl,cpm2", },
> >> + {},
> >> +};
> >
> > Same comment as for 83xx regarding localbus and compatibility with old
> > device trees.
>
> I checked for in-kernel device trees. Unless I miss something, there are no
> leftovers from this list. (83xx provided no simple-bus property for localbus,
> so your argument is valid there). If we should care about strange cases,
> not even blessed by kernel trees, I can add some of the old probes back.
I see simple-bus missing in sbc8560 and ksi8560 -- were these included in
the consolidation? Plus some of the others may have had simple-bus added
after their initial version.
As for out-of-tree trees (which could include trees dynamically
generated/augmented by firmware, as well as device trees for custom boards
that forked off of an old reference board tree), it's still nice to not
break them as long as they stick to the binding.
While the localbus binding is deficient regarding the compatible property,
IIRC localbus preceded the introduction of simple-bus, which appears to be
defined only in ePAPR (not in Linux or on devicetree.org). The ePAPR
language does not suggest that it's mandatory for all buses that don't need
special handling -- in fact, the language could be read as suggesting that
it's only applicable to the "internal I/O bus" on an SoC (whereas this
is an external bus), though that wasn't the intent behind it.
The notion of probing buses isn't really a part of the device tree specs;
they're more concerned with binding the devices themselves. In theory
Linux should probably be probing everything that a driver will match,
regardless of where in the tree it is, except where an ancestor node is
diasbled, has matched a driver that wants to do things differently, or is
on a blacklist. Of course, that's somewhat of a philosophical question on
whether it's better to risk probing someting that shouldn't be, or not
probing something that should be. The former is often nastier but more
obvious, the latter is more likely until simple-bus is more widely used,
and either one results in something not working.
Leaving the localbus in may help someone, and it shouldn't hurt anything.
-Scott
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 13/14] 85xx: consolidate of_platform_bus_probe calls
2011-07-22 20:29 ` Scott Wood
@ 2011-07-22 21:45 ` Dmitry Eremin-Solenikov
2011-07-25 15:40 ` Scott Wood
0 siblings, 1 reply; 40+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-07-22 21:45 UTC (permalink / raw)
To: Scott Wood; +Cc: Paul Mackerras, Linux PPC Development
On 7/23/11, Scott Wood <scottwood@freescale.com> wrote:
> On Fri, 22 Jul 2011 23:44:01 +0400
> Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> wrote:
>
>> On 7/19/11, Scott Wood <scottwood@freescale.com> wrote:
>> > On Tue, 19 Jul 2011 12:53:50 +0400
>> > Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> wrote:
>> >
>> >> +static struct of_device_id __initdata mpc85xx_common_ids[] = {
>> >> + { .type = "soc", },
>> >> + { .compatible = "soc", },
>> >> + { .compatible = "simple-bus", },
>> >> + { .compatible = "gianfar", },
>> >> + { .compatible = "fsl,qe", },
>> >> + { .compatible = "fsl,cpm2", },
>> >> + {},
>> >> +};
>> >
>> > Same comment as for 83xx regarding localbus and compatibility with old
>> > device trees.
>>
>> I checked for in-kernel device trees. Unless I miss something, there are
>> no
>> leftovers from this list. (83xx provided no simple-bus property for
>> localbus,
>> so your argument is valid there). If we should care about strange cases,
>> not even blessed by kernel trees, I can add some of the old probes back.
>
> I see simple-bus missing in sbc8560 and ksi8560 -- were these included in
> the consolidation? Plus some of the others may have had simple-bus added
> after their initial version.
Patches for those are included in the patch serie. Kumar has applied them
to next-3.2.
> As for out-of-tree trees (which could include trees dynamically
> generated/augmented by firmware, as well as device trees for custom boards
> that forked off of an old reference board tree), it's still nice to not
> break them as long as they stick to the binding.
I see your point. I just wasn't thinking too much about ot-of-tree trees.
My thought was that if someone updates the kernel, he can also update the dtb.
> While the localbus binding is deficient regarding the compatible property,
> IIRC localbus preceded the introduction of simple-bus, which appears to be
> defined only in ePAPR (not in Linux or on devicetree.org). The ePAPR
> language does not suggest that it's mandatory for all buses that don't need
> special handling -- in fact, the language could be read as suggesting that
> it's only applicable to the "internal I/O bus" on an SoC (whereas this
> is an external bus), though that wasn't the intent behind it.
Could you please update the lbc.txt suggesting the compatibility
with simple-bus for lbc? Or you thing that it would be wrong?
I think we should define compatibility list as "fsl,mpcXXXX-localbus",
"fsl,pqXXXXX-localbus", "simple-bus", noting that by default new
platforms/boards should only use "simple-bus" internally. Does this
look reasonable for you? I can then try to provide a patch.
> The notion of probing buses isn't really a part of the device tree specs;
> they're more concerned with binding the devices themselves. In theory
> Linux should probably be probing everything that a driver will match,
> regardless of where in the tree it is, except where an ancestor node is
> diasbled, has matched a driver that wants to do things differently, or is
> on a blacklist. Of course, that's somewhat of a philosophical question on
> whether it's better to risk probing someting that shouldn't be, or not
> probing something that should be. The former is often nastier but more
> obvious, the latter is more likely until simple-bus is more widely used,
> and either one results in something not working.
> Leaving the localbus in may help someone, and it shouldn't hurt anything.
What do you suggest/prefer? To add .name="localbus" to generic code
or to have board-specific hooks (like one for mpc834xemitx)?
So,
>
> -Scott
>
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 13/14] 85xx: consolidate of_platform_bus_probe calls
2011-07-22 21:45 ` Dmitry Eremin-Solenikov
@ 2011-07-25 15:40 ` Scott Wood
0 siblings, 0 replies; 40+ messages in thread
From: Scott Wood @ 2011-07-25 15:40 UTC (permalink / raw)
To: Dmitry Eremin-Solenikov; +Cc: Paul Mackerras, Linux PPC Development
On Sat, 23 Jul 2011 01:45:53 +0400
Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> wrote:
> I see your point. I just wasn't thinking too much about ot-of-tree trees.
> My thought was that if someone updates the kernel, he can also update the dtb.
Sometimes there are firmware dependencies that make that difficult. And
even if it's just user laziness/forgetfulness, that still translates to
extra support requests.
> Could you please update the lbc.txt suggesting the compatibility
> with simple-bus for lbc? Or you thing that it would be wrong?
>
> I think we should define compatibility list as "fsl,mpcXXXX-localbus",
> "fsl,pqXXXXX-localbus", "simple-bus", noting that by default new
> platforms/boards should only use "simple-bus" internally. Does this
> look reasonable for you? I can then try to provide a patch.
I'm OK with saying that localbus nodes should have simple-bus in new trees,
and defining canonical compatible values (chips with eLBC should be
"fsl,XXXX-elbc", "fsl,elbc", "simple-bus"). I'm not sure what you mean by
"should only use simple-bus internally", especially in the context of the
binding.
> What do you suggest/prefer? To add .name="localbus" to generic code
> or to have board-specific hooks (like one for mpc834xemitx)?
Just add localbus to the generic table.
-Scott
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 14/14] 85xx: separate cpm2 pic init
2011-07-19 8:53 [PATCH 00/14] Consolidation of 83xx/85xx board files Dmitry Eremin-Solenikov
` (12 preceding siblings ...)
2011-07-19 8:53 ` [PATCH 13/14] 85xx: consolidate of_platform_bus_probe calls Dmitry Eremin-Solenikov
@ 2011-07-19 8:53 ` Dmitry Eremin-Solenikov
2011-07-19 14:18 ` Kumar Gala
2011-07-19 14:20 ` [PATCH 00/14] Consolidation of 83xx/85xx board files Kumar Gala
2011-07-19 14:29 ` Kumar Gala
15 siblings, 1 reply; 40+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-07-19 8:53 UTC (permalink / raw)
To: Linux PPC Development; +Cc: Paul Mackerras
Separate handling of CPM2 PIC initialization to mpc85xx_cpm2_pic_init()
function.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/powerpc/platforms/85xx/ksi8560.c | 28 +------------------
arch/powerpc/platforms/85xx/mpc85xx.h | 7 ++++
arch/powerpc/platforms/85xx/mpc85xx_ads.c | 32 +--------------------
arch/powerpc/platforms/85xx/mpc85xx_common.c | 39 ++++++++++++++++++++++++++
arch/powerpc/platforms/85xx/sbc8560.c | 32 +--------------------
arch/powerpc/platforms/85xx/tqm85xx.c | 35 +----------------------
6 files changed, 50 insertions(+), 123 deletions(-)
diff --git a/arch/powerpc/platforms/85xx/ksi8560.c b/arch/powerpc/platforms/85xx/ksi8560.c
index 7657e1a..0f3e688 100644
--- a/arch/powerpc/platforms/85xx/ksi8560.c
+++ b/arch/powerpc/platforms/85xx/ksi8560.c
@@ -55,25 +55,11 @@ static void machine_restart(char *cmd)
for (;;);
}
-static void cpm2_cascade(unsigned int irq, struct irq_desc *desc)
-{
- struct irq_chip *chip = irq_desc_get_chip(desc);
- int cascade_irq;
-
- while ((cascade_irq = cpm2_get_irq()) >= 0)
- generic_handle_irq(cascade_irq);
-
- chip->irq_eoi(&desc->irq_data);
-}
-
static void __init ksi8560_pic_init(void)
{
struct mpic *mpic;
struct resource r;
struct device_node *np;
-#ifdef CONFIG_CPM2
- int irq;
-#endif
np = of_find_node_by_type(NULL, "open-pic");
@@ -96,19 +82,7 @@ static void __init ksi8560_pic_init(void)
mpic_init(mpic);
-#ifdef CONFIG_CPM2
- /* Setup CPM2 PIC */
- np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic");
- if (np == NULL) {
- printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n");
- return;
- }
- irq = irq_of_parse_and_map(np, 0);
-
- cpm2_pic_init(np);
- of_node_put(np);
- irq_set_chained_handler(irq, cpm2_cascade);
-#endif
+ mpc85xx_cpm2_pic_init();
}
#ifdef CONFIG_CPM2
diff --git a/arch/powerpc/platforms/85xx/mpc85xx.h b/arch/powerpc/platforms/85xx/mpc85xx.h
index 1a1b4eb..2aa7c5d 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx.h
+++ b/arch/powerpc/platforms/85xx/mpc85xx.h
@@ -1,4 +1,11 @@
#ifndef MPC85xx_H
#define MPC85xx_H
extern int mpc85xx_common_publish_devices(void);
+
+#ifdef CONFIG_CPM2
+extern void mpc85xx_cpm2_pic_init(void);
+#else
+static inline void __init mpc85xx_cpm2_pic_init(void) {}
+#endif /* CONFIG_CPM2 */
+
#endif
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index 3bc2acc..0e90422 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -48,29 +48,11 @@ static int mpc85xx_exclude_device(struct pci_controller *hose,
}
#endif /* CONFIG_PCI */
-#ifdef CONFIG_CPM2
-
-static void cpm2_cascade(unsigned int irq, struct irq_desc *desc)
-{
- struct irq_chip *chip = irq_desc_get_chip(desc);
- int cascade_irq;
-
- while ((cascade_irq = cpm2_get_irq()) >= 0)
- generic_handle_irq(cascade_irq);
-
- chip->irq_eoi(&desc->irq_data);
-}
-
-#endif /* CONFIG_CPM2 */
-
static void __init mpc85xx_ads_pic_init(void)
{
struct mpic *mpic;
struct resource r;
struct device_node *np = NULL;
-#ifdef CONFIG_CPM2
- int irq;
-#endif
np = of_find_node_by_type(np, "open-pic");
if (!np) {
@@ -92,19 +74,7 @@ static void __init mpc85xx_ads_pic_init(void)
mpic_init(mpic);
-#ifdef CONFIG_CPM2
- /* Setup CPM2 PIC */
- np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic");
- if (np == NULL) {
- printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n");
- return;
- }
- irq = irq_of_parse_and_map(np, 0);
-
- cpm2_pic_init(np);
- of_node_put(np);
- irq_set_chained_handler(irq, cpm2_cascade);
-#endif
+ mpc85xx_cpm2_pic_init();
}
/*
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_common.c b/arch/powerpc/platforms/85xx/mpc85xx_common.c
index 999567a..4fdf382 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_common.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_common.c
@@ -8,6 +8,8 @@
#include <linux/kernel.h>
#include <linux/of_platform.h>
+#include <sysdev/cpm2_pic.h>
+
#include "mpc85xx.h"
static struct of_device_id __initdata mpc85xx_common_ids[] = {
@@ -24,3 +26,40 @@ int __init mpc85xx_common_publish_devices(void)
{
return of_platform_bus_probe(NULL, mpc85xx_common_ids, NULL);
}
+
+#ifdef CONFIG_CPM2
+static void cpm2_cascade(unsigned int irq, struct irq_desc *desc)
+{
+ struct irq_chip *chip = irq_desc_get_chip(desc);
+ int cascade_irq;
+
+ while ((cascade_irq = cpm2_get_irq()) >= 0)
+ generic_handle_irq(cascade_irq);
+
+ chip->irq_eoi(&desc->irq_data);
+}
+
+
+void __init mpc85xx_cpm2_pic_init(void)
+{
+ struct device_node *np;
+ int irq;
+
+ /* Setup CPM2 PIC */
+ np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic");
+ if (np == NULL) {
+ printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n");
+ return;
+ }
+ irq = irq_of_parse_and_map(np, 0);
+ if (irq == NO_IRQ) {
+ of_node_put(np);
+ printk(KERN_ERR "PIC init: got no IRQ for cpm cascade\n");
+ return;
+ }
+
+ cpm2_pic_init(np);
+ of_node_put(np);
+ irq_set_chained_handler(irq, cpm2_cascade);
+}
+#endif
diff --git a/arch/powerpc/platforms/85xx/sbc8560.c b/arch/powerpc/platforms/85xx/sbc8560.c
index bbb656f..f3b4737 100644
--- a/arch/powerpc/platforms/85xx/sbc8560.c
+++ b/arch/powerpc/platforms/85xx/sbc8560.c
@@ -39,29 +39,11 @@
#include "mpc85xx.h"
-#ifdef CONFIG_CPM2
-
-static void cpm2_cascade(unsigned int irq, struct irq_desc *desc)
-{
- struct irq_chip *chip = irq_desc_get_chip(desc);
- int cascade_irq;
-
- while ((cascade_irq = cpm2_get_irq()) >= 0)
- generic_handle_irq(cascade_irq);
-
- chip->irq_eoi(&desc->irq_data);
-}
-
-#endif /* CONFIG_CPM2 */
-
static void __init sbc8560_pic_init(void)
{
struct mpic *mpic;
struct resource r;
struct device_node *np = NULL;
-#ifdef CONFIG_CPM2
- int irq;
-#endif
np = of_find_node_by_type(np, "open-pic");
if (!np) {
@@ -83,19 +65,7 @@ static void __init sbc8560_pic_init(void)
mpic_init(mpic);
-#ifdef CONFIG_CPM2
- /* Setup CPM2 PIC */
- np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic");
- if (np == NULL) {
- printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n");
- return;
- }
- irq = irq_of_parse_and_map(np, 0);
-
- cpm2_pic_init(np);
- of_node_put(np);
- irq_set_chained_handler(irq, cpm2_cascade);
-#endif
+ mpc85xx_cpm2_pic_init();
}
/*
diff --git a/arch/powerpc/platforms/85xx/tqm85xx.c b/arch/powerpc/platforms/85xx/tqm85xx.c
index 19e711f..2418bf8 100644
--- a/arch/powerpc/platforms/85xx/tqm85xx.c
+++ b/arch/powerpc/platforms/85xx/tqm85xx.c
@@ -42,18 +42,6 @@
#ifdef CONFIG_CPM2
#include <asm/cpm2.h>
-#include <sysdev/cpm2_pic.h>
-
-static void cpm2_cascade(unsigned int irq, struct irq_desc *desc)
-{
- struct irq_chip *chip = irq_desc_get_chip(desc);
- int cascade_irq;
-
- while ((cascade_irq = cpm2_get_irq()) >= 0)
- generic_handle_irq(cascade_irq);
-
- chip->irq_eoi(&desc->irq_data);
-}
#endif /* CONFIG_CPM2 */
static void __init tqm85xx_pic_init(void)
@@ -61,9 +49,6 @@ static void __init tqm85xx_pic_init(void)
struct mpic *mpic;
struct resource r;
struct device_node *np;
-#ifdef CONFIG_CPM2
- int irq;
-#endif
np = of_find_node_by_type(NULL, "open-pic");
if (!np) {
@@ -85,25 +70,7 @@ static void __init tqm85xx_pic_init(void)
mpic_init(mpic);
-#ifdef CONFIG_CPM2
- /* Setup CPM2 PIC */
- np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic");
- if (np == NULL) {
- printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n");
- return;
- }
- irq = irq_of_parse_and_map(np, 0);
-
- if (irq == NO_IRQ) {
- of_node_put(np);
- printk(KERN_ERR "PIC init: got no IRQ for cpm cascade\n");
- return;
- }
-
- cpm2_pic_init(np);
- of_node_put(np);
- irq_set_chained_handler(irq, cpm2_cascade);
-#endif
+ mpc85xx_cpm2_pic_init();
}
/*
--
1.7.2.5
^ permalink raw reply related [flat|nested] 40+ messages in thread
* Re: [PATCH 14/14] 85xx: separate cpm2 pic init
2011-07-19 8:53 ` [PATCH 14/14] 85xx: separate cpm2 pic init Dmitry Eremin-Solenikov
@ 2011-07-19 14:18 ` Kumar Gala
0 siblings, 0 replies; 40+ messages in thread
From: Kumar Gala @ 2011-07-19 14:18 UTC (permalink / raw)
To: Dmitry Eremin-Solenikov; +Cc: Linux PPC Development, Paul Mackerras
On Jul 19, 2011, at 3:53 AM, Dmitry Eremin-Solenikov wrote:
> Separate handling of CPM2 PIC initialization to =
mpc85xx_cpm2_pic_init()
> function.
>=20
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
> arch/powerpc/platforms/85xx/ksi8560.c | 28 =
+------------------
> arch/powerpc/platforms/85xx/mpc85xx.h | 7 ++++
> arch/powerpc/platforms/85xx/mpc85xx_ads.c | 32 =
+--------------------
> arch/powerpc/platforms/85xx/mpc85xx_common.c | 39 =
++++++++++++++++++++++++++
> arch/powerpc/platforms/85xx/sbc8560.c | 32 =
+--------------------
> arch/powerpc/platforms/85xx/tqm85xx.c | 35 =
+----------------------
> 6 files changed, 50 insertions(+), 123 deletions(-)
looks fine, move earlier in the sequence.
- k=
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 00/14] Consolidation of 83xx/85xx board files
2011-07-19 8:53 [PATCH 00/14] Consolidation of 83xx/85xx board files Dmitry Eremin-Solenikov
` (13 preceding siblings ...)
2011-07-19 8:53 ` [PATCH 14/14] 85xx: separate cpm2 pic init Dmitry Eremin-Solenikov
@ 2011-07-19 14:20 ` Kumar Gala
2011-07-19 14:29 ` Kumar Gala
15 siblings, 0 replies; 40+ messages in thread
From: Kumar Gala @ 2011-07-19 14:20 UTC (permalink / raw)
To: Dmitry Eremin-Solenikov; +Cc: Linux PPC Development, Paul Mackerras
On Jul 19, 2011, at 3:53 AM, Dmitry Eremin-Solenikov wrote:
> I think it's already too late for this merge window, so this should =
stay
> for 3.2 merge window. Board files for mpc83xx platforms show lots of =
common
> code. Same goes for mpc85xx boards. This patchset is an initial =
attempt
> to merge some (most) of the common code. Based on the tree by Kumar =
Gala.
>=20
> The following changes since commit =
6471fc6630a507fd54fdaceceee1ddaf3c917cde:
>=20
> powerpc: Dont require a dma_ops struct to set dma mask (2011-07-08 =
00:21:36 -0500)
>=20
> Dmitry Eremin-Solenikov (14):
> 83xx: consolidate init_IRQ functions
> 83xx: consolidate of_platform_bus_probe calls
> mpc8349emitx: mark localbus as compatible with simple-bus
> 83xx/mpc834x_itx: drop pq2pro-localbus-specific code
> 83xx: headers cleanup
> 85xx/sbc8560: correct compilation if CONFIG_PHYS_ADDR_T_64BIT is =
set
> 85xx/ksi8560: declare that localbus is compatbile with simple-bus
> 85xx/sbc8560: declare that localbus is compatbile with simple-bus
> 85xx/sbc8548: read hardware revision when it's required for first =
time
> 85xx/mpc85xx_rdb: merge p1020_rdb and p2020_rdb machine entries
> 85xx: merge 32-bit QorIQ with DPA boards support
> 85xx/mpc85xx_ds,ads,cds: move .pci_exclude_device setting to =
machine definitions
> 85xx: consolidate of_platform_bus_probe calls
> 85xx: separate cpm2 pic init
Also patches subject should be of the form:
powerpc/85xx: ....
Please fix on next patch posting.
- k=
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 00/14] Consolidation of 83xx/85xx board files
2011-07-19 8:53 [PATCH 00/14] Consolidation of 83xx/85xx board files Dmitry Eremin-Solenikov
` (14 preceding siblings ...)
2011-07-19 14:20 ` [PATCH 00/14] Consolidation of 83xx/85xx board files Kumar Gala
@ 2011-07-19 14:29 ` Kumar Gala
15 siblings, 0 replies; 40+ messages in thread
From: Kumar Gala @ 2011-07-19 14:29 UTC (permalink / raw)
To: Dmitry Eremin-Solenikov; +Cc: Linux PPC Development, Paul Mackerras
On Jul 19, 2011, at 3:53 AM, Dmitry Eremin-Solenikov wrote:
> I think it's already too late for this merge window, so this should =
stay
> for 3.2 merge window. Board files for mpc83xx platforms show lots of =
common
> code. Same goes for mpc85xx boards. This patchset is an initial =
attempt
> to merge some (most) of the common code. Based on the tree by Kumar =
Gala.
>=20
> The following changes since commit =
6471fc6630a507fd54fdaceceee1ddaf3c917cde:
>=20
> powerpc: Dont require a dma_ops struct to set dma mask (2011-07-08 =
00:21:36 -0500)
>=20
> Dmitry Eremin-Solenikov (14):
> 83xx: consolidate init_IRQ functions
> 83xx: consolidate of_platform_bus_probe calls
> mpc8349emitx: mark localbus as compatible with simple-bus
> 83xx/mpc834x_itx: drop pq2pro-localbus-specific code
> 83xx: headers cleanup
> 85xx/sbc8560: correct compilation if CONFIG_PHYS_ADDR_T_64BIT is =
set
> 85xx/ksi8560: declare that localbus is compatbile with simple-bus
> 85xx/sbc8560: declare that localbus is compatbile with simple-bus
> 85xx/sbc8548: read hardware revision when it's required for first =
time
> 85xx/mpc85xx_rdb: merge p1020_rdb and p2020_rdb machine entries
> 85xx: merge 32-bit QorIQ with DPA boards support
> 85xx/mpc85xx_ds,ads,cds: move .pci_exclude_device setting to =
machine definitions
> 85xx: consolidate of_platform_bus_probe calls
> 85xx: separate cpm2 pic init
So for next round can you split this into two groups. One for 83xx and =
one for 85xx.
- k=
^ permalink raw reply [flat|nested] 40+ messages in thread