aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarian Balakowicz <m8@semihalf.com>2007-11-09 12:11:56 -0500
committerGrant Likely <grant.likely@secretlab.ca>2008-01-18 11:30:07 -0500
commitf584bc65ca9b9a4c21cc17bb01883874e2e6df0a (patch)
treee90c2c73b127d2cf2e187a269a80daa0ca9b710d
parenta6f024bbbef1f529cd6bee57f3ff576139e6f8d7 (diff)
[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: Marian Balakowicz <m8@semihalf.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
-rw-r--r--arch/powerpc/platforms/52xx/lite5200.c12
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_pci.c14
-rw-r--r--include/asm-powerpc/mpc52xx.h5
3 files changed, 20 insertions, 11 deletions
diff --git a/arch/powerpc/platforms/52xx/lite5200.c b/arch/powerpc/platforms/52xx/lite5200.c
index 25d2bfa3d9dc..ce903bef004e 100644
--- a/arch/powerpc/platforms/52xx/lite5200.c
+++ b/arch/powerpc/platforms/52xx/lite5200.c
@@ -131,10 +131,6 @@ static void lite5200_resume_finish(void __iomem *mbar)
131 131
132static void __init lite5200_setup_arch(void) 132static void __init lite5200_setup_arch(void)
133{ 133{
134#ifdef CONFIG_PCI
135 struct device_node *np;
136#endif
137
138 if (ppc_md.progress) 134 if (ppc_md.progress)
139 ppc_md.progress("lite5200_setup_arch()", 0); 135 ppc_md.progress("lite5200_setup_arch()", 0);
140 136
@@ -154,13 +150,7 @@ static void __init lite5200_setup_arch(void)
154 lite5200_pm_init(); 150 lite5200_pm_init();
155#endif 151#endif
156 152
157#ifdef CONFIG_PCI 153 mpc52xx_setup_pci();
158 np = of_find_node_by_type(NULL, "pci");
159 if (np) {
160 mpc52xx_add_bridge(np);
161 of_node_put(np);
162 }
163#endif
164} 154}
165 155
166/* 156/*
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pci.c b/arch/powerpc/platforms/52xx/mpc52xx_pci.c
index 262eda8659d0..4b79398b2e40 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pci.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pci.c
@@ -406,3 +406,17 @@ mpc52xx_add_bridge(struct device_node *node)
406 406
407 return 0; 407 return 0;
408} 408}
409
410void __init mpc52xx_setup_pci(void)
411{
412 struct device_node *pci;
413
414 pci = of_find_compatible_node(NULL, NULL, "fsl,mpc5200-pci");
415 if (!pci)
416 pci = of_find_compatible_node(NULL, NULL, "mpc5200-pci");
417 if (!pci)
418 return;
419
420 mpc52xx_add_bridge(pci);
421 of_node_put(pci);
422}
diff --git a/include/asm-powerpc/mpc52xx.h b/include/asm-powerpc/mpc52xx.h
index fcb2ebbfddbc..d7efbe09f93b 100644
--- a/include/asm-powerpc/mpc52xx.h
+++ b/include/asm-powerpc/mpc52xx.h
@@ -257,7 +257,12 @@ extern void mpc52xx_declare_of_platform_devices(void);
257extern void mpc52xx_init_irq(void); 257extern void mpc52xx_init_irq(void);
258extern unsigned int mpc52xx_get_irq(void); 258extern unsigned int mpc52xx_get_irq(void);
259 259
260#ifdef CONFIG_PCI
260extern int __init mpc52xx_add_bridge(struct device_node *node); 261extern int __init mpc52xx_add_bridge(struct device_node *node);
262extern void __init mpc52xx_setup_pci(void);
263#else
264static inline void mpc52xx_setup_pci(void) { }
265#endif
261 266
262extern void __init mpc52xx_map_wdt(void); 267extern void __init mpc52xx_map_wdt(void);
263extern void mpc52xx_restart(char *cmd); 268extern void mpc52xx_restart(char *cmd);