From patchwork Mon Feb 27 19:07:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 733051 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vXB7w33J3z9s8R for ; Tue, 28 Feb 2017 06:08:44 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="V7t5cisk"; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id AB5A1B913E9; Mon, 27 Feb 2017 20:08:08 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Mon, 27 Feb 2017 20:08:08 +0100 (CET) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id E854CB9139A for ; Mon, 27 Feb 2017 20:08:00 +0100 (CET) X-policyd-weight: using cached result; rate: -7 Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com [209.85.215.46]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 27 Feb 2017 20:08:00 +0100 (CET) Received: by mail-lf0-f46.google.com with SMTP id k202so23735043lfe.1 for ; Mon, 27 Feb 2017 11:08:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=d0ElAOcUSmDTyMmG2Ri6V5DpA3anUGqZgbcYiw47xbI=; b=V7t5cisk/Gd8RTJ/ZJlNP+mD1DiQNybckw6wyAollOlouQqZAd2iKG8Xjlzf6uRFVx x/DD9ljuY/JZuE49oD0WaeweBb25LAjei49YzbMyU3ogsG37CXnW8vX//Q8MrGzIcUkV gc1HLB6NhMw10xB7k80w8fW02h9NJH9z8PyQQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=d0ElAOcUSmDTyMmG2Ri6V5DpA3anUGqZgbcYiw47xbI=; b=DE1rcCwsNtQU4zT4TDc9NQLv/dkfqSirYeQaiHc4WEvx43Otery35fBLOP9h4Vyflk 0zdla0SjKulV1z17tLvBXs7Sn9UXJTEa/kxBkImwBnt+oybkvvpMKvT94fa8ws5/O62u isx2v3NGYz7JeZXATVl6MN+Jb2VurW3m6Kww0OLfY/kWBWpt5Qo+BBSIpKsY09xIFrcM iFRIFanyY6Kcv8636ddfBSYHIED07OcjD/agjEf83j9S8SzOwsFm9DrV/EURQEfnZ5UY WGTWL453sJdLPen461ZHbzub+YDpkjiRVpewfh37RCZLXhJdCxUrZEkHMg0uDmYpfIgz ftmQ== X-Gm-Message-State: AMke39lfIt7eJ5AkSZZVDIG6skQpFgzLC6Dbfg3460UwypE1pwMWele1ayQ7WY4RGGZA+xPl X-Received: by 10.25.202.29 with SMTP id a29mr5367057lfg.23.1488222480205; Mon, 27 Feb 2017 11:08:00 -0800 (PST) Received: from localhost.localdomain (c-357171d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.113.53]) by smtp.gmail.com with ESMTPSA id a63sm4022244lfa.61.2017.02.27.11.07.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Feb 2017 11:07:58 -0800 (PST) From: Linus Walleij To: Hans Ulli Kroll , Florian Fainelli , Rob Herring , devicetree@vger.kernel.org, Bjorn Helgaas Date: Mon, 27 Feb 2017 20:07:20 +0100 Message-Id: <20170227190720.31409-4-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170227190720.31409-1-linus.walleij@linaro.org> References: <20170227190720.31409-1-linus.walleij@linaro.org> Subject: [OpenWrt-Devel] [PATCH 4/4 v3] ARM: dts: add PCI to the Gemini device trees X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: openwrt-devel@openwrt.org, Feng-Hsin Chiang , Paulius Zaleckas , linux-pci@vger.kernel.org, Greentime Hu , Janos Laube , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" The Cortina Gemini has an internal PCI root bus, add this to the device tree, and add interrupt mapping (swizzling) to the relevant systems device trees. Cc: Janos Laube Cc: Paulius Zaleckas Cc: Hans Ulli Kroll Cc: Florian Fainelli Cc: Feng-Hsin Chiang Cc: Greentime Hu Signed-off-by: Linus Walleij --- ChangeLog v2->v3: - Change compatible string to "cortina,gemini-pci", "faraday,ftpci100"; - Add "dma-ranges" property, after deciphering that some hardcoded constants in the driver is really about this. ChangeLog v1->v2: - Change bus-range to <0x00 0xff> - Drop the three extra IRQs that are unused - Implement the right interrupt mapping/swizzling - Push the interrupt mapping down to each affected system, only SQ201 for now. PCI maintainers: this is FYI only, I will funnel this to the ARM SoC tree once we are done with the PCI driver. --- arch/arm/boot/dts/gemini-sq201.dts | 22 ++++++++++++++++++++ arch/arm/boot/dts/gemini.dtsi | 42 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/arch/arm/boot/dts/gemini-sq201.dts b/arch/arm/boot/dts/gemini-sq201.dts index dae2a70d8fbc..46309e79cc7b 100644 --- a/arch/arm/boot/dts/gemini-sq201.dts +++ b/arch/arm/boot/dts/gemini-sq201.dts @@ -92,5 +92,27 @@ read-only; }; }; + + pci@50000000 { + status = "okay"; + interrupt-map-mask = <0xf800 0 0 7>; + interrupt-map = + <0x4800 0 0 1 &pci_intc 0>, /* Slot 9 */ + <0x4800 0 0 2 &pci_intc 1>, + <0x4800 0 0 3 &pci_intc 2>, + <0x4800 0 0 4 &pci_intc 3>, + <0x5000 0 0 1 &pci_intc 1>, /* Slot 10 */ + <0x5000 0 0 2 &pci_intc 2>, + <0x5000 0 0 3 &pci_intc 3>, + <0x5000 0 0 4 &pci_intc 0>, + <0x5800 0 0 1 &pci_intc 2>, /* Slot 11 */ + <0x5800 0 0 2 &pci_intc 3>, + <0x5800 0 0 3 &pci_intc 0>, + <0x5800 0 0 4 &pci_intc 1>, + <0x6000 0 0 1 &pci_intc 3>, /* Slot 12 */ + <0x6000 0 0 2 &pci_intc 0>, + <0x6000 0 0 3 &pci_intc 1>, + <0x6000 0 0 4 &pci_intc 2>; + }; }; }; diff --git a/arch/arm/boot/dts/gemini.dtsi b/arch/arm/boot/dts/gemini.dtsi index 3876feefc9d9..918e46546823 100644 --- a/arch/arm/boot/dts/gemini.dtsi +++ b/arch/arm/boot/dts/gemini.dtsi @@ -104,5 +104,47 @@ interrupt-controller; #interrupt-cells = <2>; }; + + pci@50000000 { + compatible = "cortina,gemini-pci", "faraday,ftpci100"; + /* + * The first 256 bytes in the IO range is actually used + * to configure the host bridge. + */ + reg = <0x50000000 0x100>; + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + status = "disabled"; + + bus-range = <0x00 0xff>; + /* PCI ranges mappings */ + ranges = + /* 1MiB I/O space 0x50000000-0x500fffff */ + <0x01000000 0 0 0x50000000 0 0x00100000>, + /* 128MiB non-prefetchable memory 0x58000000-0x5fffffff */ + <0x02000000 0 0x58000000 0x58000000 0 0x08000000>; + + /* DMA ranges */ + dma-ranges = + /* 128MiB at 0x00000000-0x07ffffff */ + <0x02000000 0 0x00000000 0x00000000 0 0x08000000>, + /* 64MiB at 0x00000000-0x03ffffff */ + <0x02000000 0 0x00000000 0x00000000 0 0x04000000>, + /* 64MiB at 0x00000000-0x03ffffff */ + <0x02000000 0 0x00000000 0x00000000 0 0x04000000>; + + /* + * This PCI host bridge variant has a cascaded interrupt + * controller embedded in the host bridge. + */ + pci_intc: interrupt-controller { + interrupt-parent = <&intcon>; + interrupts = <8 IRQ_TYPE_LEVEL_HIGH>; + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + }; + }; }; };