]> git.neil.brown.name Git - history.git/commitdiff
On G5 machines, we remap the AGP port to bus number 0xf0. XFree
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 6 Feb 2004 02:35:14 +0000 (13:35 +1100)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 6 Feb 2004 02:35:14 +0000 (13:35 +1100)
contains a hack that is unfixable at the moment for getting the
IO base which is hard coded to bus number 0 (AGP on earlier machines).
We work around this by passing the IO base of bus 0xf0 when asked
for bus 0 in pciconfig_iobase on those machines. Bus 0 is the HT
root and has no IOs, so that is safe.

arch/ppc/kernel/pci.c

index baf88840cfba85f41e6b3d29b8befb14013fd822..6ded5edaab9f8db6429cc98b351c42480ec736d9 100644 (file)
@@ -1645,12 +1645,23 @@ pci_bus_to_phys(unsigned int ba, int busnr)
  * Note that the returned IO or memory base is a physical address
  */
 
-long
-sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn)
+long sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn)
 {
-       struct pci_controller* hose = pci_bus_to_hose(bus);
+       struct pci_controller* hose;
        long result = -EOPNOTSUPP;
 
+       /* Argh ! Please forgive me for that hack, but that's the
+        * simplest way to get existing XFree to not lockup on some
+        * G5 machines... So when something asks for bus 0 io base
+        * (bus 0 is HT root), we return the AGP one instead.
+        */
+#ifdef CONFIG_PPC_PMAC
+       if (_machine == _MACH_Pmac && machine_is_compatible("MacRISC4"))
+               if (bus == 0)
+                       bus = 0xf0;
+#endif /* CONFIG_PPC_PMAC */
+
+       hose = pci_bus_to_hose(bus);
        if (!hose)
                return -ENODEV;