From patchwork Sun Nov 27 11:41: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: 26338 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5075420wrr; Sun, 27 Nov 2022 03:53:00 -0800 (PST) X-Google-Smtp-Source: AA0mqf6AyhqDQTjSUViBgYXKY1ZV3e7jiArDMlXAzeFQHTsENq5+CAki/+LzA0zeO2pAw3TXI1yX X-Received: by 2002:a63:121a:0:b0:477:6ccb:9f1d with SMTP id h26-20020a63121a000000b004776ccb9f1dmr23922947pgl.537.1669549979786; Sun, 27 Nov 2022 03:52:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669549979; cv=none; d=google.com; s=arc-20160816; b=p5teNmt/VQblkR2/isPvlDNYVS7ofgVq+OgKH84rm4Jg7LJ0ylzJu+cMzx1+ZElzfi ar21eBzSSkFl1L7cHwqcDy42qbrbzqWb10pd+XEkxndNZNrOK6m390946x2DEPLRrUxG u7YQxbQdvhq3x51lmLuC4m94ctowruTMBxIBX/pW2ODImzwjoAYjhTE7DnAJITMOYAvl gmtfokONwkhErVN44PzGyu0EfVAi4WyES50/n2NQ026BH0P8ju+jtmZMnvuSerFe2/A8 iF6pflDBGV6eM9jeDeorIr6e28qgYQRFZoRO18UmglxLrs9y+Euad7bYIWUVqSYSdEI5 pKLg== 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=7w7+yEBl4vGwjIjE10iuV0TWKv2sdao0DcaahtfY9sY=; b=VZmu3GrVFVhVmQHA/Y8niezNRUhyceeMMWoqcaQIGTuRYcUOuNWTL0/1Syi6Ig5Qfg KTwYe+dSCyXSc6GdVWAHhy9hWjnIGtXxTK1ACoX5qiS8fIMvRe1a+PjW70TSXDxB/knT 3h7vHRgYKQ6tmuqjkx1k8cE6u7MpNhRvs99av7VDpxbeRuI+9Cwkg2XuEkbS83iOB4nP 56Wqs+t5j1Ijt7NrgQmi8iw2B4CXW+3rCAENDLdSwpl7U7ikshIyewdvW4onvCrZ1fFa qwI+8V6o0WgkmJUEDr3i92hMYh8uATwgdwKjVpYC6Z0mUvmIRgphWgzMXI1ONCilV+oK HR7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b="oD/gCF3x"; 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 o12-20020a056a0015cc00b0057509d0411esi2557338pfu.192.2022.11.27.03.52.46; Sun, 27 Nov 2022 03:52:59 -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="oD/gCF3x"; 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 S229771AbiK0Lmd (ORCPT + 99 others); Sun, 27 Nov 2022 06:42:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229628AbiK0Ll7 (ORCPT ); Sun, 27 Nov 2022 06:41:59 -0500 Received: from mxout3.routing.net (mxout3.routing.net [IPv6:2a03:2900:1:a::8]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B39CFBC28; Sun, 27 Nov 2022 03:41:57 -0800 (PST) Received: from mxbulk.masterlogin.de (unknown [192.168.10.85]) by mxout3.routing.net (Postfix) with ESMTP id CAD72604B0; Sun, 27 Nov 2022 11:41:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1669549316; 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=7w7+yEBl4vGwjIjE10iuV0TWKv2sdao0DcaahtfY9sY=; b=oD/gCF3xW70yhsIugzeZq+m+yZ2T2jrU8mkPnQAjQDERNIZUjkGtKb010VoaGH3u8OgW/9 YF9qw5+olfPIadukPf3VzuxovV/hCHCUx3TntKDrUjfTSfCKujQ2CvkbB0/t7rLi1eRqjH Sh+rbyv/hm/GKdKoo1ozkY2X37x6OsI= Received: from frank-G5.. (fttx-pool-217.61.157.144.bambit.de [217.61.157.144]) by mxbulk.masterlogin.de (Postfix) with ESMTPSA id 78A68122713; Sun, 27 Nov 2022 11:41:55 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , Ryder Lee , Jianjun Wang , Lorenzo Pieralisi , Rob Herring , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Bjorn Helgaas , Krzysztof Kozlowski , Chunfeng Yun , Vinod Koul , Kishon Vijay Abraham I , Greg Kroah-Hartman , Matthias Brugger , 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 , AngeloGioacchino Del Regno Subject: [next v7 7/8] arm64: dts: mt7986: add pcie related device nodes Date: Sun, 27 Nov 2022 12:41:41 +0100 Message-Id: <20221127114142.156573-8-linux@fw-web.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221127114142.156573-1-linux@fw-web.de> References: <20221127114142.156573-1-linux@fw-web.de> MIME-Version: 1.0 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?1750650039981657522?= X-GMAIL-MSGID: =?utf-8?q?1750650039981657522?= 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 Reviewed-by: AngeloGioacchino Del Regno --- 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 c7a2ac764a30..4f18b4a9a8c8 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts +++ b/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts @@ -93,6 +93,15 @@ &mmc0 { non-removable; no-sd; no-sdio; +}; + +&pcie { + pinctrl-names = "default"; + pinctrl-0 = <&pcie_pins>; + status = "okay"; +}; + +&pcie_phy { status = "okay"; }; @@ -155,6 +164,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 9c552442c02d..f6e980771b69 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 / { compatible = "mediatek,mt7986a"; @@ -361,6 +362,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";