diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2013-03-16 21:51:02 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-06-03 08:04:39 +0200 |
commit | a5ecbab7d9b606bdfbec67ccda0fde0f82e1e70e (patch) | |
tree | 7decba401fec83ec57759db7d069b41ff26cd981 /arch/arm/mach-integrator/pci_v3.c | |
parent | 207bcf45193bd6b847373246b37a3b673b1c81ca (diff) |
ARM: integrator: remap PCIv3 base dynamically
Remove the static mapping for the PCIv3 PCI bridge controller
and do this dynamically when probing instead.
Acked-by: Arnd Bergmann <arnd@arndb.de>
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 | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c index 604064b9d4ff..9dd7125e658f 100644 --- a/arch/arm/mach-integrator/pci_v3.c +++ b/arch/arm/mach-integrator/pci_v3.c @@ -260,15 +260,17 @@ * the mappings into PCI memory. */ +static void __iomem *pci_v3_base; + // V3 access routines -#define v3_writeb(o,v) __raw_writeb(v, PCI_V3_VADDR + (unsigned int)(o)) -#define v3_readb(o) (__raw_readb(PCI_V3_VADDR + (unsigned int)(o))) +#define v3_writeb(o,v) __raw_writeb(v, pci_v3_base + (unsigned int)(o)) +#define v3_readb(o) (__raw_readb(pci_v3_base + (unsigned int)(o))) -#define v3_writew(o,v) __raw_writew(v, PCI_V3_VADDR + (unsigned int)(o)) -#define v3_readw(o) (__raw_readw(PCI_V3_VADDR + (unsigned int)(o))) +#define v3_writew(o,v) __raw_writew(v, pci_v3_base + (unsigned int)(o)) +#define v3_readw(o) (__raw_readw(pci_v3_base + (unsigned int)(o))) -#define v3_writel(o,v) __raw_writel(v, PCI_V3_VADDR + (unsigned int)(o)) -#define v3_readl(o) (__raw_readl(PCI_V3_VADDR + (unsigned int)(o))) +#define v3_writel(o,v) __raw_writel(v, pci_v3_base + (unsigned int)(o)) +#define v3_readl(o) (__raw_readl(pci_v3_base + (unsigned int)(o))) /*============================================================================ * @@ -835,6 +837,12 @@ static int __init pci_v3_probe(struct platform_device *pdev) return -ENODEV; } + pci_v3_base = devm_ioremap(&pdev->dev, PHYS_PCI_V3_BASE, SZ_64K); + if (!pci_v3_base) { + dev_err(&pdev->dev, "unable to remap PCIv3 base\n"); + return -ENODEV; + } + ret = devm_request_irq(&pdev->dev, IRQ_AP_V3INT, v3_irq, 0, "V3", NULL); if (ret) { dev_err(&pdev->dev, "unable to grab PCI error interrupt: %d\n", |