23 #include <linux/kernel.h>
25 #include <linux/slab.h>
29 #include <asm/pci-bridge.h>
32 #define SPIDER_PCI_DISABLE_PREFETCH
38 static void spiderpci_io_flush(
struct iowa_bus *
bus)
48 #define SPIDER_PCI_MMIO_READ(name, ret) \
49 static ret spiderpci_##name(const PCI_IO_ADDR addr) \
51 ret val = __do_##name(addr); \
52 spiderpci_io_flush(iowa_mem_find_bus(addr)); \
56 #define SPIDER_PCI_MMIO_READ_STR(name) \
57 static void spiderpci_##name(const PCI_IO_ADDR addr, void *buf, \
58 unsigned long count) \
60 __do_##name(addr, buf, count); \
61 spiderpci_io_flush(iowa_mem_find_bus(addr)); \
75 static
void spiderpci_memcpy_fromio(
void *
dest,
const PCI_IO_ADDR
src,
78 __do_memcpy_fromio(dest, src, n);
88 #ifdef SPIDER_PCI_DISABLE_PREFETCH
90 pr_debug(
"SPIDER_IOWA:PVCI_Control_Status was 0x%08x\n", val);
107 if (!dummy_page_va) {
108 pr_err(
"SPIDERPCI-IOWA:Alloc dummy_page_va failed.\n");
115 pr_err(
"SPIDER-IOWA:Map dummy page filed.\n");
116 kfree(dummy_page_va);
133 pr_debug(
"SPIDERPCI-IOWA:Bus initialize for spider(%s)\n",
139 "Can't allocate struct spiderpci_iowa_private");
144 pr_err(
"SPIDERPCI-IOWA:Can't get resource.\n");
150 pr_err(
"SPIDERPCI-IOWA:ioremap failed.\n");
156 if (spiderpci_pci_setup_chip(bus->
phb, regs))
172 .readb = spiderpci_readb,
173 .readw = spiderpci_readw,
174 .readl = spiderpci_readl,
175 .readq = spiderpci_readq,
176 .readw_be = spiderpci_readw_be,
177 .readl_be = spiderpci_readl_be,
178 .readq_be = spiderpci_readq_be,
179 .readsb = spiderpci_readsb,
180 .readsw = spiderpci_readsw,
181 .readsl = spiderpci_readsl,
182 .memcpy_fromio = spiderpci_memcpy_fromio,