From nobody Fri Dec 19 03:42:09 2025 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 F2411C77B71 for ; Thu, 13 Apr 2023 19:17:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229582AbjDMTRT (ORCPT ); Thu, 13 Apr 2023 15:17:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229604AbjDMTRR (ORCPT ); Thu, 13 Apr 2023 15:17:17 -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 E5FA183ED for ; Thu, 13 Apr 2023 12:15:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681413352; 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=fEno2IWkUzFj29uJBLwx+d+I43Od4gaX+U+WEKiwH6s=; b=IOBudAwPkyZPEKj28a9cmMUP3+VoEXeNpQ3QLVenPLN1sx6IIFjBEu39HEStyMW1cLcDnM yjhBtCsQX7MpehfaNvn10LzavBCTA/yBOvXtQ41W/FnwYrsLY0/PEc6dzdDFLglhgtwLJZ +WNPDC0CVIOZeAFx+ljLyOiK5Ik2lK8= Received: from mail-yb1-f199.google.com (mail-yb1-f199.google.com [209.85.219.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-614-siOrr7UQOC2QAgMzXjxoZA-1; Thu, 13 Apr 2023 15:15:51 -0400 X-MC-Unique: siOrr7UQOC2QAgMzXjxoZA-1 Received: by mail-yb1-f199.google.com with SMTP id 85-20020a250d58000000b00b8f380b2bccso6916054ybn.14 for ; Thu, 13 Apr 2023 12:15:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681413350; x=1684005350; 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=fEno2IWkUzFj29uJBLwx+d+I43Od4gaX+U+WEKiwH6s=; b=NRHSHJFol3QOGNoxVRmh6JxnXYaHuBXRr8kCt3H/khRcDSV+CJWSMYYsvowNg1lA+U Kbbi8mZkqPkEZ3GCvAj0wCQofOt/MZ6CW6/p6gz+eeS8SWCUCOOboQ884ln7YWbJosyJ qv28Abl7w26hPilP8L4YiMLeBbGm9NJ2xu86HZRCYUMuWdQQPYkfNjJRaco3pIa2aa1K +TUqy1SeoYzdyH+/c1D7kTl/MYChbcFj/06j5PvXnaFmN7wpp8vH/Ba4dFMqX+4mQiN9 8oqSsiFno911NxVCn4C0QXtA2NPhpMqx6cmq5fYNzk+Ke0hRGN1a2gF0t5BhwDT6vaam pD0A== X-Gm-Message-State: AAQBX9eyB2VUdRjJc6nlGMIYKSJA0QtDlMbJWL3OhDrEFp6PCm/6iADi t/1W/aArZtvleTj6Ms0APOz79AfPCK+na9ggW2o3yoJct9UuR/muMfU/6zkFfuLtBJ8E0rkAWuU rTi8lxr0aQXW4fM8S8etAhSgr1ZH0s/tTv2TCYgykYvqkC3pbOfWoU9j8K/ios5lTdXRHw3p38P R63Q6SxnYn X-Received: by 2002:a0d:f684:0:b0:54c:5c8:a391 with SMTP id g126-20020a0df684000000b0054c05c8a391mr2599354ywf.17.1681413350180; Thu, 13 Apr 2023 12:15:50 -0700 (PDT) X-Google-Smtp-Source: AKy350bHbGIQofLRPOMmHAj0myzlOt8hgVHye3/1Gnd8hH/LkDHhOGimSeGuQZ7/E9FQ/Ar9WITXkg== X-Received: by 2002:a0d:f684:0:b0:54c:5c8:a391 with SMTP id g126-20020a0df684000000b0054c05c8a391mr2599320ywf.17.1681413349787; Thu, 13 Apr 2023 12:15:49 -0700 (PDT) Received: from halaney-x13s.redhat.com (104-53-165-62.lightspeed.stlsmo.sbcglobal.net. [104.53.165.62]) by smtp.gmail.com with ESMTPSA id t11-20020a81780b000000b00545a4ec318dsm673203ywc.13.2023.04.13.12.15.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Apr 2023 12:15:49 -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 v5 1/3] clk: qcom: gcc-sc8280xp: Add EMAC GDSCs Date: Thu, 13 Apr 2023 14:15:39 -0500 Message-Id: <20230413191541.1073027-2-ahalaney@redhat.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230413191541.1073027-1-ahalaney@redhat.com> References: <20230413191541.1073027-1-ahalaney@redhat.com> 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" Add the EMAC GDSCs to allow the EMAC hardware to be enabled. Acked-by: Stephen Boyd Reviewed-by: Konrad Dybcio Tested-by: Brian Masney Signed-off-by: Andrew Halaney --- Changes since v4: * Add Tested-by (Brian) Changes since v3: * None Changes since v2: * Add Konrad's Reviewed-by Changes since v1: * Add Stephen's Acked-by * Explicitly tested on x13s laptop with no noticeable side effect (Konr= ad) drivers/clk/qcom/gcc-sc8280xp.c | 18 ++++++++++++++++++ include/dt-bindings/clock/qcom,gcc-sc8280xp.h | 2 ++ 2 files changed, 20 insertions(+) diff --git a/drivers/clk/qcom/gcc-sc8280xp.c b/drivers/clk/qcom/gcc-sc8280x= p.c index b3198784e1c3..04a99dbaa57e 100644 --- a/drivers/clk/qcom/gcc-sc8280xp.c +++ b/drivers/clk/qcom/gcc-sc8280xp.c @@ -6873,6 +6873,22 @@ static struct gdsc usb30_sec_gdsc =3D { .pwrsts =3D PWRSTS_RET_ON, }; =20 +static struct gdsc emac_0_gdsc =3D { + .gdscr =3D 0xaa004, + .pd =3D { + .name =3D "emac_0_gdsc", + }, + .pwrsts =3D PWRSTS_OFF_ON, +}; + +static struct gdsc emac_1_gdsc =3D { + .gdscr =3D 0xba004, + .pd =3D { + .name =3D "emac_1_gdsc", + }, + .pwrsts =3D PWRSTS_OFF_ON, +}; + static struct clk_regmap *gcc_sc8280xp_clocks[] =3D { [GCC_AGGRE_NOC_PCIE0_TUNNEL_AXI_CLK] =3D &gcc_aggre_noc_pcie0_tunnel_axi_= clk.clkr, [GCC_AGGRE_NOC_PCIE1_TUNNEL_AXI_CLK] =3D &gcc_aggre_noc_pcie1_tunnel_axi_= clk.clkr, @@ -7351,6 +7367,8 @@ static struct gdsc *gcc_sc8280xp_gdscs[] =3D { [USB30_MP_GDSC] =3D &usb30_mp_gdsc, [USB30_PRIM_GDSC] =3D &usb30_prim_gdsc, [USB30_SEC_GDSC] =3D &usb30_sec_gdsc, + [EMAC_0_GDSC] =3D &emac_0_gdsc, + [EMAC_1_GDSC] =3D &emac_1_gdsc, }; =20 static const struct clk_rcg_dfs_data gcc_dfs_clocks[] =3D { diff --git a/include/dt-bindings/clock/qcom,gcc-sc8280xp.h b/include/dt-bin= dings/clock/qcom,gcc-sc8280xp.h index cb2fb638825c..721105ea4fad 100644 --- a/include/dt-bindings/clock/qcom,gcc-sc8280xp.h +++ b/include/dt-bindings/clock/qcom,gcc-sc8280xp.h @@ -492,5 +492,7 @@ #define USB30_MP_GDSC 9 #define USB30_PRIM_GDSC 10 #define USB30_SEC_GDSC 11 +#define EMAC_0_GDSC 12 +#define EMAC_1_GDSC 13 =20 #endif --=20 2.39.2 From nobody Fri Dec 19 03:42:09 2025 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 73E40C77B61 for ; Thu, 13 Apr 2023 19:17:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229994AbjDMTRX (ORCPT ); Thu, 13 Apr 2023 15:17:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229703AbjDMTRR (ORCPT ); Thu, 13 Apr 2023 15:17:17 -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 3BEB183FA for ; Thu, 13 Apr 2023 12:15:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681413355; 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=k9WWwvbR/FZN1KSYOs1jbDKU8bkcjmWH5j2dCI6i4/4=; b=SmVuFS5VMoWqNRgnq3KccY0IPHfde8YRLBIShrdiSeJAs+SksymSQUbe6rWIyn2eiYW/hu OmEBZ3eIf+1woDPSXNyoAOHfuUyAkYMBGliAmtGN1k3fuLAIm7z/5mIIOakaFSimTE6P+W SCSAHtuESik84Wo7RsVTF/HGDrrsTlg= Received: from mail-yw1-f200.google.com (mail-yw1-f200.google.com [209.85.128.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-3-hAUkqqucOA-lswVRclcA2g-1; Thu, 13 Apr 2023 15:15:54 -0400 X-MC-Unique: hAUkqqucOA-lswVRclcA2g-1 Received: by mail-yw1-f200.google.com with SMTP id 00721157ae682-54f8e31155bso63892297b3.11 for ; Thu, 13 Apr 2023 12:15:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681413352; x=1684005352; 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=k9WWwvbR/FZN1KSYOs1jbDKU8bkcjmWH5j2dCI6i4/4=; b=eYFO3BtnvoYG8+CtlzqWH+F9xsSS8SpC01CiMyGGxh2RAoe4+iliCb553/L+kR27b8 V8W+F1QvA3eNtPi9PkbpWttTLGNfmO+S/K7Mz2PJJYBQCguqL66DRreOHa8rig6+LO8+ l4pvRVv5g3+OmNUn1LOoajTIECWKJED0pmD6LGQcs9C0cY1Kn63uXREn5UfssJjqKbni ZNG6BVSPxQ8B/B5wCmO4PfLmzb7X/Ej0UzCOb3kWhulNxLLiKPy11D8qkMjNNzvwXriX 1Ud/uJGGPLAig78dpuMuXDPh356aXo508yj+JBdN6S9MbBSoounB6UKebjhL273X5i6t liPA== X-Gm-Message-State: AAQBX9fjG2KyKeNXNAH6RJy6jKT2aPAaHIcwH9L+mkcB/Q5ATdB5qxro ZG0bQhB4bb8g1bqAi4eYfbePjA4A5982HZReL6y29Ti2i4qa5MKjU6nTmg7XQ4bcpFYrfaAIhOS qPIp9rbQko3jP+9idrva/MKDGgwWpl80iArzxPTtNiWXSYKneUIvoPV/Y0r1GIzYa4/AgRebV5y 9EMg9+9LCx X-Received: by 2002:a05:6902:114c:b0:b8f:469a:cb9b with SMTP id p12-20020a056902114c00b00b8f469acb9bmr3725973ybu.52.1681413352285; Thu, 13 Apr 2023 12:15:52 -0700 (PDT) X-Google-Smtp-Source: AKy350YRjOhJ5BgTW4nVvR3gmkWclEIC81iF4mHomqOkKgCvCQIoNpZOBWa6bEnrl40W7p2xmQGHGg== X-Received: by 2002:a05:6902:114c:b0:b8f:469a:cb9b with SMTP id p12-20020a056902114c00b00b8f469acb9bmr3725930ybu.52.1681413351925; Thu, 13 Apr 2023 12:15:51 -0700 (PDT) Received: from halaney-x13s.redhat.com (104-53-165-62.lightspeed.stlsmo.sbcglobal.net. [104.53.165.62]) by smtp.gmail.com with ESMTPSA id t11-20020a81780b000000b00545a4ec318dsm673203ywc.13.2023.04.13.12.15.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Apr 2023 12:15:51 -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 v5 2/3] arm64: dts: qcom: sc8280xp: Add ethernet nodes Date: Thu, 13 Apr 2023 14:15:40 -0500 Message-Id: <20230413191541.1073027-3-ahalaney@redhat.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230413191541.1073027-1-ahalaney@redhat.com> References: <20230413191541.1073027-1-ahalaney@redhat.com> 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" This platform has 2 MACs integrated in it, go ahead and describe them. Reviewed-by: Konrad Dybcio Tested-by: Brian Masney Signed-off-by: Andrew Halaney --- Changes since v4: * Be consistent in newlines (Brian) * Add Tested-by (Brian) Changes since v3: * Order soc node via unit address (Konrad) * Add Reviewed-by (Konrad) Changes since v2: * Fix spacing (Konrad) Changes since v1: * None arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 60 ++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi b/arch/arm64/boot/dts/q= com/sc8280xp.dtsi index 42bfa9fa5b96..fb5a3a691679 100644 --- a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi +++ b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi @@ -761,6 +761,36 @@ soc: soc@0 { ranges =3D <0 0 0 0 0x10 0>; dma-ranges =3D <0 0 0 0 0x10 0>; =20 + ethernet0: ethernet@20000 { + compatible =3D "qcom,sc8280xp-ethqos"; + reg =3D <0x0 0x00020000 0x0 0x10000>, + <0x0 0x00036000 0x0 0x100>; + reg-names =3D "stmmaceth", "rgmii"; + + clocks =3D <&gcc GCC_EMAC0_AXI_CLK>, + <&gcc GCC_EMAC0_SLV_AHB_CLK>, + <&gcc GCC_EMAC0_PTP_CLK>, + <&gcc GCC_EMAC0_RGMII_CLK>; + clock-names =3D "stmmaceth", + "pclk", + "ptp_ref", + "rgmii"; + + interrupts =3D , + ; + interrupt-names =3D "macirq", "eth_lpi"; + + iommus =3D <&apps_smmu 0x4c0 0xf>; + power-domains =3D <&gcc EMAC_0_GDSC>; + + snps,tso; + snps,pbl =3D <32>; + rx-fifo-depth =3D <4096>; + tx-fifo-depth =3D <4096>; + + status =3D "disabled"; + }; + gcc: clock-controller@100000 { compatible =3D "qcom,gcc-sc8280xp"; reg =3D <0x0 0x00100000 0x0 0x1f0000>; @@ -4681,6 +4711,36 @@ dispcc1: clock-controller@22100000 { =20 status =3D "disabled"; }; + + ethernet1: ethernet@23000000 { + compatible =3D "qcom,sc8280xp-ethqos"; + reg =3D <0x0 0x23000000 0x0 0x10000>, + <0x0 0x23016000 0x0 0x100>; + reg-names =3D "stmmaceth", "rgmii"; + + clocks =3D <&gcc GCC_EMAC1_AXI_CLK>, + <&gcc GCC_EMAC1_SLV_AHB_CLK>, + <&gcc GCC_EMAC1_PTP_CLK>, + <&gcc GCC_EMAC1_RGMII_CLK>; + clock-names =3D "stmmaceth", + "pclk", + "ptp_ref", + "rgmii"; + + interrupts =3D , + ; + interrupt-names =3D "macirq", "eth_lpi"; + + iommus =3D <&apps_smmu 0x40 0xf>; + power-domains =3D <&gcc EMAC_1_GDSC>; + + snps,tso; + snps,pbl =3D <32>; + rx-fifo-depth =3D <4096>; + tx-fifo-depth =3D <4096>; + + status =3D "disabled"; + }; }; =20 sound: sound { --=20 2.39.2 From nobody Fri Dec 19 03:42:09 2025 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 5E9ADC77B7A for ; Thu, 13 Apr 2023 19:17:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230143AbjDMTRb (ORCPT ); Thu, 13 Apr 2023 15:17:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229869AbjDMTRV (ORCPT ); Thu, 13 Apr 2023 15:17:21 -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 445E28697 for ; Thu, 13 Apr 2023 12:15:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681413357; 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=xTgGczCO0mNwpgaEE0ax8YC4P9ZUQjVz+mrfnTw0NtY=; b=MEwbCuGNArhj0FNwILgZwzUlzH+bo+ARNyjyFV5nShFo6/ZgQLHoC37OBFjgCoIEgISc+a xZ3+Q4KPM8ReMqbN6g7KSowKX6Dgh+VRjlU9oUTHYaOOGlXeFLyAeAGVf+1/peuMI8Vmsq s4u0VyHnMb/wwwOtnOyly+sy1RK7C5U= Received: from mail-yw1-f199.google.com (mail-yw1-f199.google.com [209.85.128.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-182-oFwq-ayTNeOnlutu9_IdBA-1; Thu, 13 Apr 2023 15:15:56 -0400 X-MC-Unique: oFwq-ayTNeOnlutu9_IdBA-1 Received: by mail-yw1-f199.google.com with SMTP id 00721157ae682-54fde069e4aso11362367b3.3 for ; Thu, 13 Apr 2023 12:15:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681413355; x=1684005355; 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=xTgGczCO0mNwpgaEE0ax8YC4P9ZUQjVz+mrfnTw0NtY=; b=dJTDhwpD7lz0S2EJ7ds0ltET9Avgjw+hsi4sej9Ql3pu11HlMlH1xUhzdqxralhzYh 0P/ZScicXNYjpEXnY7xtY4RiURLrhaGaW7MkV2zKnIb/lidIKfBZ2qRMJ8S0faujs6H/ rmDnIFsIavBYFnWVkQMPGcfu8qjEIqb+LvTDS7bU4HmCe8OqSjYkyydkBbUdjeVgcnGz 35S3iE03uKVeSptTajghJi6KMctA4rOnb1Dlfn46bLqJebc7I2gi/e4IUxzb9C707+af wBXZsGqBHA61iKnrndKPjZ7kqiCTxyrZTIjZohne07QSNtHbOymZuDSSJo/ZXun+atKR A9iQ== X-Gm-Message-State: AAQBX9e02aOhzWy9e9GuC/HCuZrmqjVhj1+shtMn8xU/OKSu2MArpTUQ JsLbVK+dJ20D4Wwgc3q6CKpX46vHhTd/1Am9XJETUeRIuXmkiZejmtS0P81AWnJYjRPzRvTDdJY vBZBM0sg+Gumh3Sy5iVL9NlNrebHTQh06c3V4JcQ69g60vNnxW11T+LTmVWjf1ImJyT8a95cIob J+h+ltCslM X-Received: by 2002:a81:4810:0:b0:536:3451:b2ab with SMTP id v16-20020a814810000000b005363451b2abmr2997382ywa.51.1681413355476; Thu, 13 Apr 2023 12:15:55 -0700 (PDT) X-Google-Smtp-Source: AKy350Z+kPXa1HPrZbBVBQ9Hvi0ho/p670nRIUBtqxHPLoBYgdWfhEUIgtsd9juVQgyaVIGCkR8Wyw== X-Received: by 2002:a81:4810:0:b0:536:3451:b2ab with SMTP id v16-20020a814810000000b005363451b2abmr2997349ywa.51.1681413355120; Thu, 13 Apr 2023 12:15:55 -0700 (PDT) Received: from halaney-x13s.redhat.com (104-53-165-62.lightspeed.stlsmo.sbcglobal.net. [104.53.165.62]) by smtp.gmail.com with ESMTPSA id t11-20020a81780b000000b00545a4ec318dsm673203ywc.13.2023.04.13.12.15.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Apr 2023 12:15:54 -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 v5 3/3] arm64: dts: qcom: sa8540p-ride: Add ethernet nodes Date: Thu, 13 Apr 2023 14:15:41 -0500 Message-Id: <20230413191541.1073027-4-ahalaney@redhat.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230413191541.1073027-1-ahalaney@redhat.com> References: <20230413191541.1073027-1-ahalaney@redhat.com> 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" 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. Tested-by: Brian Masney Signed-off-by: Andrew Halaney --- This patch is why there's a v5, I couldn't ignore the needless interrupts-parent Konrad pointed out in the sa8155-adp.dts over at: https://lore.kernel.org/linux-arm-msm/88d41729-86be-95cb-2fda-1b809f07ed6b@= linaro.org/ Changes since v4: * Remove needless interrupt-parent (Konrad) * Add Tested-by (Brian) Changes since v3: * Compatible goes first in node (Krzysztof) Changes since v1 and v2: * None arch/arm64/boot/dts/qcom/sa8540p-ride.dts | 179 ++++++++++++++++++++++ 1 file changed, 179 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sa8540p-ride.dts b/arch/arm64/boot/dt= s/qcom/sa8540p-ride.dts index 40db5aa0803c..650cd54f418e 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 =3D "serial0:115200n8"; }; + + mtl_rx_setup: rx-queues-config { + snps,rx-queues-to-use =3D <1>; + snps,rx-sched-sp; + + queue0 { + snps,dcb-algorithm; + snps,map-to-dma-channel =3D <0x0>; + snps,route-up; + snps,priority =3D <0x1>; + }; + + queue1 { + snps,dcb-algorithm; + snps,map-to-dma-channel =3D <0x1>; + snps,route-ptp; + }; + + queue2 { + snps,avb-algorithm; + snps,map-to-dma-channel =3D <0x2>; + snps,route-avcp; + }; + + queue3 { + snps,avb-algorithm; + snps,map-to-dma-channel =3D <0x3>; + snps,priority =3D <0xc>; + }; + }; + + mtl_tx_setup: tx-queues-config { + snps,tx-queues-to-use =3D <1>; + snps,tx-sched-sp; + + queue0 { + snps,dcb-algorithm; + }; + + queue1 { + snps,dcb-algorithm; + }; + + queue2 { + snps,avb-algorithm; + snps,send_slope =3D <0x1000>; + snps,idle_slope =3D <0x1000>; + snps,high_credit =3D <0x3e800>; + snps,low_credit =3D <0xffc18000>; + }; + + queue3 { + snps,avb-algorithm; + snps,send_slope =3D <0x1000>; + snps,idle_slope =3D <0x1000>; + snps,high_credit =3D <0x3e800>; + snps,low_credit =3D <0xffc18000>; + }; + }; }; =20 &apps_rsc { @@ -151,6 +210,66 @@ vreg_l8g: ldo8 { }; }; =20 +ðernet0 { + snps,mtl-rx-config =3D <&mtl_rx_setup>; + snps,mtl-tx-config =3D <&mtl_tx_setup>; + + max-speed =3D <1000>; + phy-handle =3D <&rgmii_phy>; + phy-mode =3D "rgmii-txid"; + + pinctrl-names =3D "default"; + pinctrl-0 =3D <ðernet0_default>; + + status =3D "okay"; + + mdio { + compatible =3D "snps,dwmac-mdio"; + #address-cells =3D <1>; + #size-cells =3D <0>; + + /* Marvell 88EA1512 */ + rgmii_phy: phy@8 { + reg =3D <0x8>; + + interrupts-extended =3D <&tlmm 127 IRQ_TYPE_EDGE_FALLING>; + + reset-gpios =3D <&pmm8540c_gpios 1 GPIO_ACTIVE_LOW>; + reset-assert-us =3D <11000>; + reset-deassert-us =3D <70000>; + + device_type =3D "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 =3D + /* 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 =3D <&mtl_rx_setup>; + snps,mtl-tx-config =3D <&mtl_tx_setup>; + + max-speed =3D <1000>; + phy-mode =3D "rgmii-txid"; + + pinctrl-names =3D "default"; + pinctrl-0 =3D <ðernet1_default>; + + status =3D "okay"; + + fixed-link { + speed =3D <1000>; + full-duplex; + }; +}; + &i2c0 { pinctrl-names =3D "default"; pinctrl-0 =3D <&i2c0_default>; @@ -316,6 +435,66 @@ &xo_board_clk { /* PINCTRL */ =20 &tlmm { + ethernet0_default: ethernet0-default-state { + mdc-pins { + pins =3D "gpio175"; + function =3D "rgmii_0"; + drive-strength =3D <16>; + bias-pull-up; + }; + + mdio-pins { + pins =3D "gpio176"; + function =3D "rgmii_0"; + drive-strength =3D <16>; + bias-pull-up; + }; + + rgmii-tx-pins { + pins =3D "gpio183", "gpio184", "gpio185", "gpio186", "gpio187", "gpio18= 8"; + function =3D "rgmii_0"; + drive-strength =3D <16>; + bias-pull-up; + }; + + rgmii-rx-pins { + pins =3D "gpio177", "gpio178", "gpio179", "gpio180", "gpio181", "gpio18= 2"; + function =3D "rgmii_0"; + drive-strength =3D <16>; + bias-disable; + }; + }; + + ethernet1_default: ethernet1-default-state { + mdc-pins { + pins =3D "gpio97"; + function =3D "rgmii_1"; + drive-strength =3D <16>; + bias-pull-up; + }; + + mdio-pins { + pins =3D "gpio98"; + function =3D "rgmii_1"; + drive-strength =3D <16>; + bias-pull-up; + }; + + rgmii-tx-pins { + pins =3D "gpio105", "gpio106", "gpio107", "gpio108", "gpio109", "gpio11= 0"; + function =3D "rgmii_1"; + drive-strength =3D <16>; + bias-pull-up; + }; + + rgmii-rx-pins { + pins =3D "gpio99", "gpio100", "gpio101", "gpio102", "gpio103", "gpio104= "; + function =3D "rgmii_1"; + drive-strength =3D <16>; + bias-disable; + }; + }; + i2c0_default: i2c0-default-state { /* To USB7002T-I/KDXVA0 USB hub (SIP1 only) */ pins =3D "gpio135", "gpio136"; --=20 2.39.2