From patchwork Thu Oct 27 06:01:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 13021637 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 4C2E1FA3740 for ; Thu, 27 Oct 2022 06:02:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id:Date :Subject:To:From:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uln4V35RcPImW46pzUuhXszDT2qiOG8FqGH36U8Pisk=; b=LH581VvV5pMcuw 1sC2gGH8AYOK42ehB6T3w5iY7KkijZRfWT/p9WOe1G3NFr4zR06v0mkjKa+C9qlHoT5W1HzK391Ku aG7nITK/wBkVz5kx9ERToSEtB/2WcvY/KliLxhR4Jn/5yJWI4+C3tsHZPYsQ/Dcw4WxLoUPaGE5yy q84g/ihkju9fbUK+SW/cFE3UIn1UBaV70ibtnhUOT/ER9pilgoo097BgLD5xPKC1BWNMlE4A6gkwj XGmZ3QuFPOgoqJnTMj6sHLTAd8Lks2eRZSJbiBJfRJY/D4C73xqhRm75I85q1qyqRalk9szUH4Hiw vfsxc7jzk9IncALW0yjw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1onvyO-00BvlB-1q; Thu, 27 Oct 2022 06:02:36 +0000 Received: from mxout1.routing.net ([2a03:2900:1:a::a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1onvxm-00Bvco-L5; Thu, 27 Oct 2022 06:02:00 +0000 Received: from mxbox1.masterlogin.de (unknown [192.168.10.88]) by mxout1.routing.net (Postfix) with ESMTP id 7B25140723; Thu, 27 Oct 2022 06:01:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1666850513; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uln4V35RcPImW46pzUuhXszDT2qiOG8FqGH36U8Pisk=; b=BhSXLTKRhnWCX9udAN01IKpSWcFHyUFR/qgbbREn2DzDoDlGw1pHYCht2haEqsvKlYQ05E S+iFQCS5DW2+0BEO/8X/4zwW5/JfqhTAr9csnqUMk9oBhAEvPEA06CyAoS1bxi29snhcXQ ti4JrhiK7c1yWLNSDaYMRsZUZlcGIkE= Received: from frank-G5.. (fttx-pool-80.245.77.6.bambit.de [80.245.77.6]) by mxbox1.masterlogin.de (Postfix) with ESMTPSA id A6B1D406D6; Thu, 27 Oct 2022 06:01:52 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Subject: [PATCH v1 1/2] arm64: dts: mt7986: add pcie related device nodes Date: Thu, 27 Oct 2022 08:01:41 +0200 Message-Id: <20221027060142.6354-2-linux@fw-web.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221027060142.6354-1-linux@fw-web.de> References: <20221027060142.6354-1-linux@fw-web.de> MIME-Version: 1.0 X-Mail-ID: 4e27c71e-cb8d-40a9-8962-daf18afb8793 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221026_230158_971161_28E631BE X-CRM114-Status: GOOD ( 12.07 ) 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: , Cc: devicetree@vger.kernel.org, Sam Shih , linux-kernel@vger.kernel.org, Rob Herring , Krzysztof Kozlowski , Matthias Brugger , linux-arm-kernel@lists.infradead.org, Jieyy Yang Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org From: Sam Shih This patch adds PCIe support for MT7986. Signed-off-by: Jieyy Yang Signed-off-by: Sam Shih Signed-off-by: Frank Wunderlich --- changes compared to sams original version: - add clock-names to pcie node - update clocks to new binding --- arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts | 16 ++++++ arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 52 ++++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts b/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts index c5cc7bd19dbf..1f29e6da856e 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts +++ b/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts @@ -100,6 +100,15 @@ &mmc0 { non-removable; no-sd; no-sdio; +}; + +&pcie { + pinctrl-names = "default"; + pinctrl-0 = <&pcie_pins>; + status = "okay"; +}; + +&pcie_phy { status = "okay"; }; @@ -162,6 +171,13 @@ conf-rst { }; }; + pcie_pins: pcie-pins { + mux { + function = "pcie"; + groups = "pcie_clk", "pcie_wake", "pcie_pereset"; + }; + }; + spi_flash_pins: spi-flash-pins { mux { function = "spi"; diff --git a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi index a1a788db113a..eb9023857a05 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi @@ -8,6 +8,7 @@ #include #include #include +#include / { interrupt-parent = <&gic>; @@ -313,6 +314,57 @@ mmc0: mmc@11230000 { status = "disabled"; }; + pcie: pcie@11280000 { + compatible = "mediatek,mt7986-pcie", + "mediatek,mt8192-pcie"; + device_type = "pci"; + #address-cells = <3>; + #size-cells = <2>; + reg = <0x00 0x11280000 0x00 0x4000>; + reg-names = "pcie-mac"; + interrupts = ; + bus-range = <0x00 0xff>; + ranges = <0x82000000 0x00 0x20000000 0x00 + 0x20000000 0x00 0x10000000>; + clocks = <&infracfg CLK_INFRA_IPCIE_PIPE_CK>, + <&infracfg CLK_INFRA_IPCIE_CK>, + <&infracfg CLK_INFRA_IPCIER_CK>, + <&infracfg CLK_INFRA_IPCIEB_CK>; + clock-names = "pl_250m", "tl_26m", "peri_26m", "top_133m"; + status = "disabled"; + + phys = <&pcie_port PHY_TYPE_PCIE>; + phy-names = "pcie-phy"; + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0x7>; + interrupt-map = <0 0 0 1 &pcie_intc 0>, + <0 0 0 2 &pcie_intc 1>, + <0 0 0 3 &pcie_intc 2>, + <0 0 0 4 &pcie_intc 3>; + pcie_intc: interrupt-controller { + #address-cells = <0>; + #interrupt-cells = <1>; + interrupt-controller; + }; + }; + + pcie_phy: t-phy@11c00000 { + compatible = "mediatek,mt7986-tphy", + "mediatek,generic-tphy-v2"; + #address-cells = <2>; + #size-cells = <2>; + ranges; + status = "disabled"; + + pcie_port: pcie-phy@11c00000 { + reg = <0 0x11c00000 0 0x20000>; + clocks = <&clk40m>; + clock-names = "ref"; + #phy-cells = <1>; + }; + }; + usb_phy: t-phy@11e10000 { compatible = "mediatek,mt7986-tphy", "mediatek,generic-tphy-v2"; From patchwork Thu Oct 27 06:01:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 13021635 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 A1216C38A2D for ; Thu, 27 Oct 2022 06:02:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id:Date :Subject:To:From:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=w2ZE/qIsyIboT5rUi20tqGS1dAa2vfhMvGcGE1QuP94=; b=GFTb37Yi4DaENz FwY0Y6iAmMAF7ynky2PyUycpiSlDPj5m8FgaFcNMMZRUEIz/e9+XSo/Yjr7/ZcF7kwFUIjvjLaKwK nyXhKOeNaJvoWIImv+z4EHDqclDOaG7FUB8iJKl+ngOOWo3XmLer32qhMgrmTlAhSw0Uq9fW8Anes Mb56WwzEUh/eNJlJz5kWrW/XiHDHGQqfGNrbZnAEmDeS+CA93NNwCbkVfmDKHyps4kU85yxznkgtK HO3VFoSSFcPwfhZ1ZT30+LUDOqfKjrG2h9c5tTtDL468I5e5HGNtR+IlaggxeGY2In+gVU8DFT0OL UYWnJQvgVSjetzKW0isA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1onvy5-00Bvi4-Tj; Thu, 27 Oct 2022 06:02:17 +0000 Received: from mxout4.routing.net ([2a03:2900:1:a::9]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1onvxm-00Bvcs-59; Thu, 27 Oct 2022 06:01:59 +0000 Received: from mxbox1.masterlogin.de (unknown [192.168.10.88]) by mxout4.routing.net (Postfix) with ESMTP id 308E81009A7; Thu, 27 Oct 2022 06:01:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1666850514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w2ZE/qIsyIboT5rUi20tqGS1dAa2vfhMvGcGE1QuP94=; b=xu/80XHq712kMldqEFAn77AXFGc4ltrRt3kBabQFKFon+p76ogbIbTgv8EbYLwHF+CVWcc fVSlml6uTxMuLRcbotWh6YM1ASTrCza+naipI+WXjITDLdn6f6uY7/11J9X8WcqqeYdrTQ QIm1JxKe7hDef8RRtCUT4axQnDPq4HI= Received: from frank-G5.. (fttx-pool-80.245.77.6.bambit.de [80.245.77.6]) by mxbox1.masterlogin.de (Postfix) with ESMTPSA id 75228405D6; Thu, 27 Oct 2022 06:01:53 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Subject: [PATCH v1 2/2] arm64: dts: mt7986: add PCIe nodes to BananaPi-R3 Date: Thu, 27 Oct 2022 08:01:42 +0200 Message-Id: <20221027060142.6354-3-linux@fw-web.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221027060142.6354-1-linux@fw-web.de> References: <20221027060142.6354-1-linux@fw-web.de> MIME-Version: 1.0 X-Mail-ID: f1260125-602d-462f-afe8-10e90a54aa61 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221026_230158_392569_EDDA5A31 X-CRM114-Status: UNSURE ( 9.03 ) 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: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , Krzysztof Kozlowski , Matthias Brugger , linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org From: Frank Wunderlich Add PCIe nodes to Banana Pi R3 SBC which is used on M.2 slot. Signed-off-by: Frank Wunderlich --- .../dts/mediatek/mt7986a-bananapi-bpi-r3.dtsi | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dtsi b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dtsi index fc100c3a6415..8eb7079cf6d7 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dtsi @@ -181,6 +181,16 @@ &i2c0 { status = "okay"; }; +&pcie { + pinctrl-names = "default"; + pinctrl-0 = <&pcie_pins>; + status = "okay"; +}; + +&pcie_phy { + status = "okay"; +}; + &pio { i2c_pins: i2c-pins { mux { @@ -247,6 +257,13 @@ conf-rst { }; }; + pcie_pins: pcie-pins { + mux { + function = "pcie"; + groups = "pcie_clk", "pcie_pereset"; + }; + }; + spi_flash_pins: spi-flash-pins { mux { function = "spi";