From patchwork Fri Dec 17 11:23:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 12684367 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9582BC433EF for ; Fri, 17 Dec 2021 11:31:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OJ4I2cMFYzC7YEO5uqoQxeWoJyfCRDPutcRL6O9WRDs=; b=TmzAGqzp1AafB1 CeEBPoXlQcS7zSTP1XPQZVefoP0ZcuqRxnZuEjg/nhUy4zFla6+U9EJyfwBM4BAtzv7WJ+TBie25F 79tEGqGRO0Q6KN/6qmm+JFnuw3oWHYWSPwRYqOiZQ4i3K0u0/N7Pjtlna/21lCGI73Llu+hUg2oBV STJ+eSSgiV35U8wmgCYYg1TQWfNQsDxpdIYuDfzmgO0ANoGE2Pqn9T4JBnrmZQt1adoZiIpFuMNrO nlzfc0JX2urpzgAxBjVgksBxa8SorecrbyGxSZ9l+dGo80OwsOSPeys2/y71pnLuDgx71G1/P2KsD io3bHu4gMFls0ZDQnglQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1myBSR-009pNc-Tz; Fri, 17 Dec 2021 11:31:27 +0000 Received: from nbd.name ([2a01:4f8:221:3d45::2]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1myBLO-009mhc-VM; Fri, 17 Dec 2021 11:24:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=MFyEYw8hfFZry89fBZPaaRJJpXELjngNud4Pkg3znpQ=; b=eKEr6OVnOAIoflEt+d1zh70Cc+ lZU+Fzb/XGJnPwsLo9f/efqJ6oXSzcXlNPzZwaGK49nvcIEamfabqIC9IMLZ6gQEDf2B6HuEIJHFP Nx6zNV1BrtJLbTNAtWXoq3jKBqaPo8YO6PjJ+ZVl7itfgrtyrzBpR0sV9LEff1oJNB3Y=; Received: from p54ae911a.dip0.t-ipconnect.de ([84.174.145.26] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1myBLI-000742-0D; Fri, 17 Dec 2021 12:24:04 +0100 From: Felix Fietkau To: Ryder Lee , Jianjun Wang , Bjorn Helgaas , Rob Herring , Matthias Brugger Cc: john@phrozen.org, linux-arm-kernel@lists.infradead.org, Rob Herring , linux-pci@vger.kernel.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 09/14] dt-bindings: PCI: Add support for Airoha EN7532 Date: Fri, 17 Dec 2021 12:23:39 +0100 Message-Id: <20211217112345.14029-10-nbd@nbd.name> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211217112345.14029-1-nbd@nbd.name> References: <20211217112345.14029-1-nbd@nbd.name> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211217_032411_250553_23970B29 X-CRM114-Status: UNSURE ( 8.63 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org From: John Crispin EN7532 is an ARM based platform SoC integrating the same PCIe IP as MT7622, add a binding for it. Acked-by: Rob Herring Signed-off-by: John Crispin --- Documentation/devicetree/bindings/pci/mediatek-pcie.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/pci/mediatek-pcie.txt b/Documentation/devicetree/bindings/pci/mediatek-pcie.txt index 57ae73462272..684227522267 100644 --- a/Documentation/devicetree/bindings/pci/mediatek-pcie.txt +++ b/Documentation/devicetree/bindings/pci/mediatek-pcie.txt @@ -7,6 +7,7 @@ Required properties: "mediatek,mt7622-pcie" "mediatek,mt7623-pcie" "mediatek,mt7629-pcie" + "airoha,en7523-pcie" - device_type: Must be "pci" - reg: Base addresses and lengths of the root ports. - reg-names: Names of the above areas to use during resource lookup. From patchwork Fri Dec 17 11:23:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 12684369 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3A255C433F5 for ; Fri, 17 Dec 2021 11:32:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=o4gtEsHeS9EHbCawRzk+/oOr/q6iJZmQsU4M8w7pb0E=; b=pi65mtvBkIXeie jAbJw1wegupiwB+rfzJqHo9fkGNYvLyF2+etF3nzOXU6t0bs+jSmnsGf6GC7MEK4zu2Apgaio+GMY 7zcu7HlArb+46Dt9JUp4Q8f/7elc40QAum/cJ9jZx2ovYwikg+2L3xnMQW+pqJyIXPNWlO8EbyGH8 kcGAo40k7Vlfq7wNZWCW/bDf5pzefVJRXu9os6YcDF/KvIKvpxQ1vucDxXFPAOY3cfeyRQSN831vy TJ3vxnX0l+WwRSNLzAAj0rlx/pVwve/pVPFXL+rhpmb9pHYHpXj3Mw0S1sZFKD0oi8WrAA+Je+uZu LJvwXwGDDxHzTC+pNnSg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1myBTO-009prB-5O; Fri, 17 Dec 2021 11:32:26 +0000 Received: from nbd.name ([2a01:4f8:221:3d45::2]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1myBLz-009msU-Ub; Fri, 17 Dec 2021 11:24:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Fo12LyElK6HTFfc1CLwdAEtHL45MRT2gxsJ7jkMYIM4=; b=QwFEQQDUrZ6x+yjvpb2cbo6eeu 5ZlMDahgC3yImVXi5vW+bejALbNItgNXeBYsMXJGT72KkSDNZxl/xXDD7qoLQo1GqjWdIeax3jNV/ gYfclU5OrHiQHclY7NBTD3Kg28W7c5qWAaYYs6ocInNaNKj+e0PrRcRM/jrognBx46QE=; Received: from p54ae911a.dip0.t-ipconnect.de ([84.174.145.26] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1myBLI-000742-S2; Fri, 17 Dec 2021 12:24:04 +0100 From: Felix Fietkau To: Lorenzo Pieralisi , Rob Herring , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Bjorn Helgaas , Matthias Brugger Cc: john@phrozen.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH v7 10/14] PCI: mediatek: Allow selecting controller driver for airoha arch Date: Fri, 17 Dec 2021 12:23:40 +0100 Message-Id: <20211217112345.14029-11-nbd@nbd.name> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211217112345.14029-1-nbd@nbd.name> References: <20211217112345.14029-1-nbd@nbd.name> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211217_032448_212691_3D2D650F X-CRM114-Status: GOOD ( 11.48 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org This patch allows selecting the pcie-mediatek driver if ARCH_AIROHA is set, because the Airoha EN7523 SoC uses the same controller as MT7622. The driver itself is not modified. The PCIe controller DT node should use mediatek,mt7622-pcie after airoha,en7523-pcie. Signed-off-by: Felix Fietkau --- drivers/pci/controller/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/controller/Kconfig b/drivers/pci/controller/Kconfig index 93b141110537..f1342059c2a3 100644 --- a/drivers/pci/controller/Kconfig +++ b/drivers/pci/controller/Kconfig @@ -233,7 +233,7 @@ config PCIE_ROCKCHIP_EP config PCIE_MEDIATEK tristate "MediaTek PCIe controller" - depends on ARCH_MEDIATEK || COMPILE_TEST + depends on ARCH_AIROHA || ARCH_MEDIATEK || COMPILE_TEST depends on OF depends on PCI_MSI_IRQ_DOMAIN help From patchwork Fri Dec 17 11:23:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 12684397 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6C554C433EF for ; Fri, 17 Dec 2021 11:36:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lTQLIn+TE8UFMPodCSFO2S43ACJb0blzH9Ui4Jqk3/I=; b=nJsCa1BYogeNM/ CtKASuIJ2SuDNOGJFZzwFf0czP/1Hm7JDmaHPFctgeiT0jLQCg4Ah6L940LF4xDNIel8YP+cGud4w eWTDwC43ktE+xSJdZKi0UWC/m/0WN5v1ZCYqSsV9gw4ls5ntO0htMmzC8qdZfV4sAw3CyHqrIga1e c17ujiYtifB3wjzXsPHd3XBSaz3yhmiYTHZT6QYehycbNvcjo2isfMSSSkW66kLpffw4N0jUf2uUH bW+83Ud2Nc7Cv7ZvreQ06BHtcUEy+PaK0MHAHnm0a62ZsJ8+DgvPpNAXHIRZq0wUxnLvyrq0OoTBj BVK9/LVu5A7DnRVkntww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1myBWp-009rYO-8J; Fri, 17 Dec 2021 11:35:59 +0000 Received: from nbd.name ([2a01:4f8:221:3d45::2]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1myBMU-009n3G-Pf; Fri, 17 Dec 2021 11:25:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=EJlxClv7lGaks+7g6MaGFpuicispAFvSlSbDezAHD8s=; b=EE6Z1nral7L3g0U4VUM2Ly/zIq r1iOvSaj0q27P7htCuq0OUkeP7hk3wNEPRdWSsTdCKmB6/RTb4aw2k7C/UwUD6Y/XLXuxscmXR/em TnBqo/dCd5gJ+3iS0nNIUMN13YynzRTVbxYuhvJxm2N5L/k24tsmLKhgb3+gz3Z4hH7o=; Received: from p54ae911a.dip0.t-ipconnect.de ([84.174.145.26] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1myBLJ-000742-RB; Fri, 17 Dec 2021 12:24:05 +0100 From: Felix Fietkau To: Rob Herring , Matthias Brugger Cc: john@phrozen.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH v7 11/14] ARM: dts: Add PCIe support for Airoha EN7523 Date: Fri, 17 Dec 2021 12:23:41 +0100 Message-Id: <20211217112345.14029-12-nbd@nbd.name> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211217112345.14029-1-nbd@nbd.name> References: <20211217112345.14029-1-nbd@nbd.name> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211217_032519_066372_8420F46F X-CRM114-Status: GOOD ( 11.19 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org This uses the MediaTek MT7622 PCIe driver, since the PCIe IP block is nearly identical to the one in MT7622 Signed-off-by: Felix Fietkau --- arch/arm/boot/dts/en7523-evb.dts | 8 +++++ arch/arm/boot/dts/en7523.dtsi | 60 ++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/arch/arm/boot/dts/en7523-evb.dts b/arch/arm/boot/dts/en7523-evb.dts index 69754ef9a628..0a79f5f6c311 100644 --- a/arch/arm/boot/dts/en7523-evb.dts +++ b/arch/arm/boot/dts/en7523-evb.dts @@ -25,3 +25,11 @@ memory@80000000 { reg = <0x80000000 0x20000000>; }; }; + +&pcie0 { + status = "okay"; +}; + +&pcie1 { + status = "okay"; +}; diff --git a/arch/arm/boot/dts/en7523.dtsi b/arch/arm/boot/dts/en7523.dtsi index 0148958c607b..862da104d6f2 100644 --- a/arch/arm/boot/dts/en7523.dtsi +++ b/arch/arm/boot/dts/en7523.dtsi @@ -119,4 +119,64 @@ uart1: serial@1fbf0000 { clock-frequency = <1843200>; status = "okay"; }; + + + pcie0: pcie@1fa91000 { + compatible = "airoha,en7523-pcie", "mediatek,mt7622-pcie"; + device_type = "pci"; + reg = <0x1fa91000 0x1000>; + reg-names = "port0"; + linux,pci-domain = <0>; + #address-cells = <3>; + #size-cells = <2>; + interrupts = ; + interrupt-names = "pcie_irq"; + clocks = <&scu EN7523_CLK_PCIE>; + clock-names = "sys_ck0"; + bus-range = <0x00 0xff>; + ranges = <0x82000000 0 0x20000000 0x20000000 0 0x8000000>; + status = "disabled"; + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0 0 0 1 &pcie_intc0 0>, + <0 0 0 2 &pcie_intc0 1>, + <0 0 0 3 &pcie_intc0 2>, + <0 0 0 4 &pcie_intc0 3>; + pcie_intc0: interrupt-controller { + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + }; + }; + + pcie1: pcie@1fa92000 { + compatible = "airoha,en7523-pcie", "mediatek,mt7622-pcie"; + device_type = "pci"; + reg = <0x1fa92000 0x1000>; + reg-names = "port1"; + linux,pci-domain = <1>; + #address-cells = <3>; + #size-cells = <2>; + interrupts = ; + interrupt-names = "pcie_irq"; + clocks = <&scu EN7523_CLK_PCIE>; + clock-names = "sys_ck1"; + bus-range = <0x00 0xff>; + ranges = <0x82000000 0 0x28000000 0x28000000 0 0x8000000>; + status = "disabled"; + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0 0 0 1 &pcie_intc1 0>, + <0 0 0 2 &pcie_intc1 1>, + <0 0 0 3 &pcie_intc1 2>, + <0 0 0 4 &pcie_intc1 3>; + pcie_intc1: interrupt-controller { + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + }; + }; + };