]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] Fix PCI<->OF matching on G5 AGP bus
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 9 Mar 2004 10:55:34 +0000 (02:55 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 9 Mar 2004 10:55:34 +0000 (02:55 -0800)
Strangely, I though I fixed that a long time ago, but it was still
broken in the current tree...

Drivers like radeonfb fail to find the OF device matching a given PCI
device on the G5 AGP bus because of some bus renumbering tricks.  This
patch fixes the problem by fixing the bus numbers in the OF node.  This
corrects radeonfb and other drivers looking for EDID / PLL datas in the
OF node.

arch/ppc64/kernel/pmac_pci.c

index 7d113cabaf658f28c29272e710e0bd43fa2aa87f..6220ad0ddc80dbb2326ce3cf1e7bf15c468ca704 100644 (file)
@@ -719,6 +719,17 @@ void __init pmac_pci_init(void)
        /* Setup the linkage between OF nodes and PHBs */ 
        pci_devs_phb_init();
 
+       /* Fixup the PCI<->OF mapping for U3 AGP due to bus renumbering. We
+        * assume there is no P2P bridge on the AGP bus, which should be a
+        * safe assumptions hopefully.
+        */
+       if (u3_agp) {
+               struct device_node *np = u3_agp->arch_data;
+               np->busno = 0xf0;
+               for (np = np->child; np; np = np->sibling)
+                       np->busno = 0xf0;
+       }
+
        pmac_check_ht_link();
 
        /* Tell pci.c to use the common resource allocation mecanism */