From patchwork Sat Apr 20 13:56:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 2468071 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id 9476E3FD40 for ; Sat, 20 Apr 2013 14:22:55 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UTYIv-0006hu-M6; Sat, 20 Apr 2013 13:58:16 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UTYHv-0006Y3-Bv; Sat, 20 Apr 2013 13:57:11 +0000 Received: from mail-lb0-f170.google.com ([209.85.217.170]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UTYHG-0006TZ-LO for linux-arm-kernel@lists.infradead.org; Sat, 20 Apr 2013 13:56:32 +0000 Received: by mail-lb0-f170.google.com with SMTP id 13so1336594lba.1 for ; Sat, 20 Apr 2013 06:56:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=Gu6XZbcICcuvp5ey8cKgjAhx42vpoBBLkIb20nwa7nQ=; b=UfZwc6EEnGZrTm9KDh2C2c1ovi76XbCBrvds0TkGufGnGgcAn+aFcv4iYn3xH4UB9c V633XWkluHazUs9sJL+Nt/j5DBxvDu0Gwl6eWGxGelinTeXoTmKg4OKxz+NpnwiLJeXU e3o9z6FzRujweFYEfsm+FYLulcvmSwxteqTJ8WrUzChpNZZkCkgdZM2aW70izLLr0qgs 3EShtewrVRyWIr2V7DS7lIQQbfDW3Jo9/8JaIogVHV57cYZVj0xXj6ptgdzcN17MvDyz TMWrGrInSOog+4yL4l3uAFrO44vgqvDJrIUb0OXtau7Qt5yHInsgWs6Rk1gTlDSLw+lH EFjQ== X-Received: by 10.152.115.140 with SMTP id jo12mr10035832lab.53.1366466188720; Sat, 20 Apr 2013 06:56:28 -0700 (PDT) Received: from localhost.localdomain (c83-249-208-67.bredband.comhem.se. [83.249.208.67]) by mx.google.com with ESMTPS id v10sm7724599lae.9.2013.04.20.06.56.26 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 20 Apr 2013 06:56:27 -0700 (PDT) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org Subject: [RESEND PATCH 08/12] ARM: integrator: remap PCIv3 base dynamically Date: Sat, 20 Apr 2013 15:56:25 +0200 Message-Id: <1366466185-15579-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.8.1.4 X-Gm-Message-State: ALoCoQkInQX2+4pSSVj8rdDK0R/hFtbAVgtKoLqWDT/3McY7/OMdeco/dKmf0/R8YCLxfm5oFiUa X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130420_095630_881178_3E747591 X-CRM114-Status: GOOD ( 11.29 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.217.170 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Linus Walleij X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Remove the static mapping for the PCIv3 PCI bridge controller and do this dynamically when probing instead. Acked-by: Arnd Bergmann Signed-off-by: Linus Walleij --- arch/arm/mach-integrator/include/mach/platform.h | 1 - arch/arm/mach-integrator/integrator_ap.c | 6 ------ arch/arm/mach-integrator/pci_v3.c | 20 ++++++++++++++------ 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/arch/arm/mach-integrator/include/mach/platform.h b/arch/arm/mach-integrator/include/mach/platform.h index be5859e..62fa119 100644 --- a/arch/arm/mach-integrator/include/mach/platform.h +++ b/arch/arm/mach-integrator/include/mach/platform.h @@ -325,7 +325,6 @@ #define PCI_MEMORY_VADDR IOMEM(0xe8000000) #define PCI_CONFIG_VADDR IOMEM(0xec000000) -#define PCI_V3_VADDR IOMEM(0xed000000) /* ------------------------------------------------------------------------ * Integrator Interrupt Controllers diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c index f190bab..9b2d28b 100644 --- a/arch/arm/mach-integrator/integrator_ap.c +++ b/arch/arm/mach-integrator/integrator_ap.c @@ -80,7 +80,6 @@ void __iomem *ap_syscon_base; * Logical Physical * e8000000 40000000 PCI memory PHYS_PCI_MEM_BASE (max 512M) * ec000000 61000000 PCI config space PHYS_PCI_CONFIG_BASE (max 16M) - * ed000000 62000000 PCI V3 regs PHYS_PCI_V3_BASE (max 64k) * fee00000 60000000 PCI IO PHYS_PCI_IO_BASE (max 16M) * ef000000 Cache flush * f1000000 10000000 Core module registers @@ -140,11 +139,6 @@ static struct map_desc ap_io_desc[] __initdata __maybe_unused = { .pfn = __phys_to_pfn(PHYS_PCI_CONFIG_BASE), .length = SZ_16M, .type = MT_DEVICE - }, { - .virtual = (unsigned long)PCI_V3_VADDR, - .pfn = __phys_to_pfn(PHYS_PCI_V3_BASE), - .length = SZ_64K, - .type = MT_DEVICE } }; diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c index 604064b..9dd7125 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",