提交 f584bc65 编写于 作者: M Marian Balakowicz 提交者: Grant Likely

[POWERPC] mpc5200: Add common mpc52xx_setup_pci() routine

This patch moves a generic pci init code from lite5200
platform file to a common mpc52xx_setup_pci() routine
and adds additional compatibility property verification.
Signed-off-by: NMarian Balakowicz <m8@semihalf.com>
Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
上级 a6f024bb
...@@ -131,10 +131,6 @@ static void lite5200_resume_finish(void __iomem *mbar) ...@@ -131,10 +131,6 @@ static void lite5200_resume_finish(void __iomem *mbar)
static void __init lite5200_setup_arch(void) static void __init lite5200_setup_arch(void)
{ {
#ifdef CONFIG_PCI
struct device_node *np;
#endif
if (ppc_md.progress) if (ppc_md.progress)
ppc_md.progress("lite5200_setup_arch()", 0); ppc_md.progress("lite5200_setup_arch()", 0);
...@@ -154,13 +150,7 @@ static void __init lite5200_setup_arch(void) ...@@ -154,13 +150,7 @@ static void __init lite5200_setup_arch(void)
lite5200_pm_init(); lite5200_pm_init();
#endif #endif
#ifdef CONFIG_PCI mpc52xx_setup_pci();
np = of_find_node_by_type(NULL, "pci");
if (np) {
mpc52xx_add_bridge(np);
of_node_put(np);
}
#endif
} }
/* /*
......
...@@ -406,3 +406,17 @@ mpc52xx_add_bridge(struct device_node *node) ...@@ -406,3 +406,17 @@ mpc52xx_add_bridge(struct device_node *node)
return 0; return 0;
} }
void __init mpc52xx_setup_pci(void)
{
struct device_node *pci;
pci = of_find_compatible_node(NULL, NULL, "fsl,mpc5200-pci");
if (!pci)
pci = of_find_compatible_node(NULL, NULL, "mpc5200-pci");
if (!pci)
return;
mpc52xx_add_bridge(pci);
of_node_put(pci);
}
...@@ -257,7 +257,12 @@ extern void mpc52xx_declare_of_platform_devices(void); ...@@ -257,7 +257,12 @@ extern void mpc52xx_declare_of_platform_devices(void);
extern void mpc52xx_init_irq(void); extern void mpc52xx_init_irq(void);
extern unsigned int mpc52xx_get_irq(void); extern unsigned int mpc52xx_get_irq(void);
#ifdef CONFIG_PCI
extern int __init mpc52xx_add_bridge(struct device_node *node); extern int __init mpc52xx_add_bridge(struct device_node *node);
extern void __init mpc52xx_setup_pci(void);
#else
static inline void mpc52xx_setup_pci(void) { }
#endif
extern void __init mpc52xx_map_wdt(void); extern void __init mpc52xx_map_wdt(void);
extern void mpc52xx_restart(char *cmd); extern void mpc52xx_restart(char *cmd);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册