maple: improve CPC9x5 host bridge detection
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
@@ -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
Quoted 6 lines · Nathan Lynch
Identify CPC9x5 PCI Express, AGP, and HT host bridges using
device_typeand 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 <[email protected]>
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@@ -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; }
Quoted 8 lines
Quoted 6 lines
Identify CPC9x5 PCI Express, AGP, and HT host bridges using
device_typeand 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 <[email protected]>Do that work on js20/js21 with SLOF ?
It should, you might want to check recent versions though.
Segher
Quoted 9 lines · Benjamin Herrenschmidt
Quoted 6 lines · Nathan Lynch
Identify CPC9x5 PCI Express, AGP, and HT host bridges using
device_typeand 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 <[email protected]>Do that work on js20/js21 with SLOF ?
Not sure, I'll see whether I can test one of those.
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_typeand 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
Signed-off-by Nathan Lynch <[email protected]>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