From nobody Thu Nov 14 07:20:43 2024 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2A47C5479D for ; Fri, 6 Jan 2023 15:29:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231339AbjAFP3T (ORCPT ); Fri, 6 Jan 2023 10:29:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235330AbjAFP3E (ORCPT ); Fri, 6 Jan 2023 10:29:04 -0500 Received: from mxout4.routing.net (mxout4.routing.net [IPv6:2a03:2900:1:a::9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D6BE8B75C; Fri, 6 Jan 2023 07:29:00 -0800 (PST) Received: from mxbulk.masterlogin.de (unknown [192.168.10.85]) by mxout4.routing.net (Postfix) with ESMTP id EB07C100464; Fri, 6 Jan 2023 15:28:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1673018939; 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=TXaEWxtn0uFZdcMKR1HVawy7OAcOEaMqyiThbbGx/JQ=; b=S/OG9VJu7Jie4XsryCXN+BCsu/4JyG+TriwtuN2mEKRjzjeSTc1W+v0l62yjfb16cdHBhC PIajeIelKfTTMeSRr+CblgRXpzhZM4gKT0BCWIJXNf/YtYgGaoKOWVFGI933SndPNT8siJ ymfwtp3ZCqVSqcSNuqBUug7dEICig0c= Received: from frank-G5.. (fttx-pool-217.61.159.6.bambit.de [217.61.159.6]) by mxbulk.masterlogin.de (Postfix) with ESMTPSA id 46F7212272E; Fri, 6 Jan 2023 15:28:58 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , Chunfeng Yun , Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , AngeloGioacchino Del Regno Subject: [PATCH v9 1/5] dt-bindings: phy: mediatek,tphy: add support for mt7986 Date: Fri, 6 Jan 2023 16:28:41 +0100 Message-Id: <20230106152845.88717-2-linux@fw-web.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230106152845.88717-1-linux@fw-web.de> References: <20230106152845.88717-1-linux@fw-web.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Frank Wunderlich Add compatible string for mt7986. Signed-off-by: Frank Wunderlich Acked-by: Krzysztof Kozlowski Reviewed-by: Chunfeng Yun Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger --- Documentation/devicetree/bindings/phy/mediatek,tphy.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml b/Doc= umentation/devicetree/bindings/phy/mediatek,tphy.yaml index 5613cc5106e3..230a17f24966 100644 --- a/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml +++ b/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml @@ -79,6 +79,7 @@ properties: - enum: - mediatek,mt2712-tphy - mediatek,mt7629-tphy + - mediatek,mt7986-tphy - mediatek,mt8183-tphy - mediatek,mt8186-tphy - mediatek,mt8192-tphy --=20 2.34.1 From nobody Thu Nov 14 07:20:43 2024 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D8CEC3DA7A for ; Fri, 6 Jan 2023 15:29:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235586AbjAFP3W (ORCPT ); Fri, 6 Jan 2023 10:29:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235292AbjAFP3H (ORCPT ); Fri, 6 Jan 2023 10:29:07 -0500 Received: from mxout3.routing.net (mxout3.routing.net [IPv6:2a03:2900:1:a::8]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E90B58B742; Fri, 6 Jan 2023 07:29:01 -0800 (PST) Received: from mxbulk.masterlogin.de (unknown [192.168.10.85]) by mxout3.routing.net (Postfix) with ESMTP id 4A9526049F; Fri, 6 Jan 2023 15:29:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1673018940; 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=NdrLgZ7kHEHZCcXHBTGh4SDP3w9h0DuG6QN4UIa1As8=; b=mdv5dY0vjs0fiUEZwkkCDEFOMdnnn9wnOjvvpuIhvfgA4wZCeQ48yzuyXvFM0t0AC/uNl9 OUFmahitwFAZ3GtAn7YjNBCuc/onz3D67jqeiuUXkx0Ih8v5jBcr+sjXIOeHZL7pCdCcMo 1g00M/Ek216cs+PKu2G3AVwrgK+794U= Received: from frank-G5.. (fttx-pool-217.61.159.6.bambit.de [217.61.159.6]) by mxbulk.masterlogin.de (Postfix) with ESMTPSA id EE9D31226D4; Fri, 6 Jan 2023 15:28:58 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , Chunfeng Yun , Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sam Shih Subject: [PATCH v9 2/5] arm64: dts: mt7986: add usb related device nodes Date: Fri, 6 Jan 2023 16:28:42 +0100 Message-Id: <20230106152845.88717-3-linux@fw-web.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230106152845.88717-1-linux@fw-web.de> References: <20230106152845.88717-1-linux@fw-web.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Sam Shih This patch adds USB support for MT7986. Signed-off-by: Sam Shih Signed-off-by: Frank Wunderlich Reviewed-by: Chunfeng Yun --- changes compared to sams original version: - reorder xhci-clocks based on yaml binding v5: - update ranges/reg of usb-phy - not added RB from AngeloGioacchino for v4 because of these changes v6: - remove unused usb regulators - remove 3v3 regulator (will be added with emmc-patch) --- arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts | 8 +++ arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 55 ++++++++++++++++++++ arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts | 8 +++ 3 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 9b83925893b7..58089fcf4d16 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts +++ b/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts @@ -140,6 +140,10 @@ &spi1 { status =3D "okay"; }; =20 +&ssusb { + status =3D "okay"; +}; + &switch { ports { #address-cells =3D <1>; @@ -201,6 +205,10 @@ &uart2 { status =3D "okay"; }; =20 +&usb_phy { + status =3D "okay"; +}; + &wifi { status =3D "okay"; pinctrl-names =3D "default", "dbdc"; diff --git a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/arch/arm64/boot/dt= s/mediatek/mt7986a.dtsi index 0e9406fc63e2..9ff2968152ae 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi @@ -323,6 +323,61 @@ spi1: spi@1100b000 { status =3D "disabled"; }; =20 + ssusb: usb@11200000 { + compatible =3D "mediatek,mt7986-xhci", + "mediatek,mtk-xhci"; + reg =3D <0 0x11200000 0 0x2e00>, + <0 0x11203e00 0 0x0100>; + reg-names =3D "mac", "ippc"; + interrupts =3D ; + clocks =3D <&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 =3D "sys_ck", + "ref_ck", + "mcu_ck", + "dma_ck", + "xhci_ck"; + phys =3D <&u2port0 PHY_TYPE_USB2>, + <&u3port0 PHY_TYPE_USB3>, + <&u2port1 PHY_TYPE_USB2>; + status =3D "disabled"; + }; + + usb_phy: t-phy@11e10000 { + compatible =3D "mediatek,mt7986-tphy", + "mediatek,generic-tphy-v2"; + #address-cells =3D <1>; + #size-cells =3D <1>; + ranges =3D <0 0 0x11e10000 0x1700>; + status =3D "disabled"; + + u2port0: usb-phy@0 { + reg =3D <0x0 0x700>; + clocks =3D <&topckgen CLK_TOP_DA_U2_REFSEL>, + <&topckgen CLK_TOP_DA_U2_CK_1P_SEL>; + clock-names =3D "ref", "da_ref"; + #phy-cells =3D <1>; + }; + + u3port0: usb-phy@700 { + reg =3D <0x700 0x900>; + clocks =3D <&topckgen CLK_TOP_USB3_PHY_SEL>; + clock-names =3D "ref"; + #phy-cells =3D <1>; + }; + + u2port1: usb-phy@1000 { + reg =3D <0x1000 0x700>; + clocks =3D <&topckgen CLK_TOP_DA_U2_REFSEL>, + <&topckgen CLK_TOP_DA_U2_CK_1P_SEL>; + clock-names =3D "ref", "da_ref"; + #phy-cells =3D <1>; + }; + }; + ethsys: syscon@15000000 { #address-cells =3D <1>; #size-cells =3D <1>; diff --git a/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts b/arch/arm64/boot= /dts/mediatek/mt7986b-rfb.dts index 243760cd3011..188ce82ae56c 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts +++ b/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts @@ -167,10 +167,18 @@ &spi1 { status =3D "okay"; }; =20 +&ssusb { + status =3D "okay"; +}; + &uart0 { status =3D "okay"; }; =20 +&usb_phy { + status =3D "okay"; +}; + &wifi { status =3D "okay"; pinctrl-names =3D "default", "dbdc"; --=20 2.34.1 From nobody Thu Nov 14 07:20:43 2024 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD76CC5479D for ; Fri, 6 Jan 2023 15:29:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235658AbjAFP3g (ORCPT ); Fri, 6 Jan 2023 10:29:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235400AbjAFP3I (ORCPT ); Fri, 6 Jan 2023 10:29:08 -0500 Received: from mxout1.routing.net (mxout1.routing.net [IPv6:2a03:2900:1:a::a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA69D8B770; Fri, 6 Jan 2023 07:29:03 -0800 (PST) Received: from mxbulk.masterlogin.de (unknown [192.168.10.85]) by mxout1.routing.net (Postfix) with ESMTP id 161394043F; Fri, 6 Jan 2023 15:29:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1673018942; 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=xI7XT67CqYlVW3+/XRkZxk2brg5+ceAOUtpu7n5qfPw=; b=Fj+y/9wVUc6PO8ycGF8fokZUvCbRG7DSHgX43NNLMsXgLfaCKNSvTMsKUb2wr//V3xEM2M vvy6hOsUe0quXOzlvujcRVHtE8x4Mki7wplgJPAKQtnA5aZmC66gLTc8d7guyMD0snmLcK i7P1NLTuNRIf5V6JYYsIa1/lDJ0RCYU= Received: from frank-G5.. (fttx-pool-217.61.159.6.bambit.de [217.61.159.6]) by mxbulk.masterlogin.de (Postfix) with ESMTPSA id 85A011226D4; Fri, 6 Jan 2023 15:29:00 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , Chunfeng Yun , Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sam Shih Subject: [PATCH v9 3/5] arm64: dts: mt7986: add mmc related device nodes Date: Fri, 6 Jan 2023 16:28:43 +0100 Message-Id: <20230106152845.88717-4-linux@fw-web.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230106152845.88717-1-linux@fw-web.de> References: <20230106152845.88717-1-linux@fw-web.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Sam Shih This patch adds mmc support for MT7986. Signed-off-by: Sam Shih Signed-off-by: Frank Wunderlich --- v2: - update mmc-node because clocks changed v3: - fix pullups/pulldowns for mt7986a-rfb to have generic bias-pull-* v6: - add 3v3 regulator in mt7986a-rfb (was in usb patch before) - dropped AngeloGioacchino RB because of this change --- arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts | 96 ++++++++++++++++++++ arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 15 +++ 2 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 58089fcf4d16..c7a2ac764a30 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts +++ b/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts @@ -5,6 +5,8 @@ */ =20 /dts-v1/; +#include + #include "mt7986a.dtsi" =20 / { @@ -23,6 +25,24 @@ memory@40000000 { device_type =3D "memory"; reg =3D <0 0x40000000 0 0x40000000>; }; + + reg_1p8v: regulator-1p8v { + compatible =3D "regulator-fixed"; + regulator-name =3D "fixed-1.8V"; + regulator-min-microvolt =3D <1800000>; + regulator-max-microvolt =3D <1800000>; + regulator-boot-on; + regulator-always-on; + }; + + reg_3p3v: regulator-3p3v { + compatible =3D "regulator-fixed"; + regulator-name =3D "fixed-3.3V"; + regulator-min-microvolt =3D <3300000>; + regulator-max-microvolt =3D <3300000>; + regulator-boot-on; + regulator-always-on; + }; }; =20 &crypto { @@ -58,7 +78,83 @@ switch: switch@0 { }; }; =20 +&mmc0 { + pinctrl-names =3D "default", "state_uhs"; + pinctrl-0 =3D <&mmc0_pins_default>; + pinctrl-1 =3D <&mmc0_pins_uhs>; + bus-width =3D <8>; + max-frequency =3D <200000000>; + cap-mmc-highspeed; + mmc-hs200-1_8v; + mmc-hs400-1_8v; + hs400-ds-delay =3D <0x14014>; + vmmc-supply =3D <®_3p3v>; + vqmmc-supply =3D <®_1p8v>; + non-removable; + no-sd; + no-sdio; + status =3D "okay"; +}; + &pio { + mmc0_pins_default: mmc0-pins { + mux { + function =3D "emmc"; + groups =3D "emmc_51"; + }; + conf-cmd-dat { + pins =3D "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2", + "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5", + "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD"; + input-enable; + drive-strength =3D <4>; + bias-pull-up =3D ; /* pull-up 10K */ + }; + conf-clk { + pins =3D "EMMC_CK"; + drive-strength =3D <6>; + bias-pull-down =3D ; /* pull-down 50K */ + }; + conf-ds { + pins =3D "EMMC_DSL"; + bias-pull-down =3D ; /* pull-down 50K */ + }; + conf-rst { + pins =3D "EMMC_RSTB"; + drive-strength =3D <4>; + bias-pull-up =3D ; /* pull-up 10K */ + }; + }; + + mmc0_pins_uhs: mmc0-uhs-pins { + mux { + function =3D "emmc"; + groups =3D "emmc_51"; + }; + conf-cmd-dat { + pins =3D "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2", + "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5", + "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD"; + input-enable; + drive-strength =3D <4>; + bias-pull-up =3D ; /* pull-up 10K */ + }; + conf-clk { + pins =3D "EMMC_CK"; + drive-strength =3D <6>; + bias-pull-down =3D ; /* pull-down 50K */ + }; + conf-ds { + pins =3D "EMMC_DSL"; + bias-pull-down =3D ; /* pull-down 50K */ + }; + conf-rst { + pins =3D "EMMC_RSTB"; + drive-strength =3D <4>; + bias-pull-up =3D ; /* pull-up 10K */ + }; + }; + spi_flash_pins: spi-flash-pins { mux { function =3D "spi"; diff --git a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/arch/arm64/boot/dt= s/mediatek/mt7986a.dtsi index 9ff2968152ae..9c552442c02d 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi @@ -346,6 +346,21 @@ ssusb: usb@11200000 { status =3D "disabled"; }; =20 + mmc0: mmc@11230000 { + compatible =3D "mediatek,mt7986-mmc"; + reg =3D <0 0x11230000 0 0x1000>, + <0 0x11c20000 0 0x1000>; + interrupts =3D ; + clocks =3D <&topckgen CLK_TOP_EMMC_416M_SEL>, + <&infracfg CLK_INFRA_MSDC_HCK_CK>, + <&infracfg CLK_INFRA_MSDC_CK>, + <&infracfg CLK_INFRA_MSDC_133M_CK>, + <&infracfg CLK_INFRA_MSDC_66M_CK>; + clock-names =3D "source", "hclk", "source_cg", "bus_clk", + "sys_cg"; + status =3D "disabled"; + }; + usb_phy: t-phy@11e10000 { compatible =3D "mediatek,mt7986-tphy", "mediatek,generic-tphy-v2"; --=20 2.34.1 From nobody Thu Nov 14 07:20:43 2024 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4177C54EBE for ; Fri, 6 Jan 2023 15:29:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235405AbjAFP33 (ORCPT ); Fri, 6 Jan 2023 10:29:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235373AbjAFP3I (ORCPT ); Fri, 6 Jan 2023 10:29:08 -0500 Received: from mxout3.routing.net (mxout3.routing.net [IPv6:2a03:2900:1:a::8]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B95E48B75F; Fri, 6 Jan 2023 07:29:03 -0800 (PST) Received: from mxbulk.masterlogin.de (unknown [192.168.10.85]) by mxout3.routing.net (Postfix) with ESMTP id 511A8604B0; Fri, 6 Jan 2023 15:29:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1673018942; 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=qZpHonfbzlzAQl4c8fqWybB39WUbxdDEx0PL+y5noqL1dZXCDwx1QCrPAE1gcVQZMsY4Xc zMyK+8jzsNKLJffwRqMWZ8HSYu/CsNcF5ZgUprphyga9GftZ/r5sBtm9RY2OtQaEH1Le+d zaKKiTRCUMEhUgHHTqTmoHxt+CYNmHE= Received: from frank-G5.. (fttx-pool-217.61.159.6.bambit.de [217.61.159.6]) by mxbulk.masterlogin.de (Postfix) with ESMTPSA id 1B26412272E; Fri, 6 Jan 2023 15:29:02 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , Chunfeng Yun , Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sam Shih , Jieyy Yang , AngeloGioacchino Del Regno Subject: [PATCH v9 4/5] arm64: dts: mt7986: add pcie related device nodes Date: Fri, 6 Jan 2023 16:28:44 +0100 Message-Id: <20230106152845.88717-5-linux@fw-web.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230106152845.88717-1-linux@fw-web.de> References: <20230106152845.88717-1-linux@fw-web.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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=3D690172 --- 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 =3D "default"; + pinctrl-0 =3D <&pcie_pins>; + status =3D "okay"; +}; + +&pcie_phy { status =3D "okay"; }; =20 @@ -155,6 +164,13 @@ conf-rst { }; }; =20 + pcie_pins: pcie-pins { + mux { + function =3D "pcie"; + groups =3D "pcie_clk", "pcie_wake", "pcie_pereset"; + }; + }; + spi_flash_pins: spi-flash-pins { mux { function =3D "spi"; diff --git a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/arch/arm64/boot/dt= s/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 =20 / { compatible =3D "mediatek,mt7986a"; @@ -361,6 +362,57 @@ mmc0: mmc@11230000 { status =3D "disabled"; }; =20 + pcie: pcie@11280000 { + compatible =3D "mediatek,mt7986-pcie", + "mediatek,mt8192-pcie"; + device_type =3D "pci"; + #address-cells =3D <3>; + #size-cells =3D <2>; + reg =3D <0x00 0x11280000 0x00 0x4000>; + reg-names =3D "pcie-mac"; + interrupts =3D ; + bus-range =3D <0x00 0xff>; + ranges =3D <0x82000000 0x00 0x20000000 0x00 + 0x20000000 0x00 0x10000000>; + clocks =3D <&infracfg CLK_INFRA_IPCIE_PIPE_CK>, + <&infracfg CLK_INFRA_IPCIE_CK>, + <&infracfg CLK_INFRA_IPCIER_CK>, + <&infracfg CLK_INFRA_IPCIEB_CK>; + clock-names =3D "pl_250m", "tl_26m", "peri_26m", "top_133m"; + status =3D "disabled"; + + phys =3D <&pcie_port PHY_TYPE_PCIE>; + phy-names =3D "pcie-phy"; + + #interrupt-cells =3D <1>; + interrupt-map-mask =3D <0 0 0 0x7>; + interrupt-map =3D <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 =3D <0>; + #interrupt-cells =3D <1>; + interrupt-controller; + }; + }; + + pcie_phy: t-phy@11c00000 { + compatible =3D "mediatek,mt7986-tphy", + "mediatek,generic-tphy-v2"; + #address-cells =3D <2>; + #size-cells =3D <2>; + ranges; + status =3D "disabled"; + + pcie_port: pcie-phy@11c00000 { + reg =3D <0 0x11c00000 0 0x20000>; + clocks =3D <&clk40m>; + clock-names =3D "ref"; + #phy-cells =3D <1>; + }; + }; + usb_phy: t-phy@11e10000 { compatible =3D "mediatek,mt7986-tphy", "mediatek,generic-tphy-v2"; --=20 2.34.1 From nobody Thu Nov 14 07:20:43 2024 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2475FC3DA7A for ; Fri, 6 Jan 2023 15:29:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235383AbjAFP3o (ORCPT ); Fri, 6 Jan 2023 10:29:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235411AbjAFP3J (ORCPT ); Fri, 6 Jan 2023 10:29:09 -0500 Received: from mxout4.routing.net (mxout4.routing.net [IPv6:2a03:2900:1:a::9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7444E8B77E; Fri, 6 Jan 2023 07:29:04 -0800 (PST) Received: from mxbulk.masterlogin.de (unknown [192.168.10.85]) by mxout4.routing.net (Postfix) with ESMTP id C54B91008D9; Fri, 6 Jan 2023 15:29:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1673018942; 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=DfLtE1TdUI5LkOjLCpOwgKvMkd7PVhG+uullUZZAQWw=; b=pT4vxOodEWpSp0pkr18yrAAmawM1d9pZdrvkuebUxmgG6MDpiW8Tkp55+RcbplGa839YKi 7EUlYPzWlg4W1WmFBd2+OJqxpZjR+vPODQqO26wPThZkiNqXLJDdRgVvmMkmAIrHdZaPeK fVflU18wm0D3cEDZfIBk3RVT9lED34Y= Received: from frank-G5.. (fttx-pool-217.61.159.6.bambit.de [217.61.159.6]) by mxbulk.masterlogin.de (Postfix) with ESMTPSA id 583AE1226D4; Fri, 6 Jan 2023 15:29:02 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , Chunfeng Yun , Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v9 5/5] arm64: dts: mt7986: add Bananapi R3 Date: Fri, 6 Jan 2023 16:28:45 +0100 Message-Id: <20230106152845.88717-6-linux@fw-web.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230106152845.88717-1-linux@fw-web.de> References: <20230106152845.88717-1-linux@fw-web.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Frank Wunderlich Add support for Bananapi R3 SBC. - SD/eMMC support (switching first 4 bits of data-bus with sw6/D) - SPI-NAND/NOR support (switched CS by sw5/C) - all rj45 ports and both SFP working (eth1/lan4) - all USB-Ports + SIM-Slot tested - i2c and all uarts tested - wifi tested (with eeprom calibration data) The device can boot from all 4 storage options. Both, SPI and MMC, can be switched using hardware switches on the board, see https://wiki.banana-pi.org/Banana_Pi_BPI-R3#Jumper_setting Signed-off-by: Frank Wunderlich --- changes: v9: - drop model string override in sd-dtso v8: - drop model string override in emmc-dtso - drop cs-gpios from spi-nodes - add interrupt-settings for mt7531 switch v7: - squashed overlay-patch and converted sd/emmc dts to overlay too - moved mmc-regulators to base dts - changed common dtsi to (base dts) and overlay extension to dtso v6: - drop usb 5v regulator from bpi-r3 based on chunfengs response it is only needed if regulator is switched (like for otg), usb works without it. v4: - add PCIe nodes - fix sfp-properties of sfp-1 (need to be plural) thx to Denis Odintsov for this v3: - rename factory-key to reset-key - add dcin regulator and add it as input for 3v3 (with renaming) - remove memory-node - dropped wifi eeprom (calibration) data - move mmc0 pinctrl to common dtsi and drop sdcard comment - change mmc pull-up/down to have generic bias-pull* v2: - remove pcie to be added later (discussion about clocks) - some fixes based on suggestions on ML - add key suffix like it's done in mt7622-bpi-r64 devicetree - add dash in sfp node names - use reg as unit for switch-node - drop "-3-4" suffix from i2c-pins node name - fix order in Makefile --- arch/arm64/boot/dts/mediatek/Makefile | 5 + .../mt7986a-bananapi-bpi-r3-emmc.dtso | 29 ++ .../mt7986a-bananapi-bpi-r3-nand.dtso | 55 +++ .../mediatek/mt7986a-bananapi-bpi-r3-nor.dtso | 68 +++ .../mediatek/mt7986a-bananapi-bpi-r3-sd.dtso | 23 + .../dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 450 ++++++++++++++++++ 6 files changed, 630 insertions(+) create mode 100644 arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-em= mc.dtso create mode 100644 arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-na= nd.dtso create mode 100644 arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-no= r.dtso create mode 100644 arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-sd= .dtso create mode 100644 arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/me= diatek/Makefile index 813e735c5b96..d5cd7b3e09cf 100644 --- a/arch/arm64/boot/dts/mediatek/Makefile +++ b/arch/arm64/boot/dts/mediatek/Makefile @@ -8,6 +8,11 @@ dtb-$(CONFIG_ARCH_MEDIATEK) +=3D mt6797-evb.dtb dtb-$(CONFIG_ARCH_MEDIATEK) +=3D mt6797-x20-dev.dtb dtb-$(CONFIG_ARCH_MEDIATEK) +=3D mt7622-rfb1.dtb dtb-$(CONFIG_ARCH_MEDIATEK) +=3D mt7622-bananapi-bpi-r64.dtb +dtb-$(CONFIG_ARCH_MEDIATEK) +=3D mt7986a-bananapi-bpi-r3.dtb +dtb-$(CONFIG_ARCH_MEDIATEK) +=3D mt7986a-bananapi-bpi-r3-emmc.dtbo +dtb-$(CONFIG_ARCH_MEDIATEK) +=3D mt7986a-bananapi-bpi-r3-nand.dtbo +dtb-$(CONFIG_ARCH_MEDIATEK) +=3D mt7986a-bananapi-bpi-r3-nor.dtbo +dtb-$(CONFIG_ARCH_MEDIATEK) +=3D mt7986a-bananapi-bpi-r3-sd.dtbo dtb-$(CONFIG_ARCH_MEDIATEK) +=3D mt7986a-rfb.dtb dtb-$(CONFIG_ARCH_MEDIATEK) +=3D mt7986b-rfb.dtb dtb-$(CONFIG_ARCH_MEDIATEK) +=3D mt8167-pumpkin.dtb diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-emmc.dtso= b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-emmc.dtso new file mode 100644 index 000000000000..779dc6782bb1 --- /dev/null +++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-emmc.dtso @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright (C) 2021 MediaTek Inc. + * Author: Sam.Shih + */ + +/dts-v1/; +/plugin/; + +/ { + compatible =3D "bananapi,bpi-r3", "mediatek,mt7986a"; + + fragment@0 { + target-path =3D "/soc/mmc@11230000"; + __overlay__ { + bus-width =3D <8>; + max-frequency =3D <200000000>; + cap-mmc-highspeed; + mmc-hs200-1_8v; + mmc-hs400-1_8v; + hs400-ds-delay =3D <0x14014>; + non-removable; + no-sd; + no-sdio; + status =3D "okay"; + }; + }; +}; + diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-nand.dtso= b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-nand.dtso new file mode 100644 index 000000000000..15ee8c568f3c --- /dev/null +++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-nand.dtso @@ -0,0 +1,55 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */ +/* + * Authors: Daniel Golle + * Frank Wunderlich + */ + +/dts-v1/; +/plugin/; + +/ { + compatible =3D "bananapi,bpi-r3", "mediatek,mt7986a"; + + fragment@0 { + target-path =3D "/soc/spi@1100a000"; + __overlay__ { + #address-cells =3D <1>; + #size-cells =3D <0>; + spi_nand: spi_nand@0 { + compatible =3D "spi-nand"; + reg =3D <0>; + spi-max-frequency =3D <10000000>; + spi-tx-buswidth =3D <4>; + spi-rx-buswidth =3D <4>; + + partitions { + compatible =3D "fixed-partitions"; + #address-cells =3D <1>; + #size-cells =3D <1>; + + partition@0 { + label =3D "bl2"; + reg =3D <0x0 0x80000>; + read-only; + }; + + partition@80000 { + label =3D "reserved"; + reg =3D <0x80000 0x300000>; + }; + + partition@380000 { + label =3D "fip"; + reg =3D <0x380000 0x200000>; + read-only; + }; + + partition@580000 { + label =3D "ubi"; + reg =3D <0x580000 0x7a80000>; + }; + }; + }; + }; + }; +}; diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-nor.dtso = b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-nor.dtso new file mode 100644 index 000000000000..84aa229e80f3 --- /dev/null +++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-nor.dtso @@ -0,0 +1,68 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */ +/* + * Authors: Daniel Golle + * Frank Wunderlich + */ + +/dts-v1/; +/plugin/; + +/ { + compatible =3D "bananapi,bpi-r3", "mediatek,mt7986a"; + + fragment@0 { + target-path =3D "/soc/spi@1100a000"; + __overlay__ { + #address-cells =3D <1>; + #size-cells =3D <0>; + flash@0 { + compatible =3D "jedec,spi-nor"; + reg =3D <0>; + spi-max-frequency =3D <10000000>; + + partitions { + compatible =3D "fixed-partitions"; + #address-cells =3D <1>; + #size-cells =3D <1>; + + partition@0 { + label =3D "bl2"; + reg =3D <0x0 0x20000>; + read-only; + }; + + partition@20000 { + label =3D "reserved"; + reg =3D <0x20000 0x20000>; + }; + + partition@40000 { + label =3D "u-boot-env"; + reg =3D <0x40000 0x40000>; + }; + + partition@80000 { + label =3D "reserved2"; + reg =3D <0x80000 0x80000>; + }; + + partition@100000 { + label =3D "fip"; + reg =3D <0x100000 0x80000>; + read-only; + }; + + partition@180000 { + label =3D "recovery"; + reg =3D <0x180000 0xa80000>; + }; + + partition@c00000 { + label =3D "fit"; + reg =3D <0xc00000 0x1400000>; + }; + }; + }; + }; + }; +}; diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dtso b= /arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dtso new file mode 100644 index 000000000000..f623bce075ce --- /dev/null +++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dtso @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright (C) 2021 MediaTek Inc. + * Author: Sam.Shih + */ + +/dts-v1/; +/plugin/; + +/ { + compatible =3D "bananapi,bpi-r3", "mediatek,mt7986a"; + + fragment@0 { + target-path =3D "/soc/mmc@11230000"; + __overlay__ { + bus-width =3D <4>; + max-frequency =3D <52000000>; + cap-sd-highspeed; + status =3D "okay"; + }; + }; +}; + diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts b/arc= h/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts new file mode 100644 index 000000000000..33bd6febc160 --- /dev/null +++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts @@ -0,0 +1,450 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright (C) 2021 MediaTek Inc. + * Authors: Sam.Shih + * Frank Wunderlich + * Daniel Golle + */ + +/dts-v1/; +#include +#include +#include +#include + +#include "mt7986a.dtsi" + +/ { + model =3D "Bananapi BPI-R3"; + compatible =3D "bananapi,bpi-r3", "mediatek,mt7986a"; + + aliases { + serial0 =3D &uart0; + ethernet0 =3D &gmac0; + ethernet1 =3D &gmac1; + }; + + chosen { + stdout-path =3D "serial0:115200n8"; + }; + + dcin: regulator-12vd { + compatible =3D "regulator-fixed"; + regulator-name =3D "12vd"; + regulator-min-microvolt =3D <12000000>; + regulator-max-microvolt =3D <12000000>; + regulator-boot-on; + regulator-always-on; + }; + + gpio-keys { + compatible =3D "gpio-keys"; + + reset-key { + label =3D "reset"; + linux,code =3D ; + gpios =3D <&pio 9 GPIO_ACTIVE_LOW>; + }; + + wps-key { + label =3D "wps"; + linux,code =3D ; + gpios =3D <&pio 10 GPIO_ACTIVE_LOW>; + }; + }; + + /* i2c of the left SFP cage (wan) */ + i2c_sfp1: i2c-gpio-0 { + compatible =3D "i2c-gpio"; + sda-gpios =3D <&pio 16 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + scl-gpios =3D <&pio 17 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + i2c-gpio,delay-us =3D <2>; + #address-cells =3D <1>; + #size-cells =3D <0>; + }; + + /* i2c of the right SFP cage (lan) */ + i2c_sfp2: i2c-gpio-1 { + compatible =3D "i2c-gpio"; + sda-gpios =3D <&pio 18 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + scl-gpios =3D <&pio 19 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + i2c-gpio,delay-us =3D <2>; + #address-cells =3D <1>; + #size-cells =3D <0>; + }; + + leds { + compatible =3D "gpio-leds"; + + green_led: led-0 { + color =3D ; + function =3D LED_FUNCTION_POWER; + gpios =3D <&pio 69 GPIO_ACTIVE_HIGH>; + default-state =3D "on"; + }; + + blue_led: led-1 { + color =3D ; + function =3D LED_FUNCTION_STATUS; + gpios =3D <&pio 86 GPIO_ACTIVE_HIGH>; + default-state =3D "off"; + }; + }; + + reg_1p8v: regulator-1p8v { + compatible =3D "regulator-fixed"; + regulator-name =3D "1.8vd"; + regulator-min-microvolt =3D <1800000>; + regulator-max-microvolt =3D <1800000>; + regulator-boot-on; + regulator-always-on; + vin-supply =3D <&dcin>; + }; + + reg_3p3v: regulator-3p3v { + compatible =3D "regulator-fixed"; + regulator-name =3D "3.3vd"; + regulator-min-microvolt =3D <3300000>; + regulator-max-microvolt =3D <3300000>; + regulator-boot-on; + regulator-always-on; + vin-supply =3D <&dcin>; + }; + + /* left SFP cage (wan) */ + sfp1: sfp-1 { + compatible =3D "sff,sfp"; + i2c-bus =3D <&i2c_sfp1>; + los-gpios =3D <&pio 46 GPIO_ACTIVE_HIGH>; + mod-def0-gpios =3D <&pio 49 GPIO_ACTIVE_LOW>; + tx-disable-gpios =3D <&pio 20 GPIO_ACTIVE_HIGH>; + tx-fault-gpios =3D <&pio 7 GPIO_ACTIVE_HIGH>; + }; + + /* right SFP cage (lan) */ + sfp2: sfp-2 { + compatible =3D "sff,sfp"; + i2c-bus =3D <&i2c_sfp2>; + los-gpios =3D <&pio 31 GPIO_ACTIVE_HIGH>; + mod-def0-gpios =3D <&pio 47 GPIO_ACTIVE_LOW>; + tx-disable-gpios =3D <&pio 15 GPIO_ACTIVE_HIGH>; + tx-fault-gpios =3D <&pio 48 GPIO_ACTIVE_HIGH>; + }; +}; + +&crypto { + status =3D "okay"; +}; + +ð { + status =3D "okay"; + + gmac0: mac@0 { + compatible =3D "mediatek,eth-mac"; + reg =3D <0>; + phy-mode =3D "2500base-x"; + + fixed-link { + speed =3D <2500>; + full-duplex; + pause; + }; + }; + + gmac1: mac@1 { + compatible =3D "mediatek,eth-mac"; + reg =3D <1>; + phy-mode =3D "2500base-x"; + sfp =3D <&sfp1>; + managed =3D "in-band-status"; + }; + + mdio: mdio-bus { + #address-cells =3D <1>; + #size-cells =3D <0>; + }; +}; + +&mdio { + switch: switch@31 { + compatible =3D "mediatek,mt7531"; + reg =3D <31>; + interrupt-controller; + #interrupt-cells =3D <1>; + interrupt-parent =3D <&pio>; + interrupts =3D <66 IRQ_TYPE_LEVEL_HIGH>; + reset-gpios =3D <&pio 5 GPIO_ACTIVE_HIGH>; + }; +}; + +&mmc0 { + pinctrl-names =3D "default", "state_uhs"; + pinctrl-0 =3D <&mmc0_pins_default>; + pinctrl-1 =3D <&mmc0_pins_uhs>; + vmmc-supply =3D <®_3p3v>; + vqmmc-supply =3D <®_1p8v>; +}; + +&i2c0 { + pinctrl-names =3D "default"; + pinctrl-0 =3D <&i2c_pins>; + status =3D "okay"; +}; + +&pcie { + pinctrl-names =3D "default"; + pinctrl-0 =3D <&pcie_pins>; + status =3D "okay"; +}; + +&pcie_phy { + status =3D "okay"; +}; + +&pio { + i2c_pins: i2c-pins { + mux { + function =3D "i2c"; + groups =3D "i2c"; + }; + }; + + mmc0_pins_default: mmc0-pins { + mux { + function =3D "emmc"; + groups =3D "emmc_51"; + }; + conf-cmd-dat { + pins =3D "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2", + "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5", + "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD"; + input-enable; + drive-strength =3D <4>; + bias-pull-up =3D ; /* pull-up 10K */ + }; + conf-clk { + pins =3D "EMMC_CK"; + drive-strength =3D <6>; + bias-pull-down =3D ; /* pull-down 50K */ + }; + conf-ds { + pins =3D "EMMC_DSL"; + bias-pull-down =3D ; /* pull-down 50K */ + }; + conf-rst { + pins =3D "EMMC_RSTB"; + drive-strength =3D <4>; + bias-pull-up =3D ; /* pull-up 10K */ + }; + }; + + mmc0_pins_uhs: mmc0-uhs-pins { + mux { + function =3D "emmc"; + groups =3D "emmc_51"; + }; + conf-cmd-dat { + pins =3D "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2", + "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5", + "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD"; + input-enable; + drive-strength =3D <4>; + bias-pull-up =3D ; /* pull-up 10K */ + }; + conf-clk { + pins =3D "EMMC_CK"; + drive-strength =3D <6>; + bias-pull-down =3D ; /* pull-down 50K */ + }; + conf-ds { + pins =3D "EMMC_DSL"; + bias-pull-down =3D ; /* pull-down 50K */ + }; + conf-rst { + pins =3D "EMMC_RSTB"; + drive-strength =3D <4>; + bias-pull-up =3D ; /* pull-up 10K */ + }; + }; + + pcie_pins: pcie-pins { + mux { + function =3D "pcie"; + groups =3D "pcie_clk", "pcie_pereset"; + }; + }; + + spi_flash_pins: spi-flash-pins { + mux { + function =3D "spi"; + groups =3D "spi0", "spi0_wp_hold"; + }; + }; + + spic_pins: spic-pins { + mux { + function =3D "spi"; + groups =3D "spi1_0"; + }; + }; + + uart1_pins: uart1-pins { + mux { + function =3D "uart"; + groups =3D "uart1_rx_tx"; + }; + }; + + uart2_pins: uart2-pins { + mux { + function =3D "uart"; + groups =3D "uart2_0_rx_tx"; + }; + }; + + wf_2g_5g_pins: wf-2g-5g-pins { + mux { + function =3D "wifi"; + groups =3D "wf_2g", "wf_5g"; + }; + conf { + pins =3D "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4", + "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6", + "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10", + "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1", + "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0", + "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8", + "WF1_TOP_CLK", "WF1_TOP_DATA"; + drive-strength =3D <4>; + }; + }; + + wf_dbdc_pins: wf-dbdc-pins { + mux { + function =3D "wifi"; + groups =3D "wf_dbdc"; + }; + conf { + pins =3D "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4", + "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6", + "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10", + "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1", + "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0", + "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8", + "WF1_TOP_CLK", "WF1_TOP_DATA"; + drive-strength =3D <4>; + }; + }; + + wf_led_pins: wf-led-pins { + mux { + function =3D "led"; + groups =3D "wifi_led"; + }; + }; +}; + +&spi0 { + pinctrl-names =3D "default"; + pinctrl-0 =3D <&spi_flash_pins>; + status =3D "okay"; +}; + +&spi1 { + pinctrl-names =3D "default"; + pinctrl-0 =3D <&spic_pins>; + status =3D "okay"; +}; + +&ssusb { + status =3D "okay"; +}; + +&switch { + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + port@0 { + reg =3D <0>; + label =3D "wan"; + }; + + port@1 { + reg =3D <1>; + label =3D "lan0"; + }; + + port@2 { + reg =3D <2>; + label =3D "lan1"; + }; + + port@3 { + reg =3D <3>; + label =3D "lan2"; + }; + + port@4 { + reg =3D <4>; + label =3D "lan3"; + }; + + port5: port@5 { + reg =3D <5>; + label =3D "lan4"; + phy-mode =3D "2500base-x"; + sfp =3D <&sfp2>; + managed =3D "in-band-status"; + }; + + port@6 { + reg =3D <6>; + label =3D "cpu"; + ethernet =3D <&gmac0>; + phy-mode =3D "2500base-x"; + + fixed-link { + speed =3D <2500>; + full-duplex; + pause; + }; + }; + }; +}; + +&trng { + status =3D "okay"; +}; + +&uart0 { + status =3D "okay"; +}; + +&uart1 { + pinctrl-names =3D "default"; + pinctrl-0 =3D <&uart1_pins>; + status =3D "okay"; +}; + +&uart2 { + pinctrl-names =3D "default"; + pinctrl-0 =3D <&uart2_pins>; + status =3D "okay"; +}; + +&usb_phy { + status =3D "okay"; +}; + +&watchdog { + status =3D "okay"; +}; + +&wifi { + status =3D "okay"; + pinctrl-names =3D "default", "dbdc"; + pinctrl-0 =3D <&wf_2g_5g_pins>, <&wf_led_pins>; + pinctrl-1 =3D <&wf_dbdc_pins>, <&wf_led_pins>; +}; + --=20 2.34.1