diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2012-11-17 13:24:23 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-11-17 13:38:27 -0500 |
commit | 379df2793efdca18e91cb8570f844ad1f83eb609 (patch) | |
tree | 6f61e172528c1fdade27517301787e4c0b174243 /arch/arm/mach-integrator/pci_v3.c | |
parent | 328ba305e3871d4256398a80f45517ec9c814999 (diff) |
ARM: integrator: push down SC dependencies
This pushes the dependencies on the Integrator/AP system
controller (SC) down into the PCI V3 driver and the
AP-specific board file.
First, the platform data for the PL010 UART is moved into
the integrator_ap.c board file, and the Integrator/CP is
assigned with NULL pdata. This way the callback functions
can reference the dynamically remapped AP syscon address
in both the ATAG and DT boot path, and this remapping
is localized to the board file.
Second the PCIv3 driver is making its own dynamic remapping
of the SC for the few registers it is using. When we
convert the PCIv3 driver over to using device tree having a
dynamically assigned base address will be useful, but we
will have to use the definition from <mach/platform.h> for
now, the only improvement is that it's done dynamically.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/mach-integrator/pci_v3.c')
-rw-r--r-- | arch/arm/mach-integrator/pci_v3.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c index bbeca59df66b..000edcda4596 100644 --- a/arch/arm/mach-integrator/pci_v3.c +++ b/arch/arm/mach-integrator/pci_v3.c | |||
@@ -388,9 +388,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 | 388 | * 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. ;) | 389 | * problems. I suppose I'll just have to mind-meld with the machine. ;) |
390 | */ | 390 | */ |
391 | #define SC_PCI __io_address(INTEGRATOR_SC_PCIENABLE) | 391 | static void __iomem *ap_syscon_base; |
392 | #define SC_LBFADDR __io_address(INTEGRATOR_SC_BASE + 0x20) | 392 | #define INTEGRATOR_SC_PCIENABLE_OFFSET 0x18 |
393 | #define SC_LBFCODE __io_address(INTEGRATOR_SC_BASE + 0x24) | 393 | #define INTEGRATOR_SC_LBFADDR_OFFSET 0x20 |
394 | #define INTEGRATOR_SC_LBFCODE_OFFSET 0x24 | ||
394 | 395 | ||
395 | static int | 396 | static int |
396 | v3_pci_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | 397 | v3_pci_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) |
@@ -401,13 +402,13 @@ v3_pci_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | |||
401 | char buf[128]; | 402 | char buf[128]; |
402 | 403 | ||
403 | sprintf(buf, "V3 fault: addr 0x%08lx, FSR 0x%03x, PC 0x%08lx [%08lx] LBFADDR=%08x LBFCODE=%02x ISTAT=%02x\n", | 404 | 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, | 405 | 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)); | 406 | v3_readb(V3_LB_ISTAT)); |
406 | printk(KERN_DEBUG "%s", buf); | 407 | printk(KERN_DEBUG "%s", buf); |
407 | #endif | 408 | #endif |
408 | 409 | ||
409 | v3_writeb(V3_LB_ISTAT, 0); | 410 | v3_writeb(V3_LB_ISTAT, 0); |
410 | __raw_writel(3, SC_PCI); | 411 | __raw_writel(3, ap_syscon_base + INTEGRATOR_SC_PCIENABLE_OFFSET); |
411 | 412 | ||
412 | /* | 413 | /* |
413 | * If the instruction being executed was a read, | 414 | * If the instruction being executed was a read, |
@@ -449,15 +450,15 @@ static irqreturn_t v3_irq(int dummy, void *devid) | |||
449 | 450 | ||
450 | sprintf(buf, "V3 int %d: pc=0x%08lx [%08lx] LBFADDR=%08x LBFCODE=%02x " | 451 | sprintf(buf, "V3 int %d: pc=0x%08lx [%08lx] LBFADDR=%08x LBFCODE=%02x " |
451 | "ISTAT=%02x\n", IRQ_AP_V3INT, pc, instr, | 452 | "ISTAT=%02x\n", IRQ_AP_V3INT, pc, instr, |
452 | __raw_readl(SC_LBFADDR), | 453 | __raw_readl(ap_syscon_base + INTEGRATOR_SC_LBFADDR_OFFSET), |
453 | __raw_readl(SC_LBFCODE) & 255, | 454 | __raw_readl(ap_syscon_base + INTEGRATOR_SC_LBFCODE_OFFSET) & 255, |
454 | v3_readb(V3_LB_ISTAT)); | 455 | v3_readb(V3_LB_ISTAT)); |
455 | printascii(buf); | 456 | printascii(buf); |
456 | #endif | 457 | #endif |
457 | 458 | ||
458 | v3_writew(V3_PCI_STAT, 0xf000); | 459 | v3_writew(V3_PCI_STAT, 0xf000); |
459 | v3_writeb(V3_LB_ISTAT, 0); | 460 | v3_writeb(V3_LB_ISTAT, 0); |
460 | __raw_writel(3, SC_PCI); | 461 | __raw_writel(3, ap_syscon_base + INTEGRATOR_SC_PCIENABLE_OFFSET); |
461 | 462 | ||
462 | #ifdef CONFIG_DEBUG_LL | 463 | #ifdef CONFIG_DEBUG_LL |
463 | /* | 464 | /* |
@@ -480,6 +481,10 @@ int __init pci_v3_setup(int nr, struct pci_sys_data *sys) | |||
480 | if (nr == 0) { | 481 | if (nr == 0) { |
481 | sys->mem_offset = PHYS_PCI_MEM_BASE; | 482 | sys->mem_offset = PHYS_PCI_MEM_BASE; |
482 | ret = pci_v3_setup_resources(sys); | 483 | ret = pci_v3_setup_resources(sys); |
484 | /* Remap the Integrator system controller */ | ||
485 | ap_syscon_base = ioremap(INTEGRATOR_SC_BASE, 0x100); | ||
486 | if (!ap_syscon_base) | ||
487 | return -EINVAL; | ||
483 | } | 488 | } |
484 | 489 | ||
485 | return ret; | 490 | return ret; |
@@ -568,7 +573,7 @@ void __init pci_v3_preinit(void) | |||
568 | v3_writeb(V3_LB_ISTAT, 0); | 573 | v3_writeb(V3_LB_ISTAT, 0); |
569 | v3_writew(V3_LB_CFG, v3_readw(V3_LB_CFG) | (1 << 10)); | 574 | v3_writew(V3_LB_CFG, v3_readw(V3_LB_CFG) | (1 << 10)); |
570 | v3_writeb(V3_LB_IMASK, 0x28); | 575 | v3_writeb(V3_LB_IMASK, 0x28); |
571 | __raw_writel(3, SC_PCI); | 576 | __raw_writel(3, ap_syscon_base + INTEGRATOR_SC_PCIENABLE_OFFSET); |
572 | 577 | ||
573 | /* | 578 | /* |
574 | * Grab the PCI error interrupt. | 579 | * Grab the PCI error interrupt. |