[PATCH] maple: improve CPC9x5 host bridge detection

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE7143d

5 messages, 4 authors, 2007-01-14 · open the first message on its own page

[PATCH] maple: improve CPC9x5 host bridge detection

From: Nathan Lynch <hidden>
Date: 2007-01-03 18:56:38

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 <redacted>

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

Re: [PATCH] maple: improve CPC9x5 host bridge detection

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2007-01-03 20:50:57

On Wed, 2007-01-03 at 12:56 -0600, Nathan Lynch wrote:
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 <redacted>
Do that work on js20/js21 with SLOF ?

Ben.
quoted hunk
---
 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;
 		}

Re: [PATCH] maple: improve CPC9x5 host bridge detection

From: Segher Boessenkool <hidden>
Date: 2007-01-03 21:02:28

quoted
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 <redacted>
Do that work on js20/js21 with SLOF ?
It should, you might want to check recent versions though.


Segher

Re: [PATCH] maple: improve CPC9x5 host bridge detection

From: Nathan Lynch <hidden>
Date: 2007-01-03 21:11:24

Benjamin Herrenschmidt wrote:
On Wed, 2007-01-03 at 12:56 -0600, Nathan Lynch wrote:
quoted
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 <redacted>
Do that work on js20/js21 with SLOF ?
Not sure, I'll see whether I can test one of those.

Re: [PATCH] maple: improve CPC9x5 host bridge detection

From: Adrian Reber <hidden>
Date: 2007-01-14 01:13:46

On Wed, Jan 03, 2007 at 03:11:17PM -0600, Nathan Lynch wrote:
Benjamin Herrenschmidt wrote:
quoted
On Wed, 2007-01-03@12:56 -0600, Nathan Lynch wrote:
quoted
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 <redacted>
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help