ppc32: use the default of_platform_default_populate_init() for 83xx boards
Subsystems (4)
cover ppc32: use the default of_platform_default_populate_init() for 83xx boards
Hi,
This is a follow on patch series of [1]. This tries to drop the arch specific codes of bus probe by using the common of_platform_default_populate_init() function. I just took the 83xx boards as an example. If you guys think that this is doable, I can change the remaining ppc boards to use this method for the of probe.
[1] https://patchwork.ozlabs.org/patch/658531/
Kevin Hao (5):
of/platform: introduce arch_want_default_of_probe()
powerpc: introduce arch_enable_default_of_probe() of/platform: introduce a generic way to declare a platform bus powerpc/83xx: factor out the common codes of setup arch functions powerpc/83xx: enable the default of probe
arch/powerpc/include/asm/setup.h | 1 + arch/powerpc/kernel/of_platform.c | 12 +++++++++++ arch/powerpc/platforms/83xx/asp834x.c | 6 +----- arch/powerpc/platforms/83xx/km83xx.c | 7 +------ arch/powerpc/platforms/83xx/misc.c | 33 +++++++++++++++---------------- arch/powerpc/platforms/83xx/mpc830x_rdb.c | 7 +------ arch/powerpc/platforms/83xx/mpc831x_rdb.c | 7 +------ arch/powerpc/platforms/83xx/mpc832x_mds.c | 7 +------ arch/powerpc/platforms/83xx/mpc832x_rdb.c | 7 +------ arch/powerpc/platforms/83xx/mpc834x_itx.c | 17 +--------------- arch/powerpc/platforms/83xx/mpc834x_mds.c | 7 +------ arch/powerpc/platforms/83xx/mpc836x_mds.c | 7 +------ arch/powerpc/platforms/83xx/mpc836x_rdk.c | 7 +------ arch/powerpc/platforms/83xx/mpc837x_mds.c | 7 +------ arch/powerpc/platforms/83xx/mpc837x_rdb.c | 7 +------ arch/powerpc/platforms/83xx/mpc83xx.h | 2 +- arch/powerpc/platforms/83xx/sbc834x.c | 7 +------ drivers/of/platform.c | 21 ++++++++++++++++---- include/asm-generic/vmlinux.lds.h | 2 ++ include/linux/of.h | 22 +++++++++++++++++++++ include/linux/of_platform.h | 6 ++++++ 21 files changed, 90 insertions(+), 109 deletions(-)
Signature · 6 lines
2.5.5 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/5 of/platform: introduce arch_want_default_of_probe()
In reply to a message not in the archiveIn 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.
--- 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(-)
arch/powerpc/kernel/of_platform.c +5 -0
@@ -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; +}
drivers/of/platform.c +6 -3
@@ -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) {
include/linux/of_platform.h +1 -0
@@ -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,
Signature · 6 lines
2.5.5 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 2/5 powerpc: introduce arch_enable_default_of_probe()
In reply to a message not in the archiveWe can use this function to enable the default of probe for one board.
--- arch/powerpc/include/asm/setup.h | 1 + arch/powerpc/kernel/of_platform.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-)
arch/powerpc/include/asm/setup.h +1 -0
@@ -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
arch/powerpc/kernel/of_platform.c +8 -1
@@ -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; }
Signature · 6 lines
2.5.5 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 3/5 of/platform: introduce a generic way to declare a platform bus
In reply to a message not in the archiveThe 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.
--- 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(-)
drivers/of/platform.c +11 -1
@@ -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);
include/asm-generic/vmlinux.lds.h +2 -0
@@ -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) \
include/linux/of.h +22 -0
@@ -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
include/linux/of_platform.h +5 -0
@@ -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,
Signature · 6 lines
2.5.5 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 4/5 powerpc/83xx: factor out the common codes of setup arch functions
In reply to a message not in the archiveFactor 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.
--- 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(-)
arch/powerpc/platforms/83xx/asp834x.c +1 -3
@@ -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 (); }
arch/powerpc/platforms/83xx/km83xx.c +1 -4
@@ -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" );
arch/powerpc/platforms/83xx/misc.c +8 -0
@@ -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 (); +}
arch/powerpc/platforms/83xx/mpc830x_rdb.c +1 -4
@@ -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 (); }
arch/powerpc/platforms/83xx/mpc831x_rdb.c +1 -4
@@ -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 (); }
arch/powerpc/platforms/83xx/mpc832x_mds.c +1 -4
@@ -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);
arch/powerpc/platforms/83xx/mpc832x_rdb.c +1 -4
@@ -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 ) {
arch/powerpc/platforms/83xx/mpc834x_itx.c +1 -4
@@ -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 (); }
arch/powerpc/platforms/83xx/mpc834x_mds.c +1 -4
@@ -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 (); }
arch/powerpc/platforms/83xx/mpc836x_mds.c +1 -4
@@ -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);
arch/powerpc/platforms/83xx/mpc836x_rdk.c +1 -4
@@ -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 (); }/*
arch/powerpc/platforms/83xx/mpc837x_mds.c +1 -4
@@ -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 (); }
arch/powerpc/platforms/83xx/mpc837x_rdb.c +1 -4
@@ -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 (); }
arch/powerpc/platforms/83xx/mpc83xx.h +1 -0
@@ -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__ */
arch/powerpc/platforms/83xx/sbc834x.c +1 -4
@@ -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);
Signature · 6 lines
2.5.5 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 5/5 powerpc/83xx: enable the default of probe
In reply to a message not in the archiveUse the default of probe function of_platform_default_populate_init() to kill the arch specific duplicated codes.
--- 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(-)
arch/powerpc/platforms/83xx/asp834x.c +0 -2
@@ -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 */
arch/powerpc/platforms/83xx/km83xx.c +0 -2
@@ -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" ,
arch/powerpc/platforms/83xx/misc.c +8 -17
@@ -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" );
arch/powerpc/platforms/83xx/mpc830x_rdb.c +0 -2
@@ -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,
arch/powerpc/platforms/83xx/mpc831x_rdb.c +0 -2
@@ -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,
arch/powerpc/platforms/83xx/mpc832x_mds.c +0 -2
@@ -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 */
arch/powerpc/platforms/83xx/mpc832x_rdb.c +0 -2
@@ -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 */
arch/powerpc/platforms/83xx/mpc834x_itx.c +0 -12
@@ -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
arch/powerpc/platforms/83xx/mpc834x_mds.c +0 -2
@@ -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 */
arch/powerpc/platforms/83xx/mpc836x_mds.c +0 -2
@@ -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 ) {
arch/powerpc/platforms/83xx/mpc836x_rdk.c +0 -2
@@ -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 ();
arch/powerpc/platforms/83xx/mpc837x_mds.c +0 -2
@@ -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 */
arch/powerpc/platforms/83xx/mpc837x_rdb.c +0 -2
@@ -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" ,
arch/powerpc/platforms/83xx/mpc83xx.h +0 -1
@@ -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__ */
arch/powerpc/platforms/83xx/sbc834x.c +0 -2
@@ -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 */
Signature · 6 lines
2.5.5 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/5] of/platform: introduce a generic way to declare a platform bus
In reply to a message not in the archiveQuoted 4 lines · Kevin Hao
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.
I'd prefer to not do this with linker sections if possible. Doesn't PPC have machine descriptors that you could add the match table to? If that table exists then arch_want_default_of_probe could return a pointer to it.
Are there any platforms that work with the default match table? I'd be fine with adding some strings to the default if that helps.
{ .type = "soc", },
device_type is deprecated for FDT, so this shouldn't be needed except for really old stuff.
{ .compatible = "soc", },
Doesn't appear in kernel dts files. Could be out of tree or old ones?
{ .compatible = "simple-bus" },
Already handled.
{ .compatible = "gianfar" },
Seems like the children of this should be probed by the gianfar driver.
{ .compatible = "gpio-leds", },
I don't think this is needed.
{ .type = "qe", },
Again, deprecated.
{ .compatible = "fsl,qe", },
No issue to add this. Though, you could also probe it from mpc85xx_qe_init().
Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/5] of/platform: introduce a generic way to declare a platform bus
Quoted 10 lines · Rob Herring
Quoted 4 lines · Kevin Hao
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.
I'd prefer to not do this with linker sections if possible. Doesn't PPC have machine descriptors that you could add the match table to? If that table exists then
arch_want_default_of_probecould return a pointer to it.
Hmm, I thought about adding a match table in ppc_md. But it is very arch specific. I thought maybe other archs also need to probe some arch or even board specific bus, so I introduces these arch independent macros and wish it may be useful for other archs. :-)
Quoted 2 lines
Are there any platforms that work with the default match table?
Yes, some boards can work with the default match table. But most won't.
Quoted 24 lines
I'd be
fine with adding some strings to the default if that helps.{ .type = "soc", },
device_typeis deprecated for FDT, so this shouldn't be needed except for really old stuff.{ .compatible = "soc", },
Doesn't appear in kernel dts files. Could be out of tree or old ones?
{ .compatible = "simple-bus" },
Already handled.
{ .compatible = "gianfar" },
Seems like the children of this should be probed by the gianfar driver.
{ .compatible = "gpio-leds", },
I don't think this is needed.
Quoted 7 lines
{ .type = "qe", },
Again, deprecated.
{ .compatible = "fsl,qe", },
No issue to add this. Though, you could also probe it from
mpc85xx_qe_init().
Do you mean we put all the probe of the specific bus into the corresponding drivers? Yes, if we do so, we probably can shrink the default match table to be something like this:
{ .compatible = "soc", },
{ .compatible = "simple-bus" },OK, now we have three options to fix this issue:
a) Create a separate link section to contain all the buses needed to be probed. Just as what this patch does.
b) Put the match table into the machine descriptor.
c) Sprinkle the probe of all the specific bus into the corresponding driver (such as gian, pcie controller) and the default probe function only handle the very common buses.
So what option do you guys think is best?
Thanks,
Kevin
Re: [PATCH 3/5] of/platform: introduce a generic way to declare a platform bus
Quoted 12 lines · Kevin Hao
Quoted 10 lines · Rob Herring
Quoted 4 lines · Kevin Hao
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.
I'd prefer to not do this with linker sections if possible. Doesn't PPC have machine descriptors that you could add the match table to? If that table exists then
arch_want_default_of_probecould return a pointer to it.
Quoted 4 lines
Hmm, I thought about adding a match table in
ppc_md. But it is very arch specific. I thought maybe other archs also need to probe some arch or even board specific bus, so I introduces these arch independent macros and wish it may be useful for other archs. :-)
The match table ptr coming from ppc_md would be ppc specific, but that would be part of the ppc arch_want_default_of_probe function. Other arches can do it differently.
Now that I've looked more closely, of_platform_populate has more problems being re-entrant
Quoted 58 lines
Quoted 3 lines
Are there any platforms that work with the default match table?
Yes, some boards can work with the default match table. But most won't.
Quoted 24 lines
I'd be
fine with adding some strings to the default if that helps.{ .type = "soc", },
device_typeis deprecated for FDT, so this shouldn't be needed except for really old stuff.{ .compatible = "soc", },
Doesn't appear in kernel dts files. Could be out of tree or old ones?
{ .compatible = "simple-bus" },
Already handled.
{ .compatible = "gianfar" },
Seems like the children of this should be probed by the gianfar driver.
{ .compatible = "gpio-leds", },
I don't think this is needed.
Quoted 7 lines
{ .type = "qe", },
Again, deprecated.
{ .compatible = "fsl,qe", },
No issue to add this. Though, you could also probe it from
mpc85xx_qe_init().Do you mean we put all the probe of the specific bus into the corresponding drivers? Yes, if we do so, we probably can shrink the default match table to be something like this:
{ .compatible = "soc", }, { .compatible = "simple-bus" },OK, now we have three options to fix this issue:
a) Create a separate link section to contain all the buses needed to be probed. Just as what this patch does.b) Put the match table into the machine descriptor.
c) Sprinkle the probe of all the specific bus into the corresponding driver (such as gian, pcie controller) and the default probe function only handle the very common buses.
So what option do you guys think is best?
Thanks,
Kevin