14 #include <linux/kernel.h>
15 #include <linux/pci.h>
16 #include <linux/slab.h>
22 #include <asm/signal.h>
23 #include <mach/hardware.h>
30 #define DBG(x...) printk(x)
32 #define DBG(x...) do { } while (0)
49 addr |=
PCI_FUNC(devfn) << 8 | (where & ~3);
61 static int iop3xx_pci_status(
void)
70 if (status & 0xf900) {
71 DBG(
"\t\t\tPCI: P0 - status = 0x%08x\n", status);
77 if (status & 0x679f) {
78 DBG(
"\t\t\tPCI: P1 - status = 0x%08x\n", status);
91 static u32 iop3xx_read(
unsigned long addr)
116 unsigned long addr = iop3xx_cfg_address(bus, devfn, where);
117 u32 val = iop3xx_read(addr) >> ((where & 3) * 8);
119 if (iop3xx_pci_status())
128 iop3xx_write_config(
struct pci_bus *bus,
unsigned int devfn,
int where,
131 unsigned long addr = iop3xx_cfg_address(bus, devfn, where);
135 val = iop3xx_read(addr);
136 if (iop3xx_pci_status())
139 where = (where & 3) * 8;
142 val &= ~(0xff << where);
144 val &= ~(0xffff << where);
156 :
"r" (
value),
"r" (addr),
164 .read = iop3xx_read_config,
165 .write = iop3xx_write_config,
173 iop3xx_pci_abort(
unsigned long addr,
unsigned int fsr,
struct pt_regs *
regs)
175 DBG(
"PCI abort: address = 0x%08lx fsr = 0x%03x PC = 0x%08lx LR = 0x%08lx\n",
176 addr, fsr, regs->ARM_pc, regs->ARM_lr);
197 panic(
"PCI: unable to alloc resources");
201 res->
name =
"IOP3XX PCI Memory Space";
324 static void __init iop3xx_atu_debug(
void)
326 DBG(
"PCI: Intel IOP3xx PCI init.\n");
327 DBG(
"PCI: Outbound memory window 0: PCI 0x%08x%08x\n",
329 DBG(
"PCI: Outbound memory window 1: PCI 0x%08x%08x\n",
331 DBG(
"PCI: Outbound IO window: PCI 0x%08x\n",
334 DBG(
"PCI: Inbound memory window 0: PCI 0x%08x%08x 0x%08x -> 0x%08x\n",
336 DBG(
"PCI: Inbound memory window 1: PCI 0x%08x%08x 0x%08x\n",
338 DBG(
"PCI: Inbound memory window 2: PCI 0x%08x%08x 0x%08x -> 0x%08x\n",
340 DBG(
"PCI: Inbound memory window 3: PCI 0x%08x%08x 0x%08x -> 0x%08x\n",
343 DBG(
"PCI: Expansion ROM window: PCI 0x%08x%08x 0x%08x -> 0x%08x\n",
372 static int __init iop3xx_init_atu_setup(
char *
str)
376 while (*str !=
'\0') {
403 __setup(
"iop3xx_init_atu", iop3xx_init_atu_setup);