12 #include <linux/types.h>
13 #include <linux/kernel.h>
14 #include <linux/sched.h>
15 #include <linux/pci.h>
20 #include <asm/segment.h>
41 static struct resource pci_ioport_resource = {
48 static struct resource pci_iomem_resource = {
59 #define CONFIG_CMD(bus, dev, where) \
60 (0x80000000 | (bus->number << 16) | (devfn << 8) | (where & ~3))
62 #define __set_PciCfgAddr(A) writel((A), (volatile void __iomem *) __region_CS1 + 0x80)
64 #define __get_PciCfgDataB(A) readb((volatile void __iomem *) __region_CS1 + 0x88 + ((A) & 3))
65 #define __get_PciCfgDataW(A) readw((volatile void __iomem *) __region_CS1 + 0x88 + ((A) & 2))
66 #define __get_PciCfgDataL(A) readl((volatile void __iomem *) __region_CS1 + 0x88)
68 #define __set_PciCfgDataB(A,V) \
69 writeb((V), (volatile void __iomem *) __region_CS1 + 0x88 + (3 - ((A) & 3)))
71 #define __set_PciCfgDataW(A,V) \
72 writew((V), (volatile void __iomem *) __region_CS1 + 0x88 + (2 - ((A) & 2)))
74 #define __set_PciCfgDataL(A,V) \
75 writel((V), (volatile void __iomem *) __region_CS1 + 0x88)
77 #define __get_PciBridgeDataB(A) readb((volatile void __iomem *) __region_CS1 + 0x800 + (A))
78 #define __get_PciBridgeDataW(A) readw((volatile void __iomem *) __region_CS1 + 0x800 + (A))
79 #define __get_PciBridgeDataL(A) readl((volatile void __iomem *) __region_CS1 + 0x800 + (A))
81 #define __set_PciBridgeDataB(A,V) writeb((V), (volatile void __iomem *) __region_CS1 + 0x800 + (A))
82 #define __set_PciBridgeDataW(A,V) writew((V), (volatile void __iomem *) __region_CS1 + 0x800 + (A))
83 #define __set_PciBridgeDataL(A,V) writel((V), (volatile void __iomem *) __region_CS1 + 0x800 + (A))
85 static inline int __query(
const struct pci_dev *
dev)
98 static int pci_frv_read_config(
struct pci_bus *
bus,
unsigned int devfn,
int where,
int size,
113 _value = _value >> ((where & 3) * 8);
117 _value = _value >> ((where & 2) * 8);
131 static int pci_frv_write_config(
struct pci_bus *bus,
unsigned int devfn,
int where,
int size,
172 static struct pci_ops pci_direct_frv = {
174 pci_frv_write_config,
195 printk(
"PCI: VDK Bridge device:vendor: %08x\n",
id);
196 if (
id == 0x200e10cf)
200 printk(
"PCI: VDK Bridge: Sanity check failed\n");
211 if (pci_sanity_check(&pci_direct_frv)) {
213 printk(
"PCI: Using configuration frv\n");
216 return &pci_direct_frv;
227 static void __init pcibios_fixup_peer_bridges(
void)
234 if (pcibios_last_bus <= 0 || pcibios_last_bus >= 0xff)
236 printk(
"PCI: Peer bridge fixup\n");
243 for(
dev.devfn=0;
dev.devfn<256;
dev.devfn += 8)
245 l != 0x0000 && l != 0xffff) {
246 printk(
"Found device at %02x:%02x [%04x]\n", n,
dev.devfn, l);
247 printk(
"PCI: Discovered peer bus %02x\n", n);
266 printk(
"PCI: Fixing base address flags for device %s\n", pci_name(d));
280 printk(
"PCI: IDE base address fixup for %s\n", pci_name(d));
283 if ((r->
start & ~0x80) == 0x374) {
298 printk(
"PCI: IDE base address trash cleared for %s\n", pci_name(d));
309 DBG(
"PCI: Setting max latency to 32\n");
335 if (dev->
devfn == 0) {
355 if (!mb93090_mb00_detected)
377 pci_ioport_resource.
end += pci_ioport_resource.
start;
379 printk(
"PCI IO window: %08llx-%08llx\n",
380 (
unsigned long long) pci_ioport_resource.
start,
381 (
unsigned long long) pci_ioport_resource.
end);
385 pci_iomem_resource.
end += pci_iomem_resource.
start;
392 pci_iomem_resource.
start += 0x400;
394 printk(
"PCI MEM window: %08llx-%08llx\n",
395 (
unsigned long long) pci_iomem_resource.
start,
396 (
unsigned long long) pci_iomem_resource.
end);
397 printk(
"PCI DMA memory: %08lx-%08lx\n",
401 panic(
"Unable to insert PCI IOMEM resource\n");
403 panic(
"Unable to insert PCI IOPORT resource\n");
408 dir = pci_check_direct();
412 printk(
"PCI: No PCI bus detected\n");
416 printk(
"PCI: Probing PCI hardware\n");
423 pcibios_fixup_peer_bridges();
434 if (!
strcmp(str,
"off")) {
437 }
else if (!
strncmp(str,
"lastbus=", 8)) {