11 #include <linux/kernel.h>
12 #include <linux/pci.h>
15 #include <linux/slab.h>
29 #define PCICMD_ABORT ((PCI_STATUS_REC_MASTER_ABORT| \
30 PCI_STATUS_REC_TARGET_ABORT)<<16)
32 #define PCICMD_ERROR_BITS ((PCI_STATUS_DETECTED_PARITY | \
33 PCI_STATUS_REC_MASTER_ABORT | \
34 PCI_STATUS_REC_TARGET_ABORT | \
35 PCI_STATUS_PARITY) << 16)
43 unsigned long addr = 0;
64 dc21285_read_config(
struct pci_bus *bus,
unsigned int devfn,
int where,
67 unsigned long addr = dc21285_base_address(bus, devfn);
73 asm(
"ldrb %0, [%1, %2]"
74 :
"=r" (
v) :
"r" (addr),
"r" (where) :
"cc");
77 asm(
"ldrh %0, [%1, %2]"
78 :
"=r" (
v) :
"r" (addr),
"r" (where) :
"cc");
81 asm(
"ldr %0, [%1, %2]"
82 :
"=r" (
v) :
"r" (addr),
"r" (where) :
"cc");
98 dc21285_write_config(
struct pci_bus *bus,
unsigned int devfn,
int where,
101 unsigned long addr = dc21285_base_address(bus, devfn);
107 asm(
"strb %0, [%1, %2]"
108 : :
"r" (
value),
"r" (addr),
"r" (where)
112 asm(
"strh %0, [%1, %2]"
113 : :
"r" (
value),
"r" (addr),
"r" (where)
117 asm(
"str %0, [%1, %2]"
118 : :
"r" (
value),
"r" (addr),
"r" (where)
133 .read = dc21285_read_config,
134 .write = dc21285_write_config,
140 static void dc21285_enable_error(
unsigned long __data)
170 cmd |= PCI_STATUS_REC_MASTER_ABORT << 16;
177 PCI_STATUS_REC_TARGET_ABORT, 1);
180 cmd |= PCI_STATUS_REC_TARGET_ABORT << 16;
188 static irqreturn_t dc21285_serr_irq(
int irq,
void *dev_id)
210 static irqreturn_t dc21285_discard_irq(
int irq,
void *dev_id)
218 static irqreturn_t dc21285_dparity_irq(
int irq,
void *dev_id)
232 static irqreturn_t dc21285_parity_irq(
int irq,
void *dev_id)
263 printk(
"out of memory for root bus resources");
268 res[0].
name =
"Footbridge non-prefetch";
270 res[1].
name =
"Footbridge prefetch";
273 0xa0000000, 0xffffffff, 0x20000000,
NULL,
NULL);
275 0x80000000, 0xffffffff, 0x40000000,
NULL,
NULL);
287 #define dc21285_request_irq(_a, _b, _c, _d, _e) \
288 WARN_ON(request_irq(_a, _b, _c, _d, _e) < 0)
295 pcibios_min_mem = 0x81000000;
299 for (mem_mask = 0x00100000; mem_mask < 0x10000000; mem_mask <<= 1)
300 if (mem_mask >= mem_size)
318 "central function" :
"addin");
334 serr_timer.function = dc21285_enable_error;
336 perr_timer.function = dc21285_enable_error;
342 "PCI system error", &serr_timer);
344 "PCI parity error", &perr_timer);
348 "Discard timer",
NULL);
350 "PCI data parity",
NULL);
372 panic(
"PCI: this kernel is compiled for central "
373 "function mode only");