From patchwork Sat Apr 20 13:56:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 2468091 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id 292E3DF2A1 for ; Sat, 20 Apr 2013 14:34:52 +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 1UTYJo-00071z-4H; Sat, 20 Apr 2013 13:59:15 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UTYIK-0006Zq-Ki; Sat, 20 Apr 2013 13:57:36 +0000 Received: from mail-la0-x229.google.com ([2a00:1450:4010:c03::229]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UTYHd-0006Wb-3Z for linux-arm-kernel@lists.infradead.org; Sat, 20 Apr 2013 13:56:57 +0000 Received: by mail-la0-f41.google.com with SMTP id ee20so457785lab.0 for ; Sat, 20 Apr 2013 06:56:50 -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=rI9RMhlQfWEyjEpXXRKvwPFt7V0E5E/R6zK1sRSzENM=; b=Gx+pdIzQUSoe6U6LevN0I/YY45vPZ7eJvwSBZ5K5CrFT3KZty9DWoWI5xh0c0MrqZX 1DL3ypOFhmfYO1zCaidUkr3ln0LzY+eeu7QXTsCQ0zFr9ykW9qKfSm2vDGHp2my68Obq +DeXEn1Mq5nzmQfpAbfymdlI2j2K26/mznHMz5Z7ReyXpvfnfoRcq9Q4TFWkDB9SXRtq qz8skuFjDQMYZA+88cIo7Bknp3dUO3Aql7S9U4Xx6KVWwOfngG1Wl2dyJVitsFy84GTL 8nSUcQNRCoH8/et6rujYhUuaXgywoQGaDLY2+r7d4PAz2PM8dmNT9oaLhkHHY5O/RwRR QHlg== X-Received: by 10.112.155.40 with SMTP id vt8mr9746066lbb.70.1366466210061; Sat, 20 Apr 2013 06:56:50 -0700 (PDT) Received: from localhost.localdomain (c83-249-208-67.bredband.comhem.se. [83.249.208.67]) by mx.google.com with ESMTPS id sl5sm7455011lbb.10.2013.04.20.06.56.48 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 20 Apr 2013 06:56:49 -0700 (PDT) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org Subject: [RESEND PATCH 11/12] ARM: integrator: basic PCIv3 device tree support Date: Sat, 20 Apr 2013 15:56:47 +0200 Message-Id: <1366466207-15680-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.8.1.4 X-Gm-Message-State: ALoCoQnzZUBOpV/8wYWeQ9tQTA7yeLyL/e5DtaWX5mA7JFTWowqdeE+nPBGiRM+5H5yG5YnP3q1+ X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130420_095653_568480_90A473A9 X-CRM114-Status: GOOD ( 28.31 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -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 This registers the memory ranges for I/O, non-prefetched and prefetched memory and configuration space for the PCIv3 bridge and let us fetch these basic memory resources from the device tree in the device tree boot path. Remove the stepping stone platform device. This is an either/or approach - the platform data path is mutually exclusive to the plain platform data path and provided addresses from the device tree have to be correct. This patch does not add the IRQ mapping - that is to follow in later patches. Acked-by: Arnd Bergmann Signed-off-by: Linus Walleij --- .../devicetree/bindings/pci/v3-v360epc-pci.txt | 15 +++ .../devicetree/bindings/vendor-prefixes.txt | 1 + arch/arm/boot/dts/integratorap.dts | 17 +++ arch/arm/mach-integrator/integrator_ap.c | 11 -- arch/arm/mach-integrator/pci_v3.c | 143 +++++++++++++++++---- 5 files changed, 152 insertions(+), 35 deletions(-) create mode 100644 Documentation/devicetree/bindings/pci/v3-v360epc-pci.txt diff --git a/Documentation/devicetree/bindings/pci/v3-v360epc-pci.txt b/Documentation/devicetree/bindings/pci/v3-v360epc-pci.txt new file mode 100644 index 0000000..30b364e --- /dev/null +++ b/Documentation/devicetree/bindings/pci/v3-v360epc-pci.txt @@ -0,0 +1,15 @@ +V3 Semiconductor V360 EPC PCI bridge + +This bridge is found in the ARM Integrator/AP (Application Platform) + +Integrator-specific notes: + +- syscon: should contain a link to the syscon device node (since + on the Integrator, some registers in the syscon are required to + operate the V3). + +V360 EPC specific notes: + +- reg: should contain the base address of the V3 adapter. +- interrupts: should contain a reference to the V3 error interrupt + as routed on the system. diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index 19e1ef7..c51a6d2 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -56,6 +56,7 @@ ste ST-Ericsson stericsson ST-Ericsson ti Texas Instruments toshiba Toshiba Corporation +v3 V3 Semiconductor via VIA Technologies, Inc. wlf Wolfson Microelectronics wm Wondermedia Technologies, Inc. diff --git a/arch/arm/boot/dts/integratorap.dts b/arch/arm/boot/dts/integratorap.dts index c9c3fa3..9c78130 100644 --- a/arch/arm/boot/dts/integratorap.dts +++ b/arch/arm/boot/dts/integratorap.dts @@ -39,6 +39,23 @@ valid-mask = <0x003fffff>; }; + pci: pciv3@62000000 { + compatible = "v3,v360epc-pci"; + #size-cells = <2>; + #address-cells = <3>; + reg = <0x62000000 0x10000>; + interrupt-parent = <&pic>; + interrupts = <17>; /* Bus error IRQ */ + ranges = <0x00000000 0 0x61000000 /* config space */ + 0x61000000 0 0x00100000 /* 16 MiB @ 61000000 */ + 0x01000000 0 0x60000000 /* I/O space */ + 0x60000000 0 0x00100000 /* 16 MiB @ 60000000 */ + 0x02000000 0 0x40000000 /* non-prefectable memory */ + 0x40000000 0 0x10000000 /* 256 MiB @ 40000000 */ + 0x42000000 0 0x50000000 /* prefetchable memory */ + 0x50000000 0 0x10000000>; /* 256 MiB @ 50000000 */ + }; + fpga { /* * The Integator/AP predates the idea to have magic numbers diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c index f617489..793c262 100644 --- a/arch/arm/mach-integrator/integrator_ap.c +++ b/arch/arm/mach-integrator/integrator_ap.c @@ -473,15 +473,6 @@ static struct of_dev_auxdata ap_auxdata_lookup[] __initdata = { { /* sentinel */ }, }; -/* - * This is a placeholder that will get deleted when we move the PCI - * device over to the device tree. - */ -static struct platform_device pci_v3_device_of = { - .name = "pci-v3", - .id = 0, -}; - static void __init ap_init_of(void) { unsigned long sc_dec; @@ -538,8 +529,6 @@ static void __init ap_init_of(void) of_platform_populate(root, of_default_bus_match_table, ap_auxdata_lookup, parent); - platform_device_register(&pci_v3_device_of); - sc_dec = readl(ap_syscon_base + INTEGRATOR_SC_DEC_OFFSET); for (i = 0; i < 4; i++) { struct lm_device *lmdev; diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c index a3cefde..8932eb3 100644 --- a/arch/arm/mach-integrator/pci_v3.c +++ b/arch/arm/mach-integrator/pci_v3.c @@ -28,6 +28,9 @@ #include #include #include +#include +#include +#include #include