From patchwork Fri Mar 31 21:58:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Halaney X-Patchwork-Id: 78023 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp877884vqo; Fri, 31 Mar 2023 15:27:21 -0700 (PDT) X-Google-Smtp-Source: AKy350abW09WJa7yQl8QOnLRegJV12Tyh+JrhorTWK7YLzrhvmxEvsr4dIEyC0Vai4X+JCMPkjPv X-Received: by 2002:a17:90b:4c0b:b0:23e:fa90:ba34 with SMTP id na11-20020a17090b4c0b00b0023efa90ba34mr33823442pjb.37.1680301641499; Fri, 31 Mar 2023 15:27:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680301641; cv=none; d=google.com; s=arc-20160816; b=cagJBFSoq7qrQzsaZmR3z7RVEzSn3Bebu5ilavr+ELKgXBKWt64w/AHICYosYPrr9M sgVgVPsm+94jEYJe+jBh3wsmhh1Pdj2Rp9Ff+TjscaL8rJWXrw4VyFlAzCcwWpZJgwYU S7Elz7zgblbTX8kXYe0AW4VMxRp27sy2yfJugjzNc9W4XzTHXK+Q2sm752VwBl8eIVxg VeY3E2NEGtSAvEVwBfXmDkiapXbU1Ivp+0OJTO/ayXoBkleFSGP9/ev9OgimNUgKVcRR OlNrzNEs+qNiJarntCpGfNefhMkrErf/Xy5036gbPyjNuvwK7fsmr+naK3km8nuzYem1 EPCA== 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=q+CnpU0/48fSQtYvxmbymRW1jKLUmorpaHw1MMzDa7k=; b=ZEbaBNl8HlK8pXyuANGbXmBbhRT3OlhbR+h7P2xTJWmKBtzCpYJk5O3Xt5Pdnr4l7Y c9E7gWYgqkO6iU52+97JcAoUPcCAejrbAAhc5XIkTjvKwydFszgayWaRF2KJkmg5NV0V Ea/x3hVJjly5OydAMeqcgR1MWV2hm6BjlJEuvC6uN77ivpv45ZYHPnGqzU4fPw+ejSH9 CoV1BCVM0Cp7tABpXFAuPPik0z6Z6XmJJwanMfGaR9P5bk0bk/ITqWmDL6ylTYF8q0Ym GAzmU23YvuBz0q3dZVmW7qfw8agFdnPkFyxYeFsAnBMsv6jNzheMpDAVAN5GCqU9YJLy 76UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SpZtZuB6; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o17-20020a17090ac71100b0023f2e6a146bsi7648131pjt.41.2023.03.31.15.27.09; Fri, 31 Mar 2023 15:27:21 -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=SpZtZuB6; 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 S233396AbjCaWAA (ORCPT + 99 others); Fri, 31 Mar 2023 18:00:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233472AbjCaV7v (ORCPT ); Fri, 31 Mar 2023 17:59:51 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A1C859D2 for ; Fri, 31 Mar 2023 14:58:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680299911; 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=q+CnpU0/48fSQtYvxmbymRW1jKLUmorpaHw1MMzDa7k=; b=SpZtZuB6FZVZ08UDuVUZOKaKa4U5Sg6I36449QYbNKQRbcMJJ4Sys8HTqDYmLmzJgwZPZE /V7X0CO46FQaj8vlmoQhMDHAHYlo9PdQNLng5oHVQ9OqBe151wKkLsU8hpMrTlP8bquiuf 3MjFqet83uXLJuGRD79FpT0KzBleUVg= Received: from mail-oo1-f71.google.com (mail-oo1-f71.google.com [209.85.161.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-460-q47zNbA0P7mZcAQFeQLfEw-1; Fri, 31 Mar 2023 17:58:30 -0400 X-MC-Unique: q47zNbA0P7mZcAQFeQLfEw-1 Received: by mail-oo1-f71.google.com with SMTP id d2-20020a4a5202000000b0053b5874f94aso6452614oob.3 for ; Fri, 31 Mar 2023 14:58:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680299909; 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=q+CnpU0/48fSQtYvxmbymRW1jKLUmorpaHw1MMzDa7k=; b=JhZ68wzh6sF2yIgCWcxjTMFV1p2iDEmg4QQ+OonQd12jOFxeE5hBWRJu0CnQxqsZVX BHiXOtdxHNeDoH0G9vRKKXv5M1dOEmNAfbLohJiTZl6i2l2tiES4t/ABiVDI3i7WlTZd smK6veuKKuLuMC/Ej7wgDFEP8Ho/ypbV80JAH55zU5nPSj8jp+YTLATSev6YMrZSOCv6 yZgbEkjGYq48lY5Jvd2gHBhZBjNC3aHgvcRtAkITDBgc6ENrZ/UoFkBqksJtZfGZ71tX Ie5tRFxTwWdmeuX+ngodOoK0e5llW12VsFT58nXSqcej0GYbiCvYBW1E7kVK00OPxyN5 +aTA== X-Gm-Message-State: AO0yUKXxjN8SduHpOlhn84E3XkqJhxC8Lq54c58rPZWlEt/w8fQCMDwE f8IbddJA05R0zY58hwvfs82ICEokYr2fVaxy2qNjWnA6zhEqNa5sqEZw3e38WEReFE2fW0Vhphs xrzBrUilrT21p92q9n4hMnF/OHsjbSHxuONz39AaIWEtQMyCYSEjmdtGWEaULS1b0/igEkavKTa agXIRg+aHm X-Received: by 2002:a05:6808:8e5:b0:378:9c51:3ea2 with SMTP id d5-20020a05680808e500b003789c513ea2mr12195574oic.36.1680299909152; Fri, 31 Mar 2023 14:58:29 -0700 (PDT) X-Received: by 2002:a05:6808:8e5:b0:378:9c51:3ea2 with SMTP id d5-20020a05680808e500b003789c513ea2mr12195551oic.36.1680299908769; Fri, 31 Mar 2023 14:58:28 -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 g11-20020a4a894b000000b0053bb2ae3a78sm1299277ooi.24.2023.03.31.14.58.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Mar 2023 14:58:28 -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 v3 3/3] arm64: dts: qcom: sa8540p-ride: Add ethernet nodes Date: Fri, 31 Mar 2023 16:58:04 -0500 Message-Id: <20230331215804.783439-4-ahalaney@redhat.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230331215804.783439-1-ahalaney@redhat.com> References: <20230331215804.783439-1-ahalaney@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Spam-Status: No, score=-0.2 required=5.0 tests=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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761923973757281811?= X-GMAIL-MSGID: =?utf-8?q?1761923973757281811?= 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 v1 and v2: * None arch/arm64/boot/dts/qcom/sa8540p-ride.dts | 181 ++++++++++++++++++++++ 1 file changed, 181 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sa8540p-ride.dts b/arch/arm64/boot/dts/qcom/sa8540p-ride.dts index 40db5aa0803c..eb230265aa45 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,68 @@ 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 { + #address-cells = <0x1>; + #size-cells = <0x0>; + + compatible = "snps,dwmac-mdio"; + + /* 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 +437,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";