Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bede480d authored by Dmitry Eremin-Solenikov's avatar Dmitry Eremin-Solenikov Committed by Kumar Gala
Browse files

powerpc/83xx: merge PCI bridge additions



Nearly all mpc83xx-based boards have a common piece of code - one that
loops over all pci/pcie bridges and registers them. Merge that code into
a special function common to all boards.

Signed-off-by: default avatarDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
parent 7669d58c
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -51,15 +51,14 @@
 */
static void __init mpc83xx_km_setup_arch(void)
{
#ifdef CONFIG_QUICC_ENGINE
	struct device_node *np;
#endif

	if (ppc_md.progress)
		ppc_md.progress("kmpbec83xx_setup_arch()", 0);

#ifdef CONFIG_PCI
	for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
		mpc83xx_add_bridge(np);
#endif
	mpc83xx_setup_pci();

#ifdef CONFIG_QUICC_ENGINE
	qe_reset();
+14 −0
Original line number Diff line number Diff line
@@ -12,12 +12,14 @@
#include <linux/stddef.h>
#include <linux/kernel.h>
#include <linux/of_platform.h>
#include <linux/pci.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 <sysdev/fsl_pci.h>

#include "mpc83xx.h"

@@ -128,3 +130,15 @@ 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)
{
	struct device_node *np;

	for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
		mpc83xx_add_bridge(np);
	for_each_compatible_node(np, "pci", "fsl,mpc8314-pcie")
		mpc83xx_add_bridge(np);
}
#endif
+1 −10
Original line number Diff line number Diff line
@@ -28,19 +28,10 @@
 */
static void __init mpc831x_rdb_setup_arch(void)
{
#ifdef CONFIG_PCI
	struct device_node *np;
#endif

	if (ppc_md.progress)
		ppc_md.progress("mpc831x_rdb_setup_arch()", 0);

#ifdef CONFIG_PCI
	for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
		mpc83xx_add_bridge(np);
	for_each_compatible_node(np, "pci", "fsl,mpc8314-pcie")
		mpc83xx_add_bridge(np);
#endif
	mpc83xx_setup_pci();
	mpc831x_usb_cfg();
}

+1 −4
Original line number Diff line number Diff line
@@ -72,10 +72,7 @@ static void __init mpc832x_sys_setup_arch(void)
		of_node_put(np);
	}

#ifdef CONFIG_PCI
	for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
		mpc83xx_add_bridge(np);
#endif
	mpc83xx_setup_pci();

#ifdef CONFIG_QUICC_ENGINE
	qe_reset();
+2 −5
Original line number Diff line number Diff line
@@ -193,17 +193,14 @@ machine_device_initcall(mpc832x_rdb, mpc832x_spi_init);
 */
static void __init mpc832x_rdb_setup_arch(void)
{
#if defined(CONFIG_PCI) || defined(CONFIG_QUICC_ENGINE)
#if defined(CONFIG_QUICC_ENGINE)
	struct device_node *np;
#endif

	if (ppc_md.progress)
		ppc_md.progress("mpc832x_rdb_setup_arch()", 0);

#ifdef CONFIG_PCI
	for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
		mpc83xx_add_bridge(np);
#endif
	mpc83xx_setup_pci();

#ifdef CONFIG_QUICC_ENGINE
	qe_reset();
Loading