diff options
Diffstat (limited to 'arch/arm/mach-integrator/pci_v3.c')
-rw-r--r-- | arch/arm/mach-integrator/pci_v3.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c index bbeca59df66b..be50e795536d 100644 --- a/arch/arm/mach-integrator/pci_v3.c +++ b/arch/arm/mach-integrator/pci_v3.c | |||
@@ -191,12 +191,9 @@ static void __iomem *v3_open_config_window(struct pci_bus *bus, | |||
191 | /* | 191 | /* |
192 | * Trap out illegal values | 192 | * Trap out illegal values |
193 | */ | 193 | */ |
194 | if (offset > 255) | 194 | BUG_ON(offset > 255); |
195 | BUG(); | 195 | BUG_ON(busnr > 255); |
196 | if (busnr > 255) | 196 | BUG_ON(devfn > 255); |
197 | BUG(); | ||
198 | if (devfn > 255) | ||
199 | BUG(); | ||
200 | 197 | ||
201 | if (busnr == 0) { | 198 | if (busnr == 0) { |
202 | int slot = PCI_SLOT(devfn); | 199 | int slot = PCI_SLOT(devfn); |
@@ -388,9 +385,10 @@ static int __init pci_v3_setup_resources(struct pci_sys_data *sys) | |||
388 | * means I can't get additional information on the reason for the pm2fb | 385 | * means I can't get additional information on the reason for the pm2fb |
389 | * problems. I suppose I'll just have to mind-meld with the machine. ;) | 386 | * problems. I suppose I'll just have to mind-meld with the machine. ;) |
390 | */ | 387 | */ |
391 | #define SC_PCI __io_address(INTEGRATOR_SC_PCIENABLE) | 388 | static void __iomem *ap_syscon_base; |
392 | #define SC_LBFADDR __io_address(INTEGRATOR_SC_BASE + 0x20) | 389 | #define INTEGRATOR_SC_PCIENABLE_OFFSET 0x18 |
393 | #define SC_LBFCODE __io_address(INTEGRATOR_SC_BASE + 0x24) | 390 | #define INTEGRATOR_SC_LBFADDR_OFFSET 0x20 |
391 | #define INTEGRATOR_SC_LBFCODE_OFFSET 0x24 | ||
394 | 392 | ||
395 | static int | 393 | static int |
396 | v3_pci_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | 394 | v3_pci_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) |
@@ -401,13 +399,13 @@ v3_pci_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | |||
401 | char buf[128]; | 399 | char buf[128]; |
402 | 400 | ||
403 | sprintf(buf, "V3 fault: addr 0x%08lx, FSR 0x%03x, PC 0x%08lx [%08lx] LBFADDR=%08x LBFCODE=%02x ISTAT=%02x\n", | 401 | sprintf(buf, "V3 fault: addr 0x%08lx, FSR 0x%03x, PC 0x%08lx [%08lx] LBFADDR=%08x LBFCODE=%02x ISTAT=%02x\n", |
404 | addr, fsr, pc, instr, __raw_readl(SC_LBFADDR), __raw_readl(SC_LBFCODE) & 255, | 402 | addr, fsr, pc, instr, __raw_readl(ap_syscon_base + INTEGRATOR_SC_LBFADDR_OFFSET), __raw_readl(ap_syscon_base + INTEGRATOR_SC_LBFCODE_OFFSET) & 255, |
405 | v3_readb(V3_LB_ISTAT)); | 403 | v3_readb(V3_LB_ISTAT)); |
406 | printk(KERN_DEBUG "%s", buf); | 404 | printk(KERN_DEBUG "%s", buf); |
407 | #endif | 405 | #endif |
408 | 406 | ||
409 | v3_writeb(V3_LB_ISTAT, 0); | 407 | v3_writeb(V3_LB_ISTAT, 0); |
410 | __raw_writel(3, SC_PCI); | 408 | __raw_writel(3, ap_syscon_base + INTEGRATOR_SC_PCIENABLE_OFFSET); |
411 | 409 | ||
412 | /* | 410 | /* |
413 | * If the instruction being executed was a read, | 411 | * If the instruction being executed was a read, |
@@ -449,15 +447,15 @@ static irqreturn_t v3_irq(int dummy, void *devid) | |||
449 | 447 | ||
450 | sprintf(buf, "V3 int %d: pc=0x%08lx [%08lx] LBFADDR=%08x LBFCODE=%02x " | 448 | sprintf(buf, "V3 int %d: pc=0x%08lx [%08lx] LBFADDR=%08x LBFCODE=%02x " |
451 | "ISTAT=%02x\n", IRQ_AP_V3INT, pc, instr, | 449 | "ISTAT=%02x\n", IRQ_AP_V3INT, pc, instr, |
452 | __raw_readl(SC_LBFADDR), | 450 | __raw_readl(ap_syscon_base + INTEGRATOR_SC_LBFADDR_OFFSET), |
453 | __raw_readl(SC_LBFCODE) & 255, | 451 | __raw_readl(ap_syscon_base + INTEGRATOR_SC_LBFCODE_OFFSET) & 255, |
454 | v3_readb(V3_LB_ISTAT)); | 452 | v3_readb(V3_LB_ISTAT)); |
455 | printascii(buf); | 453 | printascii(buf); |
456 | #endif | 454 | #endif |
457 | 455 | ||
458 | v3_writew(V3_PCI_STAT, 0xf000); | 456 | v3_writew(V3_PCI_STAT, 0xf000); |
459 | v3_writeb(V3_LB_ISTAT, 0); | 457 | v3_writeb(V3_LB_ISTAT, 0); |
460 | __raw_writel(3, SC_PCI); | 458 | __raw_writel(3, ap_syscon_base + INTEGRATOR_SC_PCIENABLE_OFFSET); |
461 | 459 | ||
462 | #ifdef CONFIG_DEBUG_LL | 460 | #ifdef CONFIG_DEBUG_LL |
463 | /* | 461 | /* |
@@ -480,6 +478,10 @@ int __init pci_v3_setup(int nr, struct pci_sys_data *sys) | |||
480 | if (nr == 0) { | 478 | if (nr == 0) { |
481 | sys->mem_offset = PHYS_PCI_MEM_BASE; | 479 | sys->mem_offset = PHYS_PCI_MEM_BASE; |
482 | ret = pci_v3_setup_resources(sys); | 480 | ret = pci_v3_setup_resources(sys); |
481 | /* Remap the Integrator system controller */ | ||
482 | ap_syscon_base = ioremap(INTEGRATOR_SC_BASE, 0x100); | ||
483 | if (!ap_syscon_base) | ||
484 | return -EINVAL; | ||
483 | } | 485 | } |
484 | 486 | ||
485 | return ret; | 487 | return ret; |
@@ -568,7 +570,7 @@ void __init pci_v3_preinit(void) | |||
568 | v3_writeb(V3_LB_ISTAT, 0); | 570 | v3_writeb(V3_LB_ISTAT, 0); |
569 | v3_writew(V3_LB_CFG, v3_readw(V3_LB_CFG) | (1 << 10)); | 571 | v3_writew(V3_LB_CFG, v3_readw(V3_LB_CFG) | (1 << 10)); |
570 | v3_writeb(V3_LB_IMASK, 0x28); | 572 | v3_writeb(V3_LB_IMASK, 0x28); |
571 | __raw_writel(3, SC_PCI); | 573 | __raw_writel(3, ap_syscon_base + INTEGRATOR_SC_PCIENABLE_OFFSET); |
572 | 574 | ||
573 | /* | 575 | /* |
574 | * Grab the PCI error interrupt. | 576 | * Grab the PCI error interrupt. |