From patchwork Mon Oct 17 09:58:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?QmlhbyBIdWFuZyAo6buE5b2qKQ==?= X-Patchwork-Id: 3362 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1363060wrs; Mon, 17 Oct 2022 03:08:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4TkSnUHc2sWLscE7nVO+iScAxP0JbjahHs/GJIwKtxK/c8BjuHMgMg3yVZUZy1O2q7RB/3 X-Received: by 2002:a05:6402:5206:b0:45d:88f:4f00 with SMTP id s6-20020a056402520600b0045d088f4f00mr9652494edd.130.1666001297394; Mon, 17 Oct 2022 03:08:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666001297; cv=none; d=google.com; s=arc-20160816; b=kl+zxX1lhfbbup3DbdOQYPSivb19OZ/u04vcnI7hNHb13Xpd7SCdmMmEyXVShjJf00 PhG4rkBq1t54P/a8Ih55bB/r2LjlizTMjMeT0xAU+hO1E/0S4X1LYyq+JxAJ0cHA7aeZ u1Hbrq3s9v1QLK0JGS/Sf1v6pd8raOILa3hr+UGNYyABBj3rrg9eSPWezjurprDRpsyt AnwXNH0OL5Prd3t152g9nkRGnX3AJud4tWRmqP7w+atmDAGw56yZgLnJjJwbnxAmOC1v 4q0OTDKbaDkHxs0yHN7iRXm0HqAC/b7NrQohmDmGjTL77DXhy5jA4T1ZIdBJZln6Vxig 57rg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=XnXmSygOmRiR/cJ+1yzj2cNgqZVXjArj5R+iOu/seyE=; b=TYg0m86AFxiLARW7x/n3pjNjUvvSjEpLbWRlv7T7op+bPrcV8E7h1E//uZk0UhSrDF PY6KiKbJJeFZMHbAAMYwI6WhWj4H6tZ4aNfKYSw20uIuO719+WDan032vhSUE5Hy+SdL QNoprPGcZ0kx3TZ8rfzLPEU81Oo6ISnCMpyUg3cEbcGgsDIu4fhnfCU2jXeEiTlyEg5k 7aG6K8CcmLHXjFdJFU42TyvyCN/U74Qfo2D8zUUFZ+p3zSzD/hMR6FXQNrQJldqcXmTW FgFTQKDbuxwjqmE3DMuGsnUKuOXlT4HbMSZm4QitspqpS7jFqhP25l09PKzw1gykoZA7 6/ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=U1ShO4K+; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y18-20020a056402359200b0045d06ea5596si9925051edc.26.2022.10.17.03.07.52; Mon, 17 Oct 2022 03:08:17 -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=@mediatek.com header.s=dk header.b=U1ShO4K+; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230381AbiJQJ6x (ORCPT + 99 others); Mon, 17 Oct 2022 05:58:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229895AbiJQJ6u (ORCPT ); Mon, 17 Oct 2022 05:58:50 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23E3E5D709; Mon, 17 Oct 2022 02:58:46 -0700 (PDT) X-UUID: 7fed56010da44bb0a6c2d84ef687af6f-20221017 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=XnXmSygOmRiR/cJ+1yzj2cNgqZVXjArj5R+iOu/seyE=; b=U1ShO4K+tvhivTqdDduVOaA1FwG/w/57LduTXIa0u0DZ/f3sdZqEXQMQ4F3xaUAL2N18/qV5YSpRY7shOvJOIGQ6rgC7kxNji4jWXtbIREpNrHMjnEslhfRwCXUAMAUEP0iBgzLzQlq5c82zk2/kzzwI9/JUgxDYgaK5FVi/AYo=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.11,REQID:4632b373-b53a-4053-bc26-f56936bc0003,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:39a5ff1,CLOUDID:0c6605a4-ebb2-41a8-a87c-97702aaf2e20,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: 7fed56010da44bb0a6c2d84ef687af6f-20221017 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 229668657; Mon, 17 Oct 2022 17:58:40 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Mon, 17 Oct 2022 17:58:39 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Mon, 17 Oct 2022 17:58:37 +0800 From: Biao Huang To: Rob Herring , Krzysztof Kozlowski , Matthias Brugger CC: , , , , "Biao Huang" , Subject: [PATCH] arm64: dts: mt8195: Add Ethernet controller Date: Mon, 17 Oct 2022 17:58:34 +0800 Message-ID: <20221017095834.7675-1-biao.huang@mediatek.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY 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?1746928976263965778?= X-GMAIL-MSGID: =?utf-8?q?1746928976263965778?= Add Ethernet controller node for mt8195. Signed-off-by: Biao Huang --- arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 88 ++++++++++++++++++++ arch/arm64/boot/dts/mediatek/mt8195.dtsi | 87 +++++++++++++++++++ 2 files changed, 175 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts index 4fbd99eb496a..02e04f82a4ae 100644 --- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts +++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts @@ -258,6 +258,72 @@ &mt6359_vsram_others_ldo_reg { }; &pio { + eth_default: eth_default { + txd_pins { + pinmux = , + , + , + ; + drive-strength = ; + }; + cc_pins { + pinmux = , + , + , + ; + drive-strength = ; + }; + rxd_pins { + pinmux = , + , + , + ; + }; + mdio_pins { + pinmux = , + ; + input-enable; + }; + power_pins { + pinmux = , + ; + output-high; + }; + }; + + eth_sleep: eth_sleep { + txd_pins { + pinmux = , + , + , + ; + }; + cc_pins { + pinmux = , + , + , + ; + }; + rxd_pins { + pinmux = , + , + , + ; + }; + mdio_pins { + pinmux = , + ; + input-disable; + bias-disable; + }; + power_pins { + pinmux = , + ; + input-disable; + bias-disable; + }; + }; + gpio_keys_pins: gpio-keys-pins { pins { pinmux = ; @@ -434,6 +500,28 @@ &xhci0 { status = "okay"; }; +ð { + phy-mode ="rgmii-rxid"; + phy-handle = <ð_phy0>; + snps,reset-gpio = <&pio 93 GPIO_ACTIVE_HIGH>; + snps,reset-delays-us = <0 10000 10000>; + mediatek,tx-delay-ps = <2030>; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <ð_default>; + pinctrl-1 = <ð_sleep>; + status = "okay"; + + mdio { + compatible = "snps,dwmac-mdio"; + #address-cells = <1>; + #size-cells = <0>; + eth_phy0: eth_phy0@1 { + compatible = "ethernet-phy-id001c.c916"; + reg = <0x1>; + }; + }; +}; + &xhci1 { vusb33-supply = <&mt6359_vusb_ldo_reg>; status = "okay"; diff --git a/arch/arm64/boot/dts/mediatek/mt8195.dtsi b/arch/arm64/boot/dts/mediatek/mt8195.dtsi index 905d1a90b406..aa1fcc3b9cb6 100644 --- a/arch/arm64/boot/dts/mediatek/mt8195.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8195.dtsi @@ -1042,6 +1042,93 @@ spis1: spi@1101e000 { status = "disabled"; }; + stmmac_axi_setup: stmmac-axi-config { + snps,wr_osr_lmt = <0x7>; + snps,rd_osr_lmt = <0x7>; + snps,blen = <0 0 0 0 16 8 4>; + }; + + mtl_rx_setup: rx-queues-config { + snps,rx-queues-to-use = <4>; + snps,rx-sched-sp; + queue0 { + snps,dcb-algorithm; + snps,map-to-dma-channel = <0x0>; + }; + queue1 { + snps,dcb-algorithm; + snps,map-to-dma-channel = <0x0>; + }; + queue2 { + snps,dcb-algorithm; + snps,map-to-dma-channel = <0x0>; + }; + queue3 { + snps,dcb-algorithm; + snps,map-to-dma-channel = <0x0>; + }; + }; + + mtl_tx_setup: tx-queues-config { + snps,tx-queues-to-use = <4>; + snps,tx-sched-wrr; + queue0 { + snps,weight = <0x10>; + snps,dcb-algorithm; + snps,priority = <0x0>; + }; + queue1 { + snps,weight = <0x11>; + snps,dcb-algorithm; + snps,priority = <0x1>; + }; + queue2 { + snps,weight = <0x12>; + snps,dcb-algorithm; + snps,priority = <0x2>; + }; + queue3 { + snps,weight = <0x13>; + snps,dcb-algorithm; + snps,priority = <0x3>; + }; + }; + + eth: ethernet@11021000 { + compatible = "mediatek,mt8195-gmac", "snps,dwmac-5.10a"; + reg = <0 0x11021000 0 0x4000>; + interrupts = ; + interrupt-names = "macirq"; + mac-address = [00 55 7b b5 7d f7]; + clock-names = "axi", + "apb", + "mac_cg", + "mac_main", + "ptp_ref", + "rmii_internal"; + clocks = <&pericfg_ao CLK_PERI_AO_ETHERNET>, + <&pericfg_ao CLK_PERI_AO_ETHERNET_BUS>, + <&pericfg_ao CLK_PERI_AO_ETHERNET_MAC>, + <&topckgen CLK_TOP_SNPS_ETH_250M>, + <&topckgen CLK_TOP_SNPS_ETH_62P4M_PTP>, + <&topckgen CLK_TOP_SNPS_ETH_50M_RMII>; + assigned-clocks = <&topckgen CLK_TOP_SNPS_ETH_250M>, + <&topckgen CLK_TOP_SNPS_ETH_62P4M_PTP>, + <&topckgen CLK_TOP_SNPS_ETH_50M_RMII>; + assigned-clock-parents = <&topckgen CLK_TOP_ETHPLL_D2>, + <&topckgen CLK_TOP_ETHPLL_D8>, + <&topckgen CLK_TOP_ETHPLL_D10>; + power-domains = <&spm MT8195_POWER_DOMAIN_ETHER>; + mediatek,pericfg = <&infracfg_ao>; + snps,axi-config = <&stmmac_axi_setup>; + snps,mtl-rx-config = <&mtl_rx_setup>; + snps,mtl-tx-config = <&mtl_tx_setup>; + snps,txpbl = <16>; + snps,rxpbl = <16>; + snps,clk-csr = <0>; + status = "disabled"; + }; + xhci0: usb@11200000 { compatible = "mediatek,mt8195-xhci", "mediatek,mtk-xhci";