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

* Re: [PATCH] maple: improve CPC9x5 host bridge detection
  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
  0 siblings, 2 replies; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2007-01-03 20:50 UTC (permalink / raw)
  To: Nathan Lynch; +Cc: Olof Johansson, linuxppc-dev, Paul Mackerras

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 <ntl@pobox.com>

Do that work on js20/js21 with SLOF ?

Ben.

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

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

* Re: [PATCH] maple: improve CPC9x5 host bridge detection
  2007-01-03 20:50 ` Benjamin Herrenschmidt
@ 2007-01-03 21:02   ` Segher Boessenkool
  2007-01-03 21:11   ` Nathan Lynch
  1 sibling, 0 replies; 5+ messages in thread
From: Segher Boessenkool @ 2007-01-03 21:02 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Olof Johansson, linuxppc-dev, Nathan Lynch, 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>
>
> Do that work on js20/js21 with SLOF ?

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


Segher

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

* Re: [PATCH] maple: improve CPC9x5 host bridge detection
  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
  1 sibling, 1 reply; 5+ messages in thread
From: Nathan Lynch @ 2007-01-03 21:11 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Olof Johansson, linuxppc-dev, Paul Mackerras

Benjamin Herrenschmidt wrote:
> 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 <ntl@pobox.com>
> 
> Do that work on js20/js21 with SLOF ?

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

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

* Re: [PATCH] maple: improve CPC9x5 host bridge detection
  2007-01-03 21:11   ` Nathan Lynch
@ 2007-01-14  0:49     ` Adrian Reber
  0 siblings, 0 replies; 5+ messages in thread
From: Adrian Reber @ 2007-01-14  0:49 UTC (permalink / raw)
  To: Nathan Lynch; +Cc: linuxppc-dev

On Wed, Jan 03, 2007 at 03:11:17PM -0600, Nathan Lynch wrote:
> Benjamin Herrenschmidt wrote:
> > On Wed, 2007-01-03@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 <ntl@pobox.com>
> > 
> > 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

^ permalink raw reply	[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).