From patchwork Fri Apr 12 17:54:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 16122 Return-Path: X-Original-To: linaro@staging.patches.linaro.org Delivered-To: linaro@staging.patches.linaro.org Received: from mail-fa0-f69.google.com (mail-fa0-f69.google.com [209.85.161.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E7A8526EB0 for ; Fri, 12 Apr 2013 17:54:49 +0000 (UTC) Received: by mail-fa0-f69.google.com with SMTP id p1sf3886664fad.0 for ; Fri, 12 Apr 2013 10:54:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=czRAb71MMh+Tj94ptoP4gpGfQPs6jiTJV5GO04OCfdo=; b=nLfyc1JG7m2c+sS9X3GhBtX4iragPiFqd74Z4mqZf8Z/sGvIujgH7GcR1X1Lv8GCSx WjoYXf81VXfkbkeH4+fjQoTaqY8V5LX7NDOhus2LsDGH460txUolAgab7zYJ4i1ddkTe zmjSjTcQeCdLr3go8ttctNh+xY0kIB4tWNJECUDhMs5U18eTZIXFE+GVySz72jWNRI3R YJ1jQtjFMgXsYbeNx7onPwISGClU7iu4VZyjxt4L+mzt3e+tx2ouimr3YBGIFU8H+6On T9z9X7rbvGGL3hzKZnJuuo6xcCUToeIKj5e4Tyiq2W/rt65IZbk1I/J3inKSNCnj7TbM Qc+Q== X-Received: by 10.180.106.73 with SMTP id gs9mr1327982wib.2.1365789264820; Fri, 12 Apr 2013 10:54:24 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.107.73 with SMTP id ha9ls612032wib.27.gmail; Fri, 12 Apr 2013 10:54:24 -0700 (PDT) X-Received: by 10.180.97.233 with SMTP id ed9mr5635357wib.32.1365789264747; Fri, 12 Apr 2013 10:54:24 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id dk8si1209616wib.101.2013.04.12.10.54.24 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Apr 2013 10:54:24 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id jz10so2604140veb.19 for ; Fri, 12 Apr 2013 10:54:23 -0700 (PDT) X-Received: by 10.220.73.68 with SMTP id p4mr9370713vcj.41.1365789263458; Fri, 12 Apr 2013 10:54:23 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp76320veb; Fri, 12 Apr 2013 10:54:22 -0700 (PDT) X-Received: by 10.152.132.36 with SMTP id or4mr5899428lab.8.1365789261804; Fri, 12 Apr 2013 10:54:21 -0700 (PDT) Received: from mail.df.lth.se (mail.df.lth.se. [194.47.250.12]) by mx.google.com with ESMTPS id q6si879938lae.217.2013.04.12.10.54.20 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 12 Apr 2013 10:54:21 -0700 (PDT) Received-SPF: pass (google.com: domain of triad@df.lth.se designates 194.47.250.12 as permitted sender) client-ip=194.47.250.12; Received: from mer.df.lth.se (mer.df.lth.se [194.47.250.37]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.df.lth.se (Postfix) with ESMTPS id 6081F65D47; Fri, 12 Apr 2013 19:54:20 +0200 (CEST) Received: from mer.df.lth.se (triad@localhost.localdomain [127.0.0.1]) by mer.df.lth.se (8.14.3/8.14.3/Debian-9.4) with ESMTP id r3CHsKY7008047; Fri, 12 Apr 2013 19:54:20 +0200 Received: (from triad@localhost) by mer.df.lth.se (8.14.3/8.14.3/Submit) id r3CHsJ7d008046; Fri, 12 Apr 2013 19:54:19 +0200 From: Linus Walleij To: linux-arm-kernel@lists.infradead.org Cc: Linus Walleij Subject: [PATCH 10/11 v2] ARM: integrator: basic PCIv3 device tree support Date: Fri, 12 Apr 2013 19:54:16 +0200 Message-Id: <1365789256-8019-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.7.2.5 X-Gm-Message-State: ALoCoQm7Jkdd8W3sq0odnZuVntTKS7Cx/0UZEQKhbBYEAPFXB4YlhHWSOz4suQ9WfRv3fRppBRlB X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- ChangeLog v1->v2: - Use the new pci_common_init_dev() call so the device tree can actually be used to remap interrupts in the next patch. --- .../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