[PATCH] ppc64: make fixup_winbond_82c105 pseries specific

Anton Blanchard anton at samba.org
Sun Nov 14 17:22:02 EST 2004


 
The winbond irq fixup is pSeries specific. Move it into pSeries_pci.c
and check for PLATFORM_PSERIES.

Signed-off-by: Anton Blanchard <anton at samba.org>

diff -puN arch/ppc64/kernel/pSeries_pci.c~pci2b arch/ppc64/kernel/pSeries_pci.c
--- gr_base/arch/ppc64/kernel/pSeries_pci.c~pci2b	2004-11-12 04:50:35.605714058 -0600
+++ gr_base-anton/arch/ppc64/kernel/pSeries_pci.c	2004-11-12 04:50:35.621711448 -0600
@@ -542,3 +542,30 @@ void __init pSeries_final_fixup(void)
 	pci_addr_cache_build();
 }
 
+/* 
+ * Assume the winbond 82c105 is the IDE controller on a
+ * p610.  We should probably be more careful in case
+ * someone tries to plug in a similar adapter.
+ */
+static void fixup_winbond_82c105(struct pci_dev* dev)
+{
+	int i;
+	unsigned int reg;
+
+	if (!(systemcfg->platform & PLATFORM_PSERIES))
+		return;
+
+	printk("Using INTC for W82c105 IDE controller.\n");
+	pci_read_config_dword(dev, 0x40, &reg);
+	/* Enable LEGIRQ to use INTC instead of ISA interrupts */
+	pci_write_config_dword(dev, 0x40, reg | (1<<11));
+
+	for (i = 0; i < DEVICE_COUNT_RESOURCE; ++i) {
+		/* zap the 2nd function of the winbond chip */
+		if (dev->resource[i].flags & IORESOURCE_IO
+		    && dev->bus->number == 0 && dev->devfn == 0x81)
+			dev->resource[i].flags &= ~IORESOURCE_IO;
+	}
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105,
+			 fixup_winbond_82c105);
diff -puN arch/ppc64/kernel/pci.c~pci2b arch/ppc64/kernel/pci.c
--- gr_base/arch/ppc64/kernel/pci.c~pci2b	2004-11-12 04:50:35.610713243 -0600
+++ gr_base-anton/arch/ppc64/kernel/pci.c	2004-11-12 04:50:35.624710959 -0600
@@ -87,30 +87,6 @@ static void fixup_broken_pcnet32(struct 
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TRIDENT, PCI_ANY_ID, fixup_broken_pcnet32);
 
-static void fixup_windbond_82c105(struct pci_dev* dev)
-{
-	/* Assume the windbond 82c105 is the IDE controller on a
-	 * p610.  We should probably be more careful in case
-	 * someone tries to plug in a similar adapter.
-	 */
-	int i;
-	unsigned int reg;
-
-	printk("Using INTC for W82c105 IDE controller.\n");
-	pci_read_config_dword(dev, 0x40, &reg);
-	/* Enable LEGIRQ to use INTC instead of ISA interrupts */
-	pci_write_config_dword(dev, 0x40, reg | (1<<11));
-
-	for (i = 0; i < DEVICE_COUNT_RESOURCE; ++i) {
-		/* zap the 2nd function of the winbond chip */
-		if (dev->resource[i].flags & IORESOURCE_IO
-		    && dev->bus->number == 0 && dev->devfn == 0x81)
-			dev->resource[i].flags &= ~IORESOURCE_IO;
-	}
-}
-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105,
-			 fixup_windbond_82c105);
-
 void  pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
 			      struct resource *res)
 {
_



More information about the Linuxppc64-dev mailing list