* [PATCH 1/5] of/platform: introduce arch_want_default_of_probe()
[not found] ` <1471918019-19472-1-git-send-email-haokexin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2016-08-23 2:06 ` Kevin Hao
2016-08-23 2:06 ` [PATCH 2/5] powerpc: introduce arch_enable_default_of_probe() Kevin Hao
` (3 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Kevin Hao @ 2016-08-23 2:06 UTC (permalink / raw)
To: linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
devicetree-u79uwXL29TY76Z2rM5mHXA
Cc: Benjamin Herrenschmidt, Michael Ellerman, Rob Herring
In commit fc520f8b4fa3 ("of/platform: disable the
of_platform_default_populate_init() for all the ppc boards"), we
disable the default of probe for ppc in order to fix some broken boards.
But we do want to leverage the default of probe function on ppc arch.
So introduce a weak function arch_want_default_of_probe(), we can
override it in arch specific code to enable/disable the default of probe
per board.
Signed-off-by: Kevin Hao <haokexin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
arch/powerpc/kernel/of_platform.c | 5 +++++
drivers/of/platform.c | 9 ++++++---
include/linux/of_platform.h | 1 +
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/kernel/of_platform.c b/arch/powerpc/kernel/of_platform.c
index b60a67d92ebd..ace7fe132b6f 100644
--- a/arch/powerpc/kernel/of_platform.c
+++ b/arch/powerpc/kernel/of_platform.c
@@ -122,3 +122,8 @@ static __init int of_pci_phb_init(void)
device_initcall(of_pci_phb_init);
#endif /* CONFIG_PPC_OF_PLATFORM_PCI */
+
+bool __init arch_want_default_of_probe(void)
+{
+ return false;
+}
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index f39ccd5aa701..6aaa1438c9cd 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -497,12 +497,16 @@ int of_platform_default_populate(struct device_node *root,
}
EXPORT_SYMBOL_GPL(of_platform_default_populate);
-#ifndef CONFIG_PPC
+bool __init __weak arch_want_default_of_probe(void)
+{
+ return true;
+}
+
static int __init of_platform_default_populate_init(void)
{
struct device_node *node;
- if (!of_have_populated_dt())
+ if (!arch_want_default_of_probe() || !of_have_populated_dt())
return -ENODEV;
/*
@@ -522,7 +526,6 @@ static int __init of_platform_default_populate_init(void)
return 0;
}
arch_initcall_sync(of_platform_default_populate_init);
-#endif
static int of_platform_device_destroy(struct device *dev, void *data)
{
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index 956a1006aefc..02cf1fdaa3d0 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -76,6 +76,7 @@ extern int of_platform_default_populate(struct device_node *root,
const struct of_dev_auxdata *lookup,
struct device *parent);
extern void of_platform_depopulate(struct device *parent);
+extern bool arch_want_default_of_probe(void);
#else
static inline int of_platform_populate(struct device_node *root,
const struct of_device_id *matches,
--
2.5.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/5] powerpc: introduce arch_enable_default_of_probe()
[not found] ` <1471918019-19472-1-git-send-email-haokexin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-08-23 2:06 ` [PATCH 1/5] of/platform: introduce arch_want_default_of_probe() Kevin Hao
@ 2016-08-23 2:06 ` Kevin Hao
2016-08-23 2:06 ` [PATCH 3/5] of/platform: introduce a generic way to declare a platform bus Kevin Hao
` (2 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Kevin Hao @ 2016-08-23 2:06 UTC (permalink / raw)
To: linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
devicetree-u79uwXL29TY76Z2rM5mHXA
Cc: Benjamin Herrenschmidt, Michael Ellerman, Rob Herring
We can use this function to enable the default of probe for one
board.
Signed-off-by: Kevin Hao <haokexin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
arch/powerpc/include/asm/setup.h | 1 +
arch/powerpc/kernel/of_platform.c | 9 ++++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/include/asm/setup.h b/arch/powerpc/include/asm/setup.h
index 654d64c9f3ac..213719882fe4 100644
--- a/arch/powerpc/include/asm/setup.h
+++ b/arch/powerpc/include/asm/setup.h
@@ -24,6 +24,7 @@ extern void reloc_got2(unsigned long);
void check_for_initrd(void);
void initmem_init(void);
void setup_panic(void);
+extern void arch_enable_default_of_probe(void);
#define ARCH_PANIC_TIMEOUT 180
#ifdef CONFIG_PPC_PSERIES
diff --git a/arch/powerpc/kernel/of_platform.c b/arch/powerpc/kernel/of_platform.c
index ace7fe132b6f..77402a14e928 100644
--- a/arch/powerpc/kernel/of_platform.c
+++ b/arch/powerpc/kernel/of_platform.c
@@ -123,7 +123,14 @@ device_initcall(of_pci_phb_init);
#endif /* CONFIG_PPC_OF_PLATFORM_PCI */
+static bool default_of_probe_enabled;
+
bool __init arch_want_default_of_probe(void)
{
- return false;
+ return default_of_probe_enabled;
+}
+
+void __init arch_enable_default_of_probe(void)
+{
+ default_of_probe_enabled = true;
}
--
2.5.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/5] of/platform: introduce a generic way to declare a platform bus
[not found] ` <1471918019-19472-1-git-send-email-haokexin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-08-23 2:06 ` [PATCH 1/5] of/platform: introduce arch_want_default_of_probe() Kevin Hao
2016-08-23 2:06 ` [PATCH 2/5] powerpc: introduce arch_enable_default_of_probe() Kevin Hao
@ 2016-08-23 2:06 ` Kevin Hao
[not found] ` <1471918019-19472-4-git-send-email-haokexin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-08-23 2:06 ` [PATCH 4/5] powerpc/83xx: factor out the common codes of setup arch functions Kevin Hao
2016-08-23 2:06 ` [PATCH 5/5] powerpc/83xx: enable the default of probe Kevin Hao
4 siblings, 1 reply; 9+ messages in thread
From: Kevin Hao @ 2016-08-23 2:06 UTC (permalink / raw)
To: linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
devicetree-u79uwXL29TY76Z2rM5mHXA
Cc: Benjamin Herrenschmidt, Michael Ellerman, Rob Herring,
Arnd Bergmann
The specific buses which need to be probed at boot time are different
between platforms. Instead of put all the buses into the default
of_default_bus_match_table[] match tables, this patch introduces a
general way to declare a platform bus.
Signed-off-by: Kevin Hao <haokexin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
drivers/of/platform.c | 12 +++++++++++-
include/asm-generic/vmlinux.lds.h | 2 ++
include/linux/of.h | 22 ++++++++++++++++++++++
include/linux/of_platform.h | 5 +++++
4 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 6aaa1438c9cd..a7bfe8504caa 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -488,11 +488,21 @@ int of_platform_populate(struct device_node *root,
}
EXPORT_SYMBOL_GPL(of_platform_populate);
+static const struct of_device_id __bus_of_table_sentinel
+ __used __section(__bus_of_table_end);
+
int of_platform_default_populate(struct device_node *root,
const struct of_dev_auxdata *lookup,
struct device *parent)
{
- return of_platform_populate(root, of_default_bus_match_table, lookup,
+ const struct of_device_id *matches;
+
+ if (__bus_of_table != &__bus_of_table_sentinel)
+ matches = __bus_of_table;
+ else
+ matches = of_default_bus_match_table;
+
+ return of_platform_populate(root, matches, lookup,
parent);
}
EXPORT_SYMBOL_GPL(of_platform_default_populate);
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 24563970ff7b..43aa725e86fa 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -179,6 +179,7 @@
#define RESERVEDMEM_OF_TABLES() OF_TABLE(CONFIG_OF_RESERVED_MEM, reservedmem)
#define CPU_METHOD_OF_TABLES() OF_TABLE(CONFIG_SMP, cpu_method)
#define CPUIDLE_METHOD_OF_TABLES() OF_TABLE(CONFIG_CPU_IDLE, cpuidle_method)
+#define BUS_OF_TABLES() OF_TABLE(CONFIG_OF, bus)
#ifdef CONFIG_ACPI
#define ACPI_PROBE_TABLE(name) \
@@ -542,6 +543,7 @@
IOMMU_OF_TABLES() \
CPU_METHOD_OF_TABLES() \
CPUIDLE_METHOD_OF_TABLES() \
+ BUS_OF_TABLES() \
KERNEL_DTB() \
IRQCHIP_OF_MATCH_TABLE() \
ACPI_PROBE_TABLE(irqchip) \
diff --git a/include/linux/of.h b/include/linux/of.h
index 3d9ff8e9d803..3a53c898cde9 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -1002,12 +1002,28 @@ static inline int of_get_available_child_count(const struct device_node *np)
__used __section(__##table##_of_table) \
= { .compatible = compat, \
.data = (fn == (fn_type)NULL) ? fn : fn }
+
+#define __OF_DECLARE_ALL(table, entry, _name, _type, _compat, _data) \
+ static const struct of_device_id __of_table_##entry \
+ __used __section(__##table##_of_table) \
+ = { .name = _name, \
+ .type = _type, \
+ .compatible = _compat, \
+ .data = _data }
#else
#define _OF_DECLARE(table, name, compat, fn, fn_type) \
static const struct of_device_id __of_table_##name \
__attribute__((unused)) \
= { .compatible = compat, \
.data = (fn == (fn_type)NULL) ? fn : fn }
+
+#define __OF_DECLARE_ALL(table, entry, _name, _type, _compat, _data) \
+ static const struct of_device_id __of_table_##_name \
+ __attribute__((unused)) \
+ = { .name = _name, \
+ .type = _type, \
+ .compatible = _compat, \
+ .data = _data }
#endif
typedef int (*of_init_fn_2)(struct device_node *, struct device_node *);
@@ -1020,6 +1036,12 @@ typedef void (*of_init_fn_1)(struct device_node *);
_OF_DECLARE(table, name, compat, fn, of_init_fn_1_ret)
#define OF_DECLARE_2(table, name, compat, fn) \
_OF_DECLARE(table, name, compat, fn, of_init_fn_2)
+#define OF_DECLARE_COMPAT(table, name, compat) \
+ __OF_DECLARE_ALL(table, name, "", "", compat, NULL)
+#define OF_DECLARE_TYPE(table, name, type) \
+ __OF_DECLARE_ALL(table, name, "", type, "", NULL)
+#define OF_DECLARE_NAME(table, name, node_name) \
+ __OF_DECLARE_ALL(table, name, node_name, "", "", NULL)
/**
* struct of_changeset_entry - Holds a changeset entry
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index 02cf1fdaa3d0..35c5b66f61f0 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -17,6 +17,10 @@
#include <linux/of_device.h>
#include <linux/platform_device.h>
+#define BUS_OF_DECLARE_COMPAT(name, compat) OF_DECLARE_COMPAT(bus, name, compat)
+#define BUS_OF_DECLARE_TYPE(name, type) OF_DECLARE_TYPE(bus, name, type)
+#define BUS_OF_DECLARE_NAME(name, node_name) OF_DECLARE_NAME(bus, name, node_name)
+
/**
* struct of_dev_auxdata - lookup table entry for device names & platform_data
* @compatible: compatible value of node to match against node
@@ -52,6 +56,7 @@ struct of_dev_auxdata {
.platform_data = _pdata }
extern const struct of_device_id of_default_bus_match_table[];
+extern const struct of_device_id __bus_of_table[];
/* Platform drivers register/unregister */
extern struct platform_device *of_device_alloc(struct device_node *np,
--
2.5.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 4/5] powerpc/83xx: factor out the common codes of setup arch functions
[not found] ` <1471918019-19472-1-git-send-email-haokexin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
` (2 preceding siblings ...)
2016-08-23 2:06 ` [PATCH 3/5] of/platform: introduce a generic way to declare a platform bus Kevin Hao
@ 2016-08-23 2:06 ` Kevin Hao
2016-08-23 2:06 ` [PATCH 5/5] powerpc/83xx: enable the default of probe Kevin Hao
4 siblings, 0 replies; 9+ messages in thread
From: Kevin Hao @ 2016-08-23 2:06 UTC (permalink / raw)
To: linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
devicetree-u79uwXL29TY76Z2rM5mHXA
Cc: Benjamin Herrenschmidt, Michael Ellerman, Rob Herring, Scott Wood
Factor out the common codes of setup arch functions to a separate
function. It does make no sense to print a board specific info
in setup arch functions, so use a more general one.
For ASP8347E board, there is no pci device node. So it is safe to
invoke mpc83xx_setup_pci() in its setup arch function even there is
no such invocation in its original setup arch function.
Signed-off-by: Kevin Hao <haokexin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
arch/powerpc/platforms/83xx/asp834x.c | 4 +---
arch/powerpc/platforms/83xx/km83xx.c | 5 +----
arch/powerpc/platforms/83xx/misc.c | 8 ++++++++
arch/powerpc/platforms/83xx/mpc830x_rdb.c | 5 +----
arch/powerpc/platforms/83xx/mpc831x_rdb.c | 5 +----
arch/powerpc/platforms/83xx/mpc832x_mds.c | 5 +----
arch/powerpc/platforms/83xx/mpc832x_rdb.c | 5 +----
arch/powerpc/platforms/83xx/mpc834x_itx.c | 5 +----
arch/powerpc/platforms/83xx/mpc834x_mds.c | 5 +----
arch/powerpc/platforms/83xx/mpc836x_mds.c | 5 +----
arch/powerpc/platforms/83xx/mpc836x_rdk.c | 5 +----
arch/powerpc/platforms/83xx/mpc837x_mds.c | 5 +----
arch/powerpc/platforms/83xx/mpc837x_rdb.c | 5 +----
arch/powerpc/platforms/83xx/mpc83xx.h | 1 +
arch/powerpc/platforms/83xx/sbc834x.c | 5 +----
15 files changed, 22 insertions(+), 51 deletions(-)
diff --git a/arch/powerpc/platforms/83xx/asp834x.c b/arch/powerpc/platforms/83xx/asp834x.c
index 17e54339f8d9..575afd6eb36a 100644
--- a/arch/powerpc/platforms/83xx/asp834x.c
+++ b/arch/powerpc/platforms/83xx/asp834x.c
@@ -30,9 +30,7 @@
*/
static void __init asp834x_setup_arch(void)
{
- if (ppc_md.progress)
- ppc_md.progress("asp834x_setup_arch()", 0);
-
+ mpc83xx_setup_arch();
mpc834x_usb_cfg();
}
diff --git a/arch/powerpc/platforms/83xx/km83xx.c b/arch/powerpc/platforms/83xx/km83xx.c
index e7fbd6366abb..d8642a4afc74 100644
--- a/arch/powerpc/platforms/83xx/km83xx.c
+++ b/arch/powerpc/platforms/83xx/km83xx.c
@@ -130,10 +130,7 @@ static void __init mpc83xx_km_setup_arch(void)
struct device_node *np;
#endif
- if (ppc_md.progress)
- ppc_md.progress("kmpbec83xx_setup_arch()", 0);
-
- mpc83xx_setup_pci();
+ mpc83xx_setup_arch();
#ifdef CONFIG_QUICC_ENGINE
np = of_find_node_by_name(NULL, "par_io");
diff --git a/arch/powerpc/platforms/83xx/misc.c b/arch/powerpc/platforms/83xx/misc.c
index 8899aa9d11f5..d75c9816a5c9 100644
--- a/arch/powerpc/platforms/83xx/misc.c
+++ b/arch/powerpc/platforms/83xx/misc.c
@@ -142,3 +142,11 @@ void __init mpc83xx_setup_pci(void)
mpc83xx_add_bridge(np);
}
#endif
+
+void __init mpc83xx_setup_arch(void)
+{
+ if (ppc_md.progress)
+ ppc_md.progress("mpc83xx_setup_arch()", 0);
+
+ mpc83xx_setup_pci();
+}
diff --git a/arch/powerpc/platforms/83xx/mpc830x_rdb.c b/arch/powerpc/platforms/83xx/mpc830x_rdb.c
index 040d5d085467..272c41c387b9 100644
--- a/arch/powerpc/platforms/83xx/mpc830x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc830x_rdb.c
@@ -27,10 +27,7 @@
*/
static void __init mpc830x_rdb_setup_arch(void)
{
- if (ppc_md.progress)
- ppc_md.progress("mpc830x_rdb_setup_arch()", 0);
-
- mpc83xx_setup_pci();
+ mpc83xx_setup_arch();
mpc831x_usb_cfg();
}
diff --git a/arch/powerpc/platforms/83xx/mpc831x_rdb.c b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
index 40e0d8307b59..fd80fd570e67 100644
--- a/arch/powerpc/platforms/83xx/mpc831x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
@@ -28,10 +28,7 @@
*/
static void __init mpc831x_rdb_setup_arch(void)
{
- if (ppc_md.progress)
- ppc_md.progress("mpc831x_rdb_setup_arch()", 0);
-
- mpc83xx_setup_pci();
+ mpc83xx_setup_arch();
mpc831x_usb_cfg();
}
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index cdfa47c4d394..bb7b25acf26f 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -58,8 +58,7 @@ static void __init mpc832x_sys_setup_arch(void)
struct device_node *np;
u8 __iomem *bcsr_regs = NULL;
- if (ppc_md.progress)
- ppc_md.progress("mpc832x_sys_setup_arch()", 0);
+ mpc83xx_setup_arch();
/* Map BCSR area */
np = of_find_node_by_name(NULL, "bcsr");
@@ -71,8 +70,6 @@ static void __init mpc832x_sys_setup_arch(void)
of_node_put(np);
}
- mpc83xx_setup_pci();
-
#ifdef CONFIG_QUICC_ENGINE
if ((np = of_find_node_by_name(NULL, "par_io")) != NULL) {
par_io_init(np);
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index 2ef03e7d248c..09d1bbf25b5d 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -197,10 +197,7 @@ static void __init mpc832x_rdb_setup_arch(void)
struct device_node *np;
#endif
- if (ppc_md.progress)
- ppc_md.progress("mpc832x_rdb_setup_arch()", 0);
-
- mpc83xx_setup_pci();
+ mpc83xx_setup_arch();
#ifdef CONFIG_QUICC_ENGINE
if ((np = of_find_node_by_name(NULL, "par_io")) != NULL) {
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c
index 8fd0c1e8b182..73a5267df497 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_itx.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c
@@ -57,10 +57,7 @@ machine_device_initcall(mpc834x_itx, mpc834x_itx_declare_of_platform_devices);
*/
static void __init mpc834x_itx_setup_arch(void)
{
- if (ppc_md.progress)
- ppc_md.progress("mpc834x_itx_setup_arch()", 0);
-
- mpc83xx_setup_pci();
+ mpc83xx_setup_arch();
mpc834x_usb_cfg();
}
diff --git a/arch/powerpc/platforms/83xx/mpc834x_mds.c b/arch/powerpc/platforms/83xx/mpc834x_mds.c
index eeaee6123bb3..009cfc18a4ee 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_mds.c
@@ -76,10 +76,7 @@ static int mpc834xemds_usb_cfg(void)
*/
static void __init mpc834x_mds_setup_arch(void)
{
- if (ppc_md.progress)
- ppc_md.progress("mpc834x_mds_setup_arch()", 0);
-
- mpc83xx_setup_pci();
+ mpc83xx_setup_arch();
mpc834xemds_usb_cfg();
}
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c
index dacf4c2df069..4fc3051c2b2e 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
@@ -66,8 +66,7 @@ static void __init mpc836x_mds_setup_arch(void)
struct device_node *np;
u8 __iomem *bcsr_regs = NULL;
- if (ppc_md.progress)
- ppc_md.progress("mpc836x_mds_setup_arch()", 0);
+ mpc83xx_setup_arch();
/* Map BCSR area */
np = of_find_node_by_name(NULL, "bcsr");
@@ -79,8 +78,6 @@ static void __init mpc836x_mds_setup_arch(void)
of_node_put(np);
}
- mpc83xx_setup_pci();
-
#ifdef CONFIG_QUICC_ENGINE
if ((np = of_find_node_by_name(NULL, "par_io")) != NULL) {
par_io_init(np);
diff --git a/arch/powerpc/platforms/83xx/mpc836x_rdk.c b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
index cf67ac93ddcb..93f024fd9b45 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_rdk.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
@@ -31,10 +31,7 @@ machine_device_initcall(mpc836x_rdk, mpc83xx_declare_of_platform_devices);
static void __init mpc836x_rdk_setup_arch(void)
{
- if (ppc_md.progress)
- ppc_md.progress("mpc836x_rdk_setup_arch()", 0);
-
- mpc83xx_setup_pci();
+ mpc83xx_setup_arch();
}
/*
diff --git a/arch/powerpc/platforms/83xx/mpc837x_mds.c b/arch/powerpc/platforms/83xx/mpc837x_mds.c
index 652b97d699c9..3b34cc1f626c 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_mds.c
@@ -79,10 +79,7 @@ out:
*/
static void __init mpc837x_mds_setup_arch(void)
{
- if (ppc_md.progress)
- ppc_md.progress("mpc837x_mds_setup_arch()", 0);
-
- mpc83xx_setup_pci();
+ mpc83xx_setup_arch();
mpc837xmds_usb_cfg();
}
diff --git a/arch/powerpc/platforms/83xx/mpc837x_rdb.c b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
index 667731d81676..0c55fa6af2d5 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
@@ -50,10 +50,7 @@ static void mpc837x_rdb_sd_cfg(void)
*/
static void __init mpc837x_rdb_setup_arch(void)
{
- if (ppc_md.progress)
- ppc_md.progress("mpc837x_rdb_setup_arch()", 0);
-
- mpc83xx_setup_pci();
+ mpc83xx_setup_arch();
mpc837x_usb_cfg();
mpc837x_rdb_sd_cfg();
}
diff --git a/arch/powerpc/platforms/83xx/mpc83xx.h b/arch/powerpc/platforms/83xx/mpc83xx.h
index ad484199eff7..636eb9d0401a 100644
--- a/arch/powerpc/platforms/83xx/mpc83xx.h
+++ b/arch/powerpc/platforms/83xx/mpc83xx.h
@@ -86,5 +86,6 @@ extern void mpc83xx_setup_pci(void);
#endif
extern int mpc83xx_declare_of_platform_devices(void);
+extern void mpc83xx_setup_arch(void);
#endif /* __MPC83XX_H__ */
diff --git a/arch/powerpc/platforms/83xx/sbc834x.c b/arch/powerpc/platforms/83xx/sbc834x.c
index b867e88dfb0d..cb4bdabfdf1c 100644
--- a/arch/powerpc/platforms/83xx/sbc834x.c
+++ b/arch/powerpc/platforms/83xx/sbc834x.c
@@ -47,10 +47,7 @@
*/
static void __init sbc834x_setup_arch(void)
{
- if (ppc_md.progress)
- ppc_md.progress("sbc834x_setup_arch()", 0);
-
- mpc83xx_setup_pci();
+ mpc83xx_setup_arch();
}
machine_device_initcall(sbc834x, mpc83xx_declare_of_platform_devices);
--
2.5.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 5/5] powerpc/83xx: enable the default of probe
[not found] ` <1471918019-19472-1-git-send-email-haokexin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
` (3 preceding siblings ...)
2016-08-23 2:06 ` [PATCH 4/5] powerpc/83xx: factor out the common codes of setup arch functions Kevin Hao
@ 2016-08-23 2:06 ` Kevin Hao
4 siblings, 0 replies; 9+ messages in thread
From: Kevin Hao @ 2016-08-23 2:06 UTC (permalink / raw)
To: linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
devicetree-u79uwXL29TY76Z2rM5mHXA
Cc: Benjamin Herrenschmidt, Michael Ellerman, Rob Herring, Scott Wood
Use the default of probe function of_platform_default_populate_init()
to kill the arch specific duplicated codes.
Signed-off-by: Kevin Hao <haokexin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
arch/powerpc/platforms/83xx/asp834x.c | 2 --
arch/powerpc/platforms/83xx/km83xx.c | 2 --
arch/powerpc/platforms/83xx/misc.c | 25 ++++++++-----------------
arch/powerpc/platforms/83xx/mpc830x_rdb.c | 2 --
arch/powerpc/platforms/83xx/mpc831x_rdb.c | 2 --
arch/powerpc/platforms/83xx/mpc832x_mds.c | 2 --
arch/powerpc/platforms/83xx/mpc832x_rdb.c | 2 --
arch/powerpc/platforms/83xx/mpc834x_itx.c | 12 ------------
arch/powerpc/platforms/83xx/mpc834x_mds.c | 2 --
arch/powerpc/platforms/83xx/mpc836x_mds.c | 2 --
arch/powerpc/platforms/83xx/mpc836x_rdk.c | 2 --
arch/powerpc/platforms/83xx/mpc837x_mds.c | 2 --
arch/powerpc/platforms/83xx/mpc837x_rdb.c | 2 --
arch/powerpc/platforms/83xx/mpc83xx.h | 1 -
arch/powerpc/platforms/83xx/sbc834x.c | 2 --
15 files changed, 8 insertions(+), 54 deletions(-)
diff --git a/arch/powerpc/platforms/83xx/asp834x.c b/arch/powerpc/platforms/83xx/asp834x.c
index 575afd6eb36a..2219a1f8c535 100644
--- a/arch/powerpc/platforms/83xx/asp834x.c
+++ b/arch/powerpc/platforms/83xx/asp834x.c
@@ -34,8 +34,6 @@ static void __init asp834x_setup_arch(void)
mpc834x_usb_cfg();
}
-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 d8642a4afc74..e2276f12eafe 100644
--- a/arch/powerpc/platforms/83xx/km83xx.c
+++ b/arch/powerpc/platforms/83xx/km83xx.c
@@ -154,8 +154,6 @@ static void __init mpc83xx_km_setup_arch(void)
#endif /* CONFIG_QUICC_ENGINE */
}
-machine_device_initcall(mpc83xx_km, mpc83xx_declare_of_platform_devices);
-
/* list of the supported boards */
static char *board[] __initdata = {
"Keymile,KMETER1",
diff --git a/arch/powerpc/platforms/83xx/misc.c b/arch/powerpc/platforms/83xx/misc.c
index d75c9816a5c9..4a88edd51d1a 100644
--- a/arch/powerpc/platforms/83xx/misc.c
+++ b/arch/powerpc/platforms/83xx/misc.c
@@ -114,23 +114,6 @@ void __init mpc83xx_ipic_and_qe_init_IRQ(void)
}
#endif /* CONFIG_QUICC_ENGINE */
-static const struct of_device_id of_bus_ids[] __initconst = {
- { .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;
-}
-
#ifdef CONFIG_PCI
void __init mpc83xx_setup_pci(void)
{
@@ -149,4 +132,12 @@ void __init mpc83xx_setup_arch(void)
ppc_md.progress("mpc83xx_setup_arch()", 0);
mpc83xx_setup_pci();
+ arch_enable_default_of_probe();
}
+
+BUS_OF_DECLARE_TYPE(type_soc, "soc");
+BUS_OF_DECLARE_TYPE(type_qe, "qe");
+BUS_OF_DECLARE_COMPAT(simple_bus, "simple-bus");
+BUS_OF_DECLARE_COMPAT(gianfar, "gianfar");
+BUS_OF_DECLARE_COMPAT(gpio_leds, "gpio-leds");
+BUS_OF_DECLARE_COMPAT(qe, "fsl,qe");
diff --git a/arch/powerpc/platforms/83xx/mpc830x_rdb.c b/arch/powerpc/platforms/83xx/mpc830x_rdb.c
index 272c41c387b9..0d073102cfbb 100644
--- a/arch/powerpc/platforms/83xx/mpc830x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc830x_rdb.c
@@ -46,8 +46,6 @@ static int __init mpc830x_rdb_probe(void)
return of_device_compatible_match(of_root, board);
}
-machine_device_initcall(mpc830x_rdb, mpc83xx_declare_of_platform_devices);
-
define_machine(mpc830x_rdb) {
.name = "MPC830x RDB",
.probe = mpc830x_rdb_probe,
diff --git a/arch/powerpc/platforms/83xx/mpc831x_rdb.c b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
index fd80fd570e67..16926fb95592 100644
--- a/arch/powerpc/platforms/83xx/mpc831x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
@@ -46,8 +46,6 @@ static int __init mpc831x_rdb_probe(void)
return of_device_compatible_match(of_root, board);
}
-machine_device_initcall(mpc831x_rdb, mpc83xx_declare_of_platform_devices);
-
define_machine(mpc831x_rdb) {
.name = "MPC831x RDB",
.probe = mpc831x_rdb_probe,
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index bb7b25acf26f..01c0602347a7 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -92,8 +92,6 @@ static void __init mpc832x_sys_setup_arch(void)
#endif /* CONFIG_QUICC_ENGINE */
}
-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 09d1bbf25b5d..4626d909e7fa 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -210,8 +210,6 @@ static void __init mpc832x_rdb_setup_arch(void)
#endif /* CONFIG_QUICC_ENGINE */
}
-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 73a5267df497..60717eb6b029 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_itx.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c
@@ -38,18 +38,6 @@
#include "mpc83xx.h"
-static const struct of_device_id mpc834x_itx_ids[] __initconst = {
- { .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);
-
/* ************************************************************************
*
* Setup the architecture
diff --git a/arch/powerpc/platforms/83xx/mpc834x_mds.c b/arch/powerpc/platforms/83xx/mpc834x_mds.c
index 009cfc18a4ee..64ba2f8eab9f 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_mds.c
@@ -81,8 +81,6 @@ static void __init mpc834x_mds_setup_arch(void)
mpc834xemds_usb_cfg();
}
-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 4fc3051c2b2e..0cc26696ca06 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
@@ -135,8 +135,6 @@ static void __init mpc836x_mds_setup_arch(void)
#endif /* CONFIG_QUICC_ENGINE */
}
-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 93f024fd9b45..ac36ea02c0a2 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_rdk.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
@@ -27,8 +27,6 @@
#include "mpc83xx.h"
-machine_device_initcall(mpc836x_rdk, mpc83xx_declare_of_platform_devices);
-
static void __init mpc836x_rdk_setup_arch(void)
{
mpc83xx_setup_arch();
diff --git a/arch/powerpc/platforms/83xx/mpc837x_mds.c b/arch/powerpc/platforms/83xx/mpc837x_mds.c
index 3b34cc1f626c..2e4f29190844 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_mds.c
@@ -83,8 +83,6 @@ static void __init mpc837x_mds_setup_arch(void)
mpc837xmds_usb_cfg();
}
-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 0c55fa6af2d5..9d0c9c6af736 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
@@ -55,8 +55,6 @@ static void __init mpc837x_rdb_setup_arch(void)
mpc837x_rdb_sd_cfg();
}
-machine_device_initcall(mpc837x_rdb, mpc83xx_declare_of_platform_devices);
-
static const char * const board[] __initconst = {
"fsl,mpc8377rdb",
"fsl,mpc8378rdb",
diff --git a/arch/powerpc/platforms/83xx/mpc83xx.h b/arch/powerpc/platforms/83xx/mpc83xx.h
index 636eb9d0401a..77f9658aa22e 100644
--- a/arch/powerpc/platforms/83xx/mpc83xx.h
+++ b/arch/powerpc/platforms/83xx/mpc83xx.h
@@ -85,7 +85,6 @@ extern void mpc83xx_setup_pci(void);
#define mpc83xx_setup_pci() do {} while (0)
#endif
-extern int mpc83xx_declare_of_platform_devices(void);
extern void mpc83xx_setup_arch(void);
#endif /* __MPC83XX_H__ */
diff --git a/arch/powerpc/platforms/83xx/sbc834x.c b/arch/powerpc/platforms/83xx/sbc834x.c
index cb4bdabfdf1c..e750a0ed644a 100644
--- a/arch/powerpc/platforms/83xx/sbc834x.c
+++ b/arch/powerpc/platforms/83xx/sbc834x.c
@@ -50,8 +50,6 @@ static void __init sbc834x_setup_arch(void)
mpc83xx_setup_arch();
}
-machine_device_initcall(sbc834x, mpc83xx_declare_of_platform_devices);
-
/*
* Called very early, MMU is off, device-tree isn't unflattened
*/
--
2.5.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 9+ messages in thread