Skip to content

Commit

Permalink
[POWERPC] maple: improve CPC9x5 host bridge detection
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Nathan Lynch authored and Paul Mackerras committed Jan 24, 2007
1 parent 9a3d645 commit f1f0033
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions arch/powerpc/platforms/maple/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit f1f0033

Please sign in to comment.