23 #include <linux/kernel.h>
24 #include <linux/pci.h>
31 #include <mach/hardware.h>
32 #include <mach/platform.h>
33 #include <mach/irqs.h>
35 #include <asm/signal.h>
37 #include <asm/irq_regs.h>
105 #define v3_writeb(o,v) __raw_writeb(v, PCI_V3_VADDR + (unsigned int)(o))
106 #define v3_readb(o) (__raw_readb(PCI_V3_VADDR + (unsigned int)(o)))
108 #define v3_writew(o,v) __raw_writew(v, PCI_V3_VADDR + (unsigned int)(o))
109 #define v3_readw(o) (__raw_readw(PCI_V3_VADDR + (unsigned int)(o)))
111 #define v3_writel(o,v) __raw_writel(v, PCI_V3_VADDR + (unsigned int)(o))
112 #define v3_readl(o) (__raw_readl(PCI_V3_VADDR + (unsigned int)(o)))
168 #define PCI_BUS_NONMEM_START 0x00000000
169 #define PCI_BUS_NONMEM_SIZE SZ_256M
171 #define PCI_BUS_PREMEM_START PCI_BUS_NONMEM_START + PCI_BUS_NONMEM_SIZE
172 #define PCI_BUS_PREMEM_SIZE SZ_256M
174 #if PCI_BUS_NONMEM_START & 0x000fffff
175 #error PCI_BUS_NONMEM_START must be megabyte aligned
177 #if PCI_BUS_PREMEM_START & 0x000fffff
178 #error PCI_BUS_PREMEM_START must be megabyte aligned
181 #undef V3_LB_BASE_PREFETCH
182 #define V3_LB_BASE_PREFETCH 0
187 unsigned int address, mapaddress, busnr;
221 mapaddress |= 1 << (slot - 5);
226 address |= 1 << (slot + 11);
241 address = (busnr << 16) | (devfn << 8);
262 static void v3_close_config_window(
void)
280 static int v3_read_config(
struct pci_bus *
bus,
unsigned int devfn,
int where,
288 addr = v3_open_config_window(bus, devfn, where);
304 v3_close_config_window();
311 static int v3_write_config(
struct pci_bus *bus,
unsigned int devfn,
int where,
318 addr = v3_open_config_window(bus, devfn, where);
337 v3_close_config_window();
344 .read = v3_read_config,
345 .write = v3_write_config,
349 .name =
"PCI non-prefetchable",
356 .name =
"PCI prefetchable",
391 #define SC_PCI __io_address(INTEGRATOR_SC_PCIENABLE)
392 #define SC_LBFADDR __io_address(INTEGRATOR_SC_BASE + 0x20)
393 #define SC_LBFCODE __io_address(INTEGRATOR_SC_BASE + 0x24)
396 v3_pci_fault(
unsigned long addr,
unsigned int fsr,
struct pt_regs *
regs)
399 unsigned long instr = *(
unsigned long *)pc;
403 sprintf(buf,
"V3 fault: addr 0x%08lx, FSR 0x%03x, PC 0x%08lx [%08lx] LBFADDR=%08x LBFCODE=%02x ISTAT=%02x\n",
416 if ((instr & 0x0c100000) == 0x04100000) {
417 int reg = (instr >> 12) & 15;
420 if (instr & 0x00400000)
430 if ((instr & 0x0e100090) == 0x00100090) {
431 int reg = (instr >> 12) & 15;
443 #ifdef CONFIG_DEBUG_LL
446 unsigned long instr = *(
unsigned long *)pc;
448 extern void printascii(
const char *);
450 sprintf(buf,
"V3 int %d: pc=0x%08lx [%08lx] LBFADDR=%08x LBFCODE=%02x "
462 #ifdef CONFIG_DEBUG_LL
467 if ((instr & 0x0c100000) == 0x04100000) {
468 int reg = (instr >> 16) & 15;
469 sprintf(buf,
" reg%d = %08lx\n", reg, regs->
uregs[reg]);
482 ret = pci_v3_setup_resources(sys);
498 pcibios_min_mem = 0x00100000;
579 "interrupt: %d\n", ret);
586 unsigned int pci_cmd;
600 "interrupt: %d\n",
ret);