linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] maple: improve CPC9x5 host bridge detection
@ 2007-01-03 18:56 Nathan Lynch
  2007-01-03 20:50 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 5+ messages in thread
From: Nathan Lynch @ 2007-01-03 18:56 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Olof Johansson, Paul Mackerras

Identify CPC9x5 PCI Express, AGP, and HT host bridges using
device_type and compatible properties, which is a more flexible method
than using the name property (which can differ between firmwares and
models).

Signed-off-by: Nathan Lynch <ntl@pobox.com>

---
 arch/powerpc/platforms/maple/pci.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/platforms/maple/pci.c b/arch/powerpc/platforms/maple/pci.c
index 3f6a69f..011f0f1 100644
--- a/arch/powerpc/platforms/maple/pci.c
+++ b/arch/powerpc/platforms/maple/pci.c
@@ -560,13 +560,16 @@ void __init maple_pci_init(void)
 		return;
 	}
 	for (np = NULL; (np = of_get_next_child(root, np)) != NULL;) {
-		if (np->name == NULL)
+		if (!np->type)
 			continue;
-		if (!strcmp(np->name, "pci") || !strcmp(np->name, "pcie")) {
-			if (add_bridge(np) == 0)
-				of_node_get(np);
-		}
-		if (strcmp(np->name, "ht") == 0) {
+		if (strcmp(np->type, "pci") && strcmp(np->type, "ht"))
+			continue;
+		if ((device_is_compatible(np, "u4-pcie") ||
+		     device_is_compatible(np, "u3-agp")) &&
+		    add_bridge(np) == 0)
+			of_node_get(np);
+
+		if (device_is_compatible(np, "u3-ht")) {
 			of_node_get(np);
 			ht = np;
 		}
-- 
1.4.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-01-14  1:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-03 18:56 [PATCH] maple: improve CPC9x5 host bridge detection Nathan Lynch
2007-01-03 20:50 ` Benjamin Herrenschmidt
2007-01-03 21:02   ` Segher Boessenkool
2007-01-03 21:11   ` Nathan Lynch
2007-01-14  0:49     ` Adrian Reber

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).