[PATCH] Fixup for DEC 21154 bridge to allow CardBus support

Pavel Roskin proski at gnu.org
Tue May 25 01:53:29 EST 2004


Hello!

The improved patch is attached.  The bridge is configured to handle buses
from 1 to 255.  Since both the PCI ID and the machine type are checked and
255 is the maximal value, it should be safe not to read the original value
of the upper limit.  The quirk has been renamed to
pmac_pci_fixup_bus_range(), which describes better what is does.

--
Regards,
Pavel Roskin
-------------- next part --------------
--- linux.orig/arch/ppc/kernel/pci.c
+++ linux/arch/ppc/kernel/pci.c
@@ -49,6 +49,7 @@ static void fixup_cpc710_pci64(struct pc
 extern void pmac_pci_fixup_cardbus(struct pci_dev* dev);
 extern void pmac_pci_fixup_pciata(struct pci_dev* dev);
 extern void pmac_pci_fixup_k2_sata(struct pci_dev* dev);
+extern void pmac_pci_fixup_bus_range(struct pci_dev* dev);
 #endif
 #ifdef CONFIG_PPC_OF
 static u8* pci_to_OF_bus_map;
@@ -72,6 +73,7 @@ struct pci_fixup pcibios_fixups[] = {
 #ifdef CONFIG_PPC_PMAC
 	/* We should add per-machine fixup support in xxx_setup.c or xxx_pci.c */
 	{ PCI_FIXUP_FINAL,	PCI_VENDOR_ID_TI,	PCI_ANY_ID,			pmac_pci_fixup_cardbus },
+	{ PCI_FIXUP_FINAL,	PCI_VENDOR_ID_DEC,	PCI_DEVICE_ID_DEC_21154,	pmac_pci_fixup_bus_range },
 	{ PCI_FIXUP_FINAL,	PCI_ANY_ID,		PCI_ANY_ID,			pmac_pci_fixup_pciata },
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_SERVERWORKS, 0x0240,			pmac_pci_fixup_k2_sata },
 #endif /* CONFIG_PPC_PMAC */
--- linux.orig/arch/ppc/platforms/pmac_pci.c
+++ linux/arch/ppc/platforms/pmac_pci.c
@@ -1034,6 +1034,17 @@ void pmac_pci_fixup_cardbus(struct pci_d
 	}
 }
 
+/* By default the PCI bridge on Blue&White G3 only handles bus 1.   This
+ * fixup allows access to higher buses in case if PCI or Cardbus bridge
+ * is added to the system.  */
+void pmac_pci_fixup_bus_range(struct pci_dev* dev)
+{
+	if (!machine_is_compatible("PowerMac1,1"))
+		return;
+
+	pci_write_config_byte(dev, PCI_SUBORDINATE_BUS, 255);
+}
+
 void pmac_pci_fixup_pciata(struct pci_dev* dev)
 {
        u8 progif = 0;


More information about the Linuxppc-dev mailing list