Skip to contentSkip to conversation

maple: improve CPC9x5 host bridge detection

PATCH In review Nathan Lynch 4 participants 5 messages Jan 3, 2007 – Jan 14, 2007 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 maple: improve CPC9x5 host bridge detection

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

---
 arch/powerpc/platforms/maple/pci.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
arch/powerpc/platforms/maple/pci.c +9 -6
index 3f6a69f..011f0f1 100644
@@ -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;
 		}
Signature · 1 line
1.4.1
#1 lore raw
Quoted 6 lines · Nathan Lynch

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

Do that work on js20/js21 with SLOF ?

Ben.

Quoted 31 lines
---
 arch/powerpc/platforms/maple/pci.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
arch/powerpc/platforms/maple/pci.c +9 -6
index 3f6a69f..011f0f1 100644
@@ -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;
 		}
#2 lore raw
Quoted 8 lines
Quoted 6 lines

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

Do that work on js20/js21 with SLOF ?

It should, you might want to check recent versions though.

Segher

#3 lore raw
In reply to Benjamin Herrenschmidt
Quoted 9 lines · Benjamin Herrenschmidt
Quoted 6 lines · Nathan Lynch

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

Do that work on js20/js21 with SLOF ?

Not sure, I'll see whether I can test one of those.

#4 lore raw
Quoted 7 lines · Nathan Lynch
Quoted 6 lines · Benjamin Herrenschmidt
Quoted 5 lines · Nathan Lynch

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

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Do that work on js20/js21 with SLOF ?

Not sure, I'll see whether I can test one of those.

I have tested it on js20/js21 with SLOF and it works.

Adrian