Commit 396e37d1 authored by David Woodhouse's avatar David Woodhouse Committed by Greg Kroah-Hartman

[2/3] PCI quirks -- PPC.

Remove up the PPC pcibios_fixups[] array. Remove the ifdefs on
CONFIG_PPC_PMAC in the kernel PPC code, moving that stuff into
pmac-specific files where it lives. Add a quirk for the CardBus
controller on WindRiver SBC8260.
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 61cbb82a
......@@ -45,11 +45,6 @@ static void fixup_broken_pcnet32(struct pci_dev* dev);
static int reparent_resources(struct resource *parent, struct resource *res);
static void fixup_rev1_53c810(struct pci_dev* dev);
static void fixup_cpc710_pci64(struct pci_dev* dev);
#ifdef CONFIG_PPC_PMAC
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);
#endif
#ifdef CONFIG_PPC_OF
static u8* pci_to_OF_bus_map;
#endif
......@@ -64,20 +59,6 @@ struct pci_controller** hose_tail = &hose_head;
static int pci_bus_count;
struct pci_fixup pcibios_fixups[] = {
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_TRIDENT, PCI_ANY_ID, fixup_broken_pcnet32 },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C810, fixup_rev1_53c810 },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CPC710_PCI64, fixup_cpc710_pci64},
{ PCI_FIXUP_HEADER, PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_resources },
#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_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 */
{ 0 }
};
static void
fixup_rev1_53c810(struct pci_dev* dev)
{
......@@ -90,6 +71,7 @@ fixup_rev1_53c810(struct pci_dev* dev)
dev->class = PCI_CLASS_STORAGE_SCSI;
}
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C810, fixup_rev1_53c810);
static void
fixup_broken_pcnet32(struct pci_dev* dev)
......@@ -100,6 +82,7 @@ fixup_broken_pcnet32(struct pci_dev* dev)
pci_name_device(dev);
}
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TRIDENT, PCI_ANY_ID, fixup_broken_pcnet32);
static void
fixup_cpc710_pci64(struct pci_dev* dev)
......@@ -112,6 +95,7 @@ fixup_cpc710_pci64(struct pci_dev* dev)
dev->resource[1].start = dev->resource[1].end = 0;
dev->resource[1].flags = 0;
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CPC710_PCI64, fixup_cpc710_pci64);
static void
pcibios_fixup_resources(struct pci_dev *dev)
......@@ -158,6 +142,7 @@ pcibios_fixup_resources(struct pci_dev *dev)
if (ppc_md.pcibios_fixup_resources)
ppc_md.pcibios_fixup_resources(dev);
}
DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_resources);
void
pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
......
......@@ -1034,6 +1034,8 @@ void pmac_pci_fixup_cardbus(struct pci_dev* dev)
}
}
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_TI, PCI_ANY_ID, pmac_pci_fixup_cardbus);
void pmac_pci_fixup_pciata(struct pci_dev* dev)
{
u8 progif = 0;
......@@ -1074,6 +1076,8 @@ void pmac_pci_fixup_pciata(struct pci_dev* dev)
printk(KERN_ERR "Rewrite of PROGIF failed !\n");
}
}
DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, pmac_pci_fixup_pciata);
/*
* Disable second function on K2-SATA, it's broken
......@@ -1104,3 +1108,4 @@ void __pmac pmac_pci_fixup_k2_sata(struct pci_dev* dev)
}
}
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SERVERWORKS, 0x0240, pmac_pci_fixup_k2_sata);
......@@ -20,6 +20,7 @@
#include <linux/stddef.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/pci.h>
#include <asm/mpc8260.h>
#include <asm/machdep.h>
......@@ -237,6 +238,25 @@ static int sbc82xx_pci_map_irq(struct pci_dev *dev, unsigned char idsel,
}
static void __devinit quirk_sbc8260_cardbus(struct pci_dev *pdev)
{
uint32_t ctrl;
if (pdev->bus->number != 0 || pdev->devfn != PCI_DEVFN(17, 0))
return;
printk(KERN_INFO "Setting up CardBus controller\n");
/* Set P2CCLK bit in System Control Register */
pci_read_config_dword(pdev, 0x80, &ctrl);
ctrl |= (1<<27);
pci_write_config_dword(pdev, 0x80, ctrl);
/* Set MFUNC up for PCI IRQ routing via INTA and INTB, and LEDs. */
pci_write_config_dword(pdev, 0x8c, 0x00c01d22);
}
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1420, quirk_sbc8260_cardbus);
void __init
platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment