From: Marian Balakowicz <m8@semihalf.com>
To: linuxppc-dev@ozlabs.org
Subject: [PATCH v3 03/13] [POWERPC] Add common mpc52xx_setup_pci() routine
Date: Tue, 06 Nov 2007 21:05:12 +0100 [thread overview]
Message-ID: <20071106200512.10913.78165.stgit@hekate.izotz.org> (raw)
In-Reply-To: <20071106200446.10913.29338.stgit@hekate.izotz.org>
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>
---
arch/powerpc/platforms/52xx/lite5200.c | 12 +-----------
arch/powerpc/platforms/52xx/mpc52xx_pci.c | 15 +++++++++++++++
include/asm-powerpc/mpc52xx.h | 5 +++++
3 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/arch/powerpc/platforms/52xx/lite5200.c b/arch/powerpc/platforms/52xx/lite5200.c
index 25d2bfa..ce903be 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)
static void __init lite5200_setup_arch(void)
{
-#ifdef CONFIG_PCI
- struct device_node *np;
-#endif
-
if (ppc_md.progress)
ppc_md.progress("lite5200_setup_arch()", 0);
@@ -154,13 +150,7 @@ static void __init lite5200_setup_arch(void)
lite5200_pm_init();
#endif
-#ifdef CONFIG_PCI
- np = of_find_node_by_type(NULL, "pci");
- if (np) {
- mpc52xx_add_bridge(np);
- of_node_put(np);
- }
-#endif
+ mpc52xx_setup_pci();
}
/*
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pci.c b/arch/powerpc/platforms/52xx/mpc52xx_pci.c
index 4c6c82a..89304f2 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pci.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pci.c
@@ -406,3 +406,18 @@ mpc52xx_add_bridge(struct device_node *node)
return 0;
}
+
+void __init mpc52xx_setup_pci(void)
+{
+ struct device_node *pci;
+
+ pci = of_find_node_by_type(NULL, "pci");
+ if (!pci)
+ return;
+
+ if (of_device_is_compatible(pci, "fsl,mpc5200-pci") ||
+ of_device_is_compatible(pci, "mpc5200-pci"))
+ mpc52xx_add_bridge(pci);
+
+ of_node_put(pci);
+}
diff --git a/include/asm-powerpc/mpc52xx.h b/include/asm-powerpc/mpc52xx.h
index fcb2ebb..d7efbe0 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);
extern void mpc52xx_init_irq(void);
extern unsigned int mpc52xx_get_irq(void);
+#ifdef CONFIG_PCI
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 mpc52xx_restart(char *cmd);
next prev parent reply other threads:[~2007-11-06 20:05 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-06 20:04 [PATCH v3 00/13] [POWERPC] Add TQM5200/CM5200/Motion-PRO board support Marian Balakowicz
2007-11-06 20:04 ` [PATCH v3 01/13] [POWERPC] Add 'model: ...' line to common show_cpuinfo() Marian Balakowicz
2007-11-06 20:05 ` [PATCH v3 02/13] [POWERPC] Add 'fsl, lpb' bus type for MPC5200 LocalPlus Bus Marian Balakowicz
2007-11-06 20:05 ` Marian Balakowicz [this message]
2007-11-06 20:05 ` [PATCH v3 04/13] [POWERPC] Add generic support for simple MPC5200 based boards Marian Balakowicz
2007-11-06 21:04 ` Grant Likely
2007-11-06 22:22 ` Wolfgang Denk
2007-11-06 23:25 ` Grant Likely
2007-11-09 14:43 ` Marian Balakowicz
2007-11-09 14:52 ` Grant Likely
2007-11-07 2:34 ` Stephen Rothwell
2007-11-09 14:11 ` Marian Balakowicz
2007-11-06 20:05 ` [PATCH v3 05/13] [POWERPC] Export mpc52xx_map_node() routine symbol Marian Balakowicz
2007-11-06 20:05 ` [PATCH v3 06/13] [POWERPC] Use EXPORT_SYMBOL_GPL for 52xx common routines symbol export Marian Balakowicz
2007-11-06 20:05 ` [PATCH v3 07/13] [POWERPC] TQM5200 DTS Marian Balakowicz
2007-11-06 22:36 ` David Gibson
2007-11-09 14:15 ` Marian Balakowicz
2007-11-06 20:05 ` [PATCH v3 08/13] [POWERPC] TQM5200 defconfig Marian Balakowicz
2007-11-06 20:06 ` [PATCH v3 09/13] [POWERPC] CM5200 DTS Marian Balakowicz
2007-11-06 20:06 ` [PATCH v3 10/13] [POWERPC] CM5200 defconfig Marian Balakowicz
2007-11-06 20:06 ` [PATCH v3 11/13] [POWERPC] Motion-PRO: Add LED support Marian Balakowicz
2007-11-06 20:06 ` [PATCH v3 12/13] [POWERPC] Promess Motion-PRO DTS Marian Balakowicz
2007-11-06 22:42 ` David Gibson
2007-11-09 14:22 ` Marian Balakowicz
2007-11-09 17:49 ` Grant Likely
2007-11-06 20:06 ` [PATCH v3 13/13] [POWERPC] Promess Motion-PRO defconfig Marian Balakowicz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071106200512.10913.78165.stgit@hekate.izotz.org \
--to=m8@semihalf.com \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).