From patchwork Mon Oct 17 10:41:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 3383 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1376307wrs; Mon, 17 Oct 2022 03:44:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5jv0iScKtuoQ/drLR8FBXMKANBEZ4b+fS52++5Yeae2ZH+CG0XaQpZ2fXI8lFLh6KWM1Ul X-Received: by 2002:a63:551b:0:b0:44b:7dcf:92ee with SMTP id j27-20020a63551b000000b0044b7dcf92eemr10442216pgb.610.1666003493439; Mon, 17 Oct 2022 03:44:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666003493; cv=none; d=google.com; s=arc-20160816; b=n3qeWiYglJMTEQEUPzpGFk47SwU1PN3WnA8SNyD5yxJKm5/W6q54rTd/f4lRthL4zX 8nNGQwc+s0vwcqXaQnSAIk6oBgRH55Cm+YPZK598F1gW7VQadJLE3FwEf1d0wsDNS9u8 PdQMem7GRDATop9i1JA4lg1mBNxPa0dN/tOZgF6Kv+gv2n2uRSs5Ah8LK/QRD4Tus/qb wepliTUngsLD8mN2KIyj10TmJjI+hG0P6s9+U+Jm47Jt4LI8fpfSiz+MFWbhHV7W6IdE rUOAEzFMtpyk7yp8w31c4WSobsGLBsyy9k4l5aXwcggXnLSpb0vqz8xYbNjlY1GB526V cnFA== 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=RHn6Fi5NkmkCIasAYws/xS30fZL3s3A7ejdty0blXKs=; b=HEa85y6lKObfRw6q3IsSLCfzP58O5MP8mXD7M4X3vweZcWDGCeY6171RE+54aOFxeA fL6MKkZKgQJ+uGbHP0zukliLIsrHqgyAVWpUijLisG0hkwhWoYXEVAFMax/ZOMJWrhfm ubGNaZbS5P3vipNnXkJpPqDTPNwsiQ+9ibHGhmGb4z1tDARm/5hFhdp45NLfZGc2o3/+ +ZD95SBxoLiFUb2UINAVbkyfOwSNLhxGRGfdFHBI56e05cx0uuJUrUuMjrvfAtD2oUu3 6FUiFCDKih8mR9H4S5RUGoQ6t0DMk19LDcdVyXeaKXDBUeM+buBVsP41swS4DHJXWFLy 53eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=cV1iJCQN; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k15-20020a170902c40f00b001715a583d46si14901988plk.474.2022.10.17.03.44.40; Mon, 17 Oct 2022 03:44:53 -0700 (PDT) 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=cV1iJCQN; 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 S230420AbiJQKm0 (ORCPT + 99 others); Mon, 17 Oct 2022 06:42:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230144AbiJQKmC (ORCPT ); Mon, 17 Oct 2022 06:42:02 -0400 Received: from mxout3.routing.net (mxout3.routing.net [IPv6:2a03:2900:1:a::8]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C7855FF4F; Mon, 17 Oct 2022 03:42:00 -0700 (PDT) Received: from mxbox1.masterlogin.de (unknown [192.168.10.88]) by mxout3.routing.net (Postfix) with ESMTP id 06F1D60506; Mon, 17 Oct 2022 10:41:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1666003319; 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=RHn6Fi5NkmkCIasAYws/xS30fZL3s3A7ejdty0blXKs=; b=cV1iJCQNwQImok84qFvnuxX+IeLz+ZRw8q5Gp6elMyDS9L4YhThC1UkA0R/6/bJvAMukQc vRQ049rnsGMOdzXJbObiuWQhcNU1r0o7GAttrj4GIVn1FbVssCRSYuLlH6yskc+dF6FlLs 7EETzoQVz3s5/KZDJ5z9p5a6SdsFYJs= Received: from frank-G5.. (fttx-pool-217.61.154.127.bambit.de [217.61.154.127]) by mxbox1.masterlogin.de (Postfix) with ESMTPSA id 555A34053E; Mon, 17 Oct 2022 10:41:58 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sam Shih , Jieyy Yang Subject: [RFC v1 07/12] arm64: dts: mt7986: add pcie related device nodes Date: Mon, 17 Oct 2022 12:41:36 +0200 Message-Id: <20221017104141.7338-8-linux@fw-web.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221017104141.7338-1-linux@fw-web.de> References: <20221017104141.7338-1-linux@fw-web.de> MIME-Version: 1.0 X-Mail-ID: 799015bb-29c8-452b-8665-6b48831f56ce 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746931279410402309?= X-GMAIL-MSGID: =?utf-8?q?1746931279410402309?= 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 driver does bulk handling without names, but binding requires 6 clocks and not only 5 we have --- arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts | 17 ++++++ arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 54 ++++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts b/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts index 58f7e6b169bf..c08ca4746014 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts +++ b/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts @@ -54,7 +54,24 @@ switch: switch@0 { }; }; +&pcie { + pinctrl-names = "default"; + pinctrl-0 = <&pcie_pins>; + status = "okay"; +}; + +&pcie_phy { + status = "okay"; +}; + &pio { + 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 e77e8deec4b0..007c1e25a639 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>; @@ -246,6 +247,59 @@ uart2: serial@11004000 { 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_PCIE_SEL>, + <&infracfg CLK_INFRA_IPCIE_CK>, + <&infracfg CLK_INFRA_IPCIE_PIPE_CK>, + <&infracfg CLK_INFRA_IPCIER_CK>, + <&infracfg CLK_INFRA_IPCIEB_CK>; + clock-names = "pl_250m", "tl_26m", "tl_96m", + "tl_32k", "peri_26m"; + 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>; + }; + }; + ethsys: syscon@15000000 { #address-cells = <1>; #size-cells = <1>;