diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-09-29 01:57:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-09-29 22:22:40 -0400 |
commit | 16fa42affd484bb500533a7e78e0c72687eddd58 (patch) | |
tree | 17e86844911a2628b0b48bf89975c611a3230e0e /arch/powerpc | |
parent | b0f84374b6ab0dc9c47975df0b02d46165d558d4 (diff) |
powerpc: Fix device-tree matching for Apple U4 bridge
Apple Quad G5 has some oddity in it's device-tree which causes the new
generic matching code to fail to relate nodes for PCI-E devices below U4
with their respective struct pci_dev. This breaks graphics on those
machines among others.
This fixes it using a quirk which copies the node pointer from the host
bridge for the root complex, which makes the generic code work for the
children afterward.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/platforms/powermac/pci.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c index 5cc83851ad06..31a7d3a7ce25 100644 --- a/arch/powerpc/platforms/powermac/pci.c +++ b/arch/powerpc/platforms/powermac/pci.c | |||
@@ -561,6 +561,20 @@ static struct pci_ops u4_pcie_pci_ops = | |||
561 | .write = u4_pcie_write_config, | 561 | .write = u4_pcie_write_config, |
562 | }; | 562 | }; |
563 | 563 | ||
564 | static void __devinit pmac_pci_fixup_u4_of_node(struct pci_dev *dev) | ||
565 | { | ||
566 | /* Apple's device-tree "hides" the root complex virtual P2P bridge | ||
567 | * on U4. However, Linux sees it, causing the PCI <-> OF matching | ||
568 | * code to fail to properly match devices below it. This works around | ||
569 | * it by setting the node of the bridge to point to the PHB node, | ||
570 | * which is not entirely correct but fixes the matching code and | ||
571 | * doesn't break anything else. It's also the simplest possible fix. | ||
572 | */ | ||
573 | if (dev->dev.of_node == NULL) | ||
574 | dev->dev.of_node = pcibios_get_phb_of_node(dev->bus); | ||
575 | } | ||
576 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_APPLE, 0x5b, pmac_pci_fixup_u4_of_node); | ||
577 | |||
564 | #endif /* CONFIG_PPC64 */ | 578 | #endif /* CONFIG_PPC64 */ |
565 | 579 | ||
566 | #ifdef CONFIG_PPC32 | 580 | #ifdef CONFIG_PPC32 |