From patchwork Sun Nov 6 08:50:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 16096 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1397592wru; Sun, 6 Nov 2022 01:51:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM62iLJEMYmj4Yrku2PRaWtergJWEagi9rx7MsTTHoIS3vYGU/5QQlZw8rYQpXNYd+dJNIIQ X-Received: by 2002:a63:e343:0:b0:470:3be8:50c7 with SMTP id o3-20020a63e343000000b004703be850c7mr9040702pgj.336.1667724699513; Sun, 06 Nov 2022 01:51:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667724699; cv=none; d=google.com; s=arc-20160816; b=QBPxnW2ZF2lSaVn/3mY4tNz3X9f9eZruRrk1B7hajVsWHZtuTs9wSyh2UCzjTW6Otp bzkkgCMnWWw8B7Pt37EQpZVZDmtJybCJvEUL1Q7fMAovqeEMb6//5l5/cNufnmLqSzf/ Ru16fMQknaHpmvJQ8t3BU9fNqUGMPeuunqKKRJEnhAfGTyaQyo5P/yxGeRU3U1Fwdo+i rl+mV6vLUwW7mez65NQtqdNpJX6O5DP1dco8Pr1CUrlI3B7YPGkYb21K1LzdbEMuKVOL KweC8hHpV+xwvGIG8Lr/o0H8efHAg8YzBkKQ7079dIy2eKKgf3JyKip9u4Zoif3tOlvh nfmQ== 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=G03vcOdgjh4F0jzuXNPNgwCIh0TlY0vXWFSWrckQleQ=; b=CuW/ZHzWLrtZPcFgBthLtFZfNC9f5DZsDkahalo/+XTiMQE49FOp2zRqR4w2NYUjg1 t1L6UKp2jMSlYCMaFXsbiyoy8s/k2Zi41fMS2MqHUnmUsfNsrwf4xCBTEjlnFHVp77It r5qwgtEMgeHm2xTkMDbZBco+pvYi+eUKcYkF8Gc0VNuHX/saL3XzpBDfJj/cIUKWwKff ho89szRbPGw0ubN2QOM50JtiJc9NstOybVucMhewlSW3zSdqn/9V0y5aY0KItqrTaLy5 MUS+UwHZjvTOAmcwySZhHMZq0Q64CdPi3MKaCuOMlqUGlivsc367jX6UwoxYbFHgjQKN 52Sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=GC229auP; 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 t41-20020a056a0013a900b0056cd93aac47si6253431pfg.358.2022.11.06.01.51.26; Sun, 06 Nov 2022 01:51:39 -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=GC229auP; 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 S229817AbiKFIuu (ORCPT + 99 others); Sun, 6 Nov 2022 03:50:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229771AbiKFIup (ORCPT ); Sun, 6 Nov 2022 03:50:45 -0500 Received: from mxout4.routing.net (mxout4.routing.net [IPv6:2a03:2900:1:a::9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F232495B5; Sun, 6 Nov 2022 01:50:43 -0700 (PDT) Received: from mxbox3.masterlogin.de (unknown [192.168.10.78]) by mxout4.routing.net (Postfix) with ESMTP id DA952100789; Sun, 6 Nov 2022 08:50:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1667724642; 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=G03vcOdgjh4F0jzuXNPNgwCIh0TlY0vXWFSWrckQleQ=; b=GC229auPiPNjmbc0gd5b2XcmOqXP04RZEhzX1Y7fw/CnNWGqNLRb0+US9mxMPSdasmjsWT GOrGTEMpIaF9Dwmjz7lJy5UPYB3AHvPqUlO4h4L/PKaQ0sRJjFL1l0z/Q+WRCM/WSPqa25 C/Q00bjJvwJHN67L4ajUABWajAFdZts= Received: from frank-G5.. (fttx-pool-80.245.79.199.bambit.de [80.245.79.199]) by mxbox3.masterlogin.de (Postfix) with ESMTPSA id 1BA9F36054A; Sun, 6 Nov 2022 08:50:41 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , Matthias Brugger , Rob Herring , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sam Shih Subject: [RFC v3 03/11] arm64: dts: mt7986: add usb related device nodes Date: Sun, 6 Nov 2022 09:50:26 +0100 Message-Id: <20221106085034.12582-4-linux@fw-web.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221106085034.12582-1-linux@fw-web.de> References: <20221106085034.12582-1-linux@fw-web.de> MIME-Version: 1.0 X-Mail-ID: 2604d3a5-6f37-477f-9c36-8f64f7bb0889 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?1748736094159568319?= X-GMAIL-MSGID: =?utf-8?q?1748736094159568319?= From: Sam Shih This patch adds USB support for MT7986. Signed-off-by: Sam Shih Signed-off-by: Frank Wunderlich --- changes compared to sams original version: - reorder xhci-clocks based on yaml binding --- arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts | 28 ++++++++++ arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 55 ++++++++++++++++++++ arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts | 28 ++++++++++ 3 files changed, 111 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts b/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts index 58f7e6b169bf..de5d771e5251 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts +++ b/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts @@ -23,6 +23,24 @@ memory@40000000 { device_type = "memory"; reg = <0 0x40000000 0 0x40000000>; }; + + reg_3p3v: regulator-3p3v { + compatible = "regulator-fixed"; + regulator-name = "fixed-3.3V"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; + }; + + reg_5v: regulator-5v { + compatible = "regulator-fixed"; + regulator-name = "fixed-5V"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-boot-on; + regulator-always-on; + }; }; ð { @@ -136,6 +154,12 @@ &spi1 { status = "okay"; }; +&ssusb { + vusb33-supply = <®_3p3v>; + vbus-supply = <®_5v>; + status = "okay"; +}; + &switch { ports { #address-cells = <1>; @@ -197,6 +221,10 @@ &uart2 { status = "okay"; }; +&usb_phy { + status = "okay"; +}; + &wifi { status = "okay"; pinctrl-names = "default", "dbdc"; diff --git a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi index 6d881095d933..58bbecfbab98 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi @@ -246,6 +246,61 @@ uart2: serial@11004000 { status = "disabled"; }; + ssusb: usb@11200000 { + compatible = "mediatek,mt7986-xhci", + "mediatek,mtk-xhci"; + reg = <0 0x11200000 0 0x2e00>, + <0 0x11203e00 0 0x0100>; + reg-names = "mac", "ippc"; + interrupts = ; + clocks = <&infracfg CLK_INFRA_IUSB_SYS_CK>, + <&infracfg CLK_INFRA_IUSB_CK>, + <&infracfg CLK_INFRA_IUSB_133_CK>, + <&infracfg CLK_INFRA_IUSB_66M_CK>, + <&topckgen CLK_TOP_U2U3_XHCI_SEL>; + clock-names = "sys_ck", + "ref_ck", + "mcu_ck", + "dma_ck", + "xhci_ck"; + phys = <&u2port0 PHY_TYPE_USB2>, + <&u3port0 PHY_TYPE_USB3>, + <&u2port1 PHY_TYPE_USB2>; + status = "disabled"; + }; + + usb_phy: t-phy@11e10000 { + compatible = "mediatek,mt7986-tphy", + "mediatek,generic-tphy-v2"; + #address-cells = <2>; + #size-cells = <2>; + ranges; + status = "disabled"; + + u2port0: usb-phy@11e10000 { + reg = <0 0x11e10000 0 0x700>; + clocks = <&topckgen CLK_TOP_DA_U2_REFSEL>, + <&topckgen CLK_TOP_DA_U2_CK_1P_SEL>; + clock-names = "ref", "da_ref"; + #phy-cells = <1>; + }; + + u3port0: usb-phy@11e10700 { + reg = <0 0x11e10700 0 0x900>; + clocks = <&topckgen CLK_TOP_USB3_PHY_SEL>; + clock-names = "ref"; + #phy-cells = <1>; + }; + + u2port1: usb-phy@11e11000 { + reg = <0 0x11e11000 0 0x700>; + clocks = <&topckgen CLK_TOP_DA_U2_REFSEL>, + <&topckgen CLK_TOP_DA_U2_CK_1P_SEL>; + clock-names = "ref", "da_ref"; + #phy-cells = <1>; + }; + }; + ethsys: syscon@15000000 { #address-cells = <1>; #size-cells = <1>; diff --git a/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts b/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts index 7673aa3fa6ae..cd1763fa7f19 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts +++ b/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts @@ -23,6 +23,24 @@ memory@40000000 { device_type = "memory"; reg = <0 0x40000000 0 0x40000000>; }; + + reg_3p3v: regulator-3p3v { + compatible = "regulator-fixed"; + regulator-name = "fixed-3.3V"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; + }; + + reg_5v: regulator-5v { + compatible = "regulator-fixed"; + regulator-name = "fixed-5V"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-boot-on; + regulator-always-on; + }; }; ð { @@ -163,10 +181,20 @@ &spi1 { status = "okay"; }; +&ssusb { + vusb33-supply = <®_3p3v>; + vbus-supply = <®_5v>; + status = "okay"; +}; + &uart0 { status = "okay"; }; +&usb_phy { + status = "okay"; +}; + &wifi { status = "okay"; pinctrl-names = "default", "dbdc";