24 #include <linux/kernel.h>
25 #include <linux/pci.h>
32 #include <asm/signal.h>
34 #include <mach/hardware.h>
36 #include <mach/devices.h>
37 #include <mach/regs-pci.h>
41 static int pci_cfg_dbg;
44 static void ks8695_pci_setupconfig(
unsigned int bus_nr,
unsigned int devfn,
unsigned int where)
69 static int ks8695_pci_readconfig(
struct pci_bus *
bus,
72 ks8695_pci_setupconfig(bus->
number, devfn, where);
80 *value = *value >> ((where & 2) * 8);
84 *value = *value >> ((where & 3) * 8);
90 printk(
"read: %d,%08x,%02x,%d: %08x (%08x)\n",
98 static int ks8695_pci_writeconfig(
struct pci_bus *
bus,
104 printk(
"write: %d,%08x,%02x,%d: %08x\n",
105 bus->
number, devfn, where, size, value);
108 ks8695_pci_setupconfig(bus->
number, devfn, where);
116 tmp &= ~(0xffff << ((where & 2) * 8));
117 tmp |= value << ((where & 2) * 8);
123 tmp &= ~(0xff << ((where & 3) * 8));
124 tmp |= value << ((where & 3) * 8);
133 static void ks8695_local_writeconfig(
int where,
u32 value)
135 ks8695_pci_setupconfig(0, 0, where);
139 static struct pci_ops ks8695_pci_ops = {
140 .read = ks8695_pci_readconfig,
141 .write = ks8695_pci_writeconfig,
145 .name =
"PCI Memory space",
152 .name =
"PCI IO space",
187 static inline unsigned int size_mask(
unsigned long size)
192 static int ks8695_pci_fault(
unsigned long addr,
unsigned int fsr,
struct pt_regs *
regs)
195 unsigned long instr = *(
unsigned long *)pc;
200 printk(
KERN_ERR "PCI abort: address = 0x%08lx fsr = 0x%03x PC = 0x%08lx LR = 0x%08lx [%s%s%s%s%s]\n",
201 addr, fsr, regs->ARM_pc, regs->ARM_lr,
215 if ((instr & 0x0c100000) == 0x04100000) {
216 int reg = (instr >> 12) & 15;
219 if (instr & 0x00400000)
229 if ((instr & 0x0e100090) == 0x00100090) {
230 int reg = (instr >> 12) & 15;
240 static void __init ks8695_pci_preinit(
void)
269 static void ks8695_show_pciregs(
void)
299 .ops = &ks8695_pci_ops,
300 .preinit = ks8695_pci_preinit,
301 .setup = ks8695_pci_setup,
309 printk(
"PCI: KS8695 in guest mode, not initialising\n");
317 ks8695_show_pciregs();
322 ks8695_pci.map_irq = cfg->
map_irq;