Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2775rwl; Tue, 11 Apr 2023 13:26:05 -0700 (PDT) X-Google-Smtp-Source: AKy350YQs+GKqnt6Slnar1m0+/yD0RIKoN38aUO+2uK+q+h1U/nszeOTj/J91ZpUtajtCglHIzKb X-Received: by 2002:a17:906:3e0b:b0:94a:9bd0:ea38 with SMTP id k11-20020a1709063e0b00b0094a9bd0ea38mr6779558eji.36.1681244765417; Tue, 11 Apr 2023 13:26:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681244765; cv=none; d=google.com; s=arc-20160816; b=Lr0fE5sXy1OXtSf8UaiJ8vO1hRk4L+iXtcfLfY+NqnO4khuB/VCPtTMfW2eJjt/MHy rsNBexYMg7a2Wip5dDqTr2CXRdWm5bkEZuKmO1vHCiWiJK/rWZcbDT6NN3vQHgTVuIcM GKrQldTbNWJJRJL2xWGK1XeueZ0Ub3zYZq/NAHV4FiikqBpQ3QG18hV2vBxL375ASNCT uTGrebmUU4vU6qiulLawRwGhL/pyUXIzjT0dY/ugTDVjiZ3hnA/0RVDEvGaaDZLPqTW8 CQ5aVqm+Uzfj0CsGR48CubSt8S8sSsBAdWsCuo00whlfyh2hpCw5kSp95257j+1dL1oN jjwQ== 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=9CbNbfXQG0WclGD5BV599nJw4B75FNHTW0PN9HLKZOY=; b=V3uKvJ4APjTJt8sx/qNAr0030owN+kDtho1bTwm3zixNFY5MkY8AgawVzXBMXo5DJK sKhiH9Xk7fSVpIHAvxMZK4msv/Jo1H7GUjEvXHoVa5RmfgkOz398MLyZyBmv04JHJFQx I/DXsrCNwNeIw6/CW8Z42kZZYOGzkTI8NcsnVzrw5ysON2ALF4ZJI1oMMj6XvwcKUHbs sfSNEvwD3RYtMSvZZex8xcUEVb2zWWpecXXsWYVEJIO8O+xiO0Q6c2v8KY0A0jUhx2ru 9fbhb1cmVHNgLfCvjuuyghBNlzr0+WNYy5gbpGxRAzxL3i4Sc8EgTcfv+jghPATXmnuR PvGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RgGlHOeE; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q19-20020a1709066ad300b00930c37d7919si1931850ejs.673.2023.04.11.13.25.36; Tue, 11 Apr 2023 13:26:05 -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=@redhat.com header.s=mimecast20190719 header.b=RgGlHOeE; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229819AbjDKUWK (ORCPT + 99 others); Tue, 11 Apr 2023 16:22:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229559AbjDKUWH (ORCPT ); Tue, 11 Apr 2023 16:22:07 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCBB5449C for ; Tue, 11 Apr 2023 13:20:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681244442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9CbNbfXQG0WclGD5BV599nJw4B75FNHTW0PN9HLKZOY=; b=RgGlHOeEqZWvXgdIh3ZqjJadQeZ6/F2e9Tyr3dZvOXyxkGH0Zcyoh4mkAut/sqYuEcgE99 cY3G5MOZhCwMoNzBCWTJtP+RCt6yEoPk7CcLk3kqABnpVnmuqQ+j8K80GjB2fFDjKNYNa8 ZKpK5TEJETkdWbg+jd91gQC3tkTHrqE= Received: from mail-oi1-f198.google.com (mail-oi1-f198.google.com [209.85.167.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-453-pzg-rotSP4mGxA7cJqiPPw-1; Tue, 11 Apr 2023 16:20:40 -0400 X-MC-Unique: pzg-rotSP4mGxA7cJqiPPw-1 Received: by mail-oi1-f198.google.com with SMTP id s14-20020a05680810ce00b003872286998bso584679ois.23 for ; Tue, 11 Apr 2023 13:20:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681244438; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9CbNbfXQG0WclGD5BV599nJw4B75FNHTW0PN9HLKZOY=; b=nHLtwd8YEN3Z5/b2e/wqmQe08+rC8bgx8TH6baRwspAi/mM12RZyB38gPVWUiRRoCL wm+NccrkSNDXeaGfp4hyGGp4b3Mm0ESzpmTgo2JETthMgYl3nTnqEQXWy2dwNLBvbARl ZfRnajx7cWOG7KYJAVvGa0Om5i8qIaDe7qJqAK5bSsyWtubkpZbbuX9dJ+y1q/BCROQR 26Nkdd47nib/z8IEzWiAXw6TRO3u4vp56EMAwCqZUmDPBMI3jRTLNJGx98I/yEDS8R9F TyfZ0F8rChhQd9Q8HDidOucMfd2VE5XzfCSFEwuR0hw8aiAWPiFq1f7u/74z/un+CkZt hvyw== X-Gm-Message-State: AAQBX9c0X5PrilIZispJwf0dN9lUU0/egs8pYE5cQVSIdiUNKjbRaNed Cci6Wwe/fxYzqtBrYyy25rwxx/kd2Ly1sm3gcR9pldJ4230gRh8FT0FHTWT+qctEfrbJtOC7z+0 Y+enNssl1xFaVDcyDcMBvrTsg+GQIUhDAzLxo+/ld+kSl8YPo+sx6FDBG+OeyxZwosy+y6p6cA7 jC8rxiXXhW X-Received: by 2002:a05:6808:128e:b0:386:9886:534d with SMTP id a14-20020a056808128e00b003869886534dmr5040853oiw.12.1681244437879; Tue, 11 Apr 2023 13:20:37 -0700 (PDT) X-Received: by 2002:a05:6808:128e:b0:386:9886:534d with SMTP id a14-20020a056808128e00b003869886534dmr5040828oiw.12.1681244437189; Tue, 11 Apr 2023 13:20:37 -0700 (PDT) Received: from halaney-x13s.attlocal.net (104-53-165-62.lightspeed.stlsmo.sbcglobal.net. [104.53.165.62]) by smtp.gmail.com with ESMTPSA id a6-20020a056808120600b003874631e249sm5976710oil.36.2023.04.11.13.20.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Apr 2023 13:20:36 -0700 (PDT) From: Andrew Halaney To: linux-kernel@vger.kernel.org Cc: agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, mturquette@baylibre.com, sboyd@kernel.org, richardcochran@gmail.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, netdev@vger.kernel.org, bmasney@redhat.com, echanude@redhat.com, ncai@quicinc.com, jsuraj@qti.qualcomm.com, hisunil@quicinc.com, Andrew Halaney Subject: [PATCH v4 3/3] arm64: dts: qcom: sa8540p-ride: Add ethernet nodes Date: Tue, 11 Apr 2023 15:20:09 -0500 Message-Id: <20230411202009.460650-4-ahalaney@redhat.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230411202009.460650-1-ahalaney@redhat.com> References: <20230411202009.460650-1-ahalaney@redhat.com> MIME-Version: 1.0 Content-type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 Enable both the MACs found on the board. ethernet0 and ethernet1 both ultimately go to a series of on board switches which aren't managed by this processor. ethernet0 is connected to a Marvell 88EA1512 phy via RGMII. That goes to the series of switches via SGMII on the "media" side of the phy. RGMII_SGMII mode is enabled via devicetree register descriptions. The switch on the "media" side has auto-negotiation disabled, so configuration from userspace similar to: ethtool -s eth0 autoneg off speed 1000 duplex full is necessary to get traffic flowing on that interface. ethernet1 is in a mac2mac/fixed-link configuration going to the same series of switches directly via RGMII. Signed-off-by: Andrew Halaney --- Changes since v3: * Compatible goes first in node (Krzysztof) Changes since v1 and v2: * None arch/arm64/boot/dts/qcom/sa8540p-ride.dts | 180 ++++++++++++++++++++++ 1 file changed, 180 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sa8540p-ride.dts b/arch/arm64/boot/dts/qcom/sa8540p-ride.dts index 40db5aa0803c..caad955969bc 100644 --- a/arch/arm64/boot/dts/qcom/sa8540p-ride.dts +++ b/arch/arm64/boot/dts/qcom/sa8540p-ride.dts @@ -28,6 +28,65 @@ aliases { chosen { stdout-path = "serial0:115200n8"; }; + + mtl_rx_setup: rx-queues-config { + snps,rx-queues-to-use = <1>; + snps,rx-sched-sp; + + queue0 { + snps,dcb-algorithm; + snps,map-to-dma-channel = <0x0>; + snps,route-up; + snps,priority = <0x1>; + }; + + queue1 { + snps,dcb-algorithm; + snps,map-to-dma-channel = <0x1>; + snps,route-ptp; + }; + + queue2 { + snps,avb-algorithm; + snps,map-to-dma-channel = <0x2>; + snps,route-avcp; + }; + + queue3 { + snps,avb-algorithm; + snps,map-to-dma-channel = <0x3>; + snps,priority = <0xc>; + }; + }; + + mtl_tx_setup: tx-queues-config { + snps,tx-queues-to-use = <1>; + snps,tx-sched-sp; + + queue0 { + snps,dcb-algorithm; + }; + + queue1 { + snps,dcb-algorithm; + }; + + queue2 { + snps,avb-algorithm; + snps,send_slope = <0x1000>; + snps,idle_slope = <0x1000>; + snps,high_credit = <0x3e800>; + snps,low_credit = <0xffc18000>; + }; + + queue3 { + snps,avb-algorithm; + snps,send_slope = <0x1000>; + snps,idle_slope = <0x1000>; + snps,high_credit = <0x3e800>; + snps,low_credit = <0xffc18000>; + }; + }; }; &apps_rsc { @@ -151,6 +210,67 @@ vreg_l8g: ldo8 { }; }; +ðernet0 { + snps,mtl-rx-config = <&mtl_rx_setup>; + snps,mtl-tx-config = <&mtl_tx_setup>; + + max-speed = <1000>; + phy-handle = <&rgmii_phy>; + phy-mode = "rgmii-txid"; + + pinctrl-names = "default"; + pinctrl-0 = <ðernet0_default>; + + status = "okay"; + + mdio { + compatible = "snps,dwmac-mdio"; + #address-cells = <0x1>; + #size-cells = <0x0>; + + /* Marvell 88EA1512 */ + rgmii_phy: phy@8 { + reg = <0x8>; + + interrupt-parent = <&tlmm>; + interrupts-extended = <&tlmm 127 IRQ_TYPE_EDGE_FALLING>; + + reset-gpios = <&pmm8540c_gpios 1 GPIO_ACTIVE_LOW>; + reset-assert-us = <11000>; + reset-deassert-us = <70000>; + + device_type = "ethernet-phy"; + + /* Set to RGMII_SGMII mode and soft reset. Turn off auto-negotiation + * from userspace to talk to the switch on the SGMII side of things + */ + marvell,reg-init = + /* Set MODE[2:0] to RGMII_SGMII */ + <0x12 0x14 0xfff8 0x4>, + /* Soft reset required after changing MODE[2:0] */ + <0x12 0x14 0x7fff 0x8000>; + }; + }; +}; + +ðernet1 { + snps,mtl-rx-config = <&mtl_rx_setup>; + snps,mtl-tx-config = <&mtl_tx_setup>; + + max-speed = <1000>; + phy-mode = "rgmii-txid"; + + pinctrl-names = "default"; + pinctrl-0 = <ðernet1_default>; + + status = "okay"; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + &i2c0 { pinctrl-names = "default"; pinctrl-0 = <&i2c0_default>; @@ -316,6 +436,66 @@ &xo_board_clk { /* PINCTRL */ &tlmm { + ethernet0_default: ethernet0-default-state { + mdc-pins { + pins = "gpio175"; + function = "rgmii_0"; + drive-strength = <16>; + bias-pull-up; + }; + + mdio-pins { + pins = "gpio176"; + function = "rgmii_0"; + drive-strength = <16>; + bias-pull-up; + }; + + rgmii-tx-pins { + pins = "gpio183", "gpio184", "gpio185", "gpio186", "gpio187", "gpio188"; + function = "rgmii_0"; + drive-strength = <16>; + bias-pull-up; + }; + + rgmii-rx-pins { + pins = "gpio177", "gpio178", "gpio179", "gpio180", "gpio181", "gpio182"; + function = "rgmii_0"; + drive-strength = <16>; + bias-disable; + }; + }; + + ethernet1_default: ethernet1-default-state { + mdc-pins { + pins = "gpio97"; + function = "rgmii_1"; + drive-strength = <16>; + bias-pull-up; + }; + + mdio-pins { + pins = "gpio98"; + function = "rgmii_1"; + drive-strength = <16>; + bias-pull-up; + }; + + rgmii-tx-pins { + pins = "gpio105", "gpio106", "gpio107", "gpio108", "gpio109", "gpio110"; + function = "rgmii_1"; + drive-strength = <16>; + bias-pull-up; + }; + + rgmii-rx-pins { + pins = "gpio99", "gpio100", "gpio101", "gpio102", "gpio103", "gpio104"; + function = "rgmii_1"; + drive-strength = <16>; + bias-disable; + }; + }; + i2c0_default: i2c0-default-state { /* To USB7002T-I/KDXVA0 USB hub (SIP1 only) */ pins = "gpio135", "gpio136"; -- 2.39.2