Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3238525rwb; Sat, 12 Nov 2022 01:42:00 -0800 (PST) X-Google-Smtp-Source: AA0mqf427aLuC09jv8p7DnjBlJqnX4NEoGG4KWalJX3zjrO95azExgyc2Cb/ZCtQibxPdtC8Y/2q X-Received: by 2002:a17:907:2993:b0:7ae:37aa:711 with SMTP id eu19-20020a170907299300b007ae37aa0711mr4664668ejc.329.1668246120363; Sat, 12 Nov 2022 01:42:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668246120; cv=none; d=google.com; s=arc-20160816; b=LZqu4ZEF8PxRhU59hd4VM/7UzMSaIQSC8py0neNgsYV0UDAzKWIVSEMaWtSLPP35FK zuKm8dISvsJbl+FuCwJqprD+w/gNRVQDAtq7B7k0Q9+uYPioysBVYXlmZ2q7igHEf8xe Ll8Ev7n3DtkKXT5mrAgQCHnuXrR+PFkG+0IULDulTztJ+aNuPPTku2JvvRF+q3odm2A7 2SDNqbbATzvNL05xBM3vpMYpbH6hBH8Nkb48AFNiPmnx7ScITkMsgSS+iPcy9AGj/MTR OWkIjrBAsV0vjq9DMjfRsne7p+1voshD59hELcV/+NpLz5SYAiRfUtPIQcquSoVaUqQi gCzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RY8+9ND4n/9TSXTqXvKked5EltzRypGczAsVjbvOd7o=; b=vd5Hxg/rgcn44IU1N9Ze+Tde+Tp8kFe/Qoeux3lRebvMP3DCiOv4jLUy/9SHa805+5 1HO0QmzFvn82XwG8WpX8QxpjyL1kOIppVhxrzBRi75irarNnVB6aWhTHWhRDl8kltX7p YxSUbREkIdPvqrqmR1lID1EPfp7HRTh9ko0IHomtjrxS/H46g2Q6QbK2SyJez6mxnRiV JxtSFY/k+7ex+75Re2hR6A1ZIy3G7rEH9pUF2S7WOxk6G7A812ZDHj+iQFx/q9ItEGzK 9iokuMdqAm1xHXwSG5dZ7xiQaG5CjPnBs/ffRLORf5A0BFyZNbauN2pURQ0STbY1LpeO oSnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=mSfWgvsx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w2-20020a1709062f8200b0078e27f2fbe4si3442330eji.293.2022.11.12.01.41.32; Sat, 12 Nov 2022 01:42:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=mSfWgvsx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234825AbiKLJQ3 (ORCPT + 90 others); Sat, 12 Nov 2022 04:16:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234739AbiKLJPq (ORCPT ); Sat, 12 Nov 2022 04:15:46 -0500 Received: from mxout2.routing.net (mxout2.routing.net [IPv6:2a03:2900:1:a::b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBE6E15FF5; Sat, 12 Nov 2022 01:15:44 -0800 (PST) Received: from mxbox3.masterlogin.de (unknown [192.168.10.78]) by mxout2.routing.net (Postfix) with ESMTP id 256E460479; Sat, 12 Nov 2022 09:15:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1668244543; 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=RY8+9ND4n/9TSXTqXvKked5EltzRypGczAsVjbvOd7o=; b=mSfWgvsx9xZv9eIrM30SPE/I1H+Dc4VMu6GKOuN+iA6UVdlqUO+Qw6zX9OXCv6BwV73Pt+ kuI/o30Kvj7G1z+e0eFN4AjaFfzSBch7Xo7Wr8ZPQvOFpnJ3YzmZuTrKG9cdwaaPf55UrM 0+jPvweJ4x+HAAP8jhLvQoKpeZcS808= Received: from frank-G5.. (fttx-pool-157.180.227.41.bambit.de [157.180.227.41]) by mxbox3.masterlogin.de (Postfix) with ESMTPSA id 0D27636065F; Sat, 12 Nov 2022 09:15:41 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , Ryder Lee , Jianjun Wang , Bjorn Helgaas , Rob Herring , Krzysztof Kozlowski , Chunfeng Yun , Kishon Vijay Abraham I , Vinod Koul , Greg Kroah-Hartman , Matthias Brugger , Paolo Abeni , Lorenzo Bianconi , Bo Jiao , linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org, linux-usb@vger.kernel.org, Sam Shih , Jieyy Yang Subject: [PATCH v4 09/11] arm64: dts: mt7986: add pcie related device nodes Date: Sat, 12 Nov 2022 10:15:16 +0100 Message-Id: <20221112091518.7846-10-linux@fw-web.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221112091518.7846-1-linux@fw-web.de> References: <20221112091518.7846-1-linux@fw-web.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mail-ID: facedc48-9d5f-451f-bc74-ce9662f350ab X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 --- bindings-patches: https://patchwork.kernel.org/project/linux-mediatek/list/?series=690172 --- 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 e1a0331aaa5f..01fa08c57c39 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts +++ b/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts @@ -102,6 +102,15 @@ &mmc0 { non-removable; no-sd; no-sdio; +}; + +&pcie { + pinctrl-names = "default"; + pinctrl-0 = <&pcie_pins>; + status = "okay"; +}; + +&pcie_phy { status = "okay"; }; @@ -164,6 +173,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 4b85a645fd55..97cef0fd9d8f 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>; @@ -319,6 +320,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"; -- 2.34.1