From patchwork Wed Mar 5 06:39:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 14002080 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A3623C19F32 for ; Wed, 5 Mar 2025 06:43:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pSXWaitxw7QAPQn56p0xC0TgAeZ4hFS4YCoAICbKBrs=; b=EN4ZQLP2tjQIh3 LprtX/ztQhmBaXNpVBVe0soCDivac74Qqx7J3RRGrROfXPi27w/TwJ+fyZjscXHxc56Ps/7PyM5Tg XQCOdT+Ff/uOMlefU+0CNkVxgAsRewPFLV21R6y1vEeispPC5yQFTYcPauDPD/dXWaPete+88e/dd /Fkoj0EGwH8eaCEAcWa3eEqytOzMmfS2NLu6MhffkxrkniF80sGdBfYObIUATodQV4U3RF8yXwdA5 gg8gjsCJW4JIHxppxu9NegPzHQ3qQcoL2ALDUd9jd7e5hoKCf2DOuxCzUFQ7VRIX5PkhW5P19x/ah Om6r/6aDUfdz6LLzWyPg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tpiTx-000000079RS-1Lk6; Wed, 05 Mar 2025 06:43:53 +0000 Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tpiQ7-000000078fH-1rYt; Wed, 05 Mar 2025 06:39:56 +0000 Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-7c3cf3afc2bso145489185a.0; Tue, 04 Mar 2025 22:39:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741156794; x=1741761594; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Pm0v1oLCij0h6SDkpOwWiVAdzDZKq77pVrdFNubwArE=; b=dT0o47C9C62fv3/T5GJbNkoXiLYKWKhtxZpw+Y+WYosMl4Y+f4Brwhilrz59kcoHCf bWWV/mHzY0oCMIkAfZTHPZPV/FcbmqaugFTcObboseE0mgD+hdcYyMED6Aha4btPxw8x mRbQwwpnhnE1NTMbTBbWtXzQe3XNwdn1h8BWM6rYhkbTJzioSNMpMsUehGWBs89eyp+V zWsvNYoFM592ckwYuV9EoZ4mvtz2h4Tf4/qD3kppokE9H+IB0KjA9rQ1rf/zuGbUQTzo UTwW4P9P+XJBo7zUWCssEGMuCjGGO1yqjUnE08nJZg9Ub/AIuCvQVgB1K6I3scpJt7nz e/ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741156794; x=1741761594; 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=Pm0v1oLCij0h6SDkpOwWiVAdzDZKq77pVrdFNubwArE=; b=ROXbxfGxPQchTjvLa3oddBOA8m9JDFPw7Y3bXQ71nFwCZ3Dyin74J+BNR8snn2MXpx PnNRKZHgCnGHkMD32Z5H8c8odnXTHUkCWY0bz7yKgumxEGrU8p3UV3bg3At8MVkMKBS4 vptjK3NVtGE9bxLaH7MlFkS0udXf9L1+gBx9ZIWFqHu3+dkH1xui26kAb+j0HwiOANU1 ZTepYQuheWr3pru+TP49yu00u3dGCaUMvHQm8KPIDs9XUiK/pr+ZNFIa8pnrc4wbw3UJ 6FimYW+SjXif/oZj+0F2sBydj8epk9AnJsvAXr2oqBS/AGJVOQJvtfsYHqL305gLCpSm 8c2Q== X-Forwarded-Encrypted: i=1; AJvYcCUC/pMYklv9Dvqus7/D0OWBXqZmEqOJVL4DDr2SZxyKSQwmw2LCLwyVJoUQgQRrqL6xR2A/fK0u663dDDk=@lists.infradead.org, AJvYcCWHgqUKNkS/7Xci20enjA8EctCz0vDm9eseDPq5CDtkEa8YK4DV02zD+7zvM5cGycwvYTbaczhtiKLTbsrp5i0j@lists.infradead.org X-Gm-Message-State: AOJu0Yzd0FvEu9N5zhpUvAd/hJ5WID5LB+x+0eiNOdLuiOocmiZYHH99 9XK+iXKHHvZqafgam0CzIJg8FfeWwj3K7pbF0sySauhLut0rBkZ7 X-Gm-Gg: ASbGncs7PDDpFTPdjMowGDr59CF/zRmRZMRV6jlojnktCax7n2oi2Z7jpleYtVisY0+ fBi8G46QsQiDxoNO1P8Ic+NUZB4JbzsCu9lZcgKEg/ns2SE9ZPFZUjp/+XGjeWqxvz7Zo7Z1j5b fYa4d/q1wgc4rKmTvuptFbXWGZvowFi4DbSKZ4ULQt/0KRmZOf7Hm8vRcCTNOUyaGJxsbwAZh7A m+Az/SBRMS2W0y5JtpRszxOQp2sIRBjVlzRW2A/bUbb67UjI1dKJvN/XwvQ2WnDYzmW7NojE/oM /C2xVgJ1IfjCHwObDUCL X-Google-Smtp-Source: AGHT+IE2PxHyAWGJwBqsd4XqiNnUfpUNBM6sb+RyGuOLvmBafepSZRle0SjnzsdkzlpqNK/+2dp1ng== X-Received: by 2002:a05:6214:e6a:b0:6d8:9b20:64e8 with SMTP id 6a1803df08f44-6e8e6d11d4amr25735466d6.10.1741156794196; Tue, 04 Mar 2025 22:39:54 -0800 (PST) Received: from localhost ([2001:da8:7001:11::cb]) by smtp.gmail.com with UTF8SMTPSA id 6a1803df08f44-6e8a2170bcasm62382096d6.34.2025.03.04.22.39.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Mar 2025 22:39:53 -0800 (PST) From: Inochi Amaoto To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen Wang , Inochi Amaoto , Maxime Coquelin , Alexandre Torgue , Richard Cochran , Paul Walmsley , Palmer Dabbelt , Albert Ou , Romain Gantois , Hariprasad Kelam , Jisheng Zhang , =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , "Jan Petrous (OSS)" , Simon Horman , Furong Xu <0x1207@gmail.com>, Lothar Rubusch , Joe Hattori , Bartosz Golaszewski , Giuseppe Cavallaro , Jose Abreu Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, sophgo@lists.linux.dev, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, Yixun Lan , Longbin Li , Krzysztof Kozlowski Subject: [PATCH net-next v6 1/4] dt-bindings: net: Add support for Sophgo SG2044 dwmac Date: Wed, 5 Mar 2025 14:39:13 +0800 Message-ID: <20250305063920.803601-2-inochiama@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250305063920.803601-1-inochiama@gmail.com> References: <20250305063920.803601-1-inochiama@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250304_223955_481688_1D71E996 X-CRM114-Status: GOOD ( 14.53 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org The GMAC IP on SG2044 is almost a standard Synopsys DesignWare MAC (version 5.30a) with some extra clock. Add necessary compatible string for this device. Signed-off-by: Inochi Amaoto Reviewed-by: Krzysztof Kozlowski --- .../devicetree/bindings/net/snps,dwmac.yaml | 4 + .../bindings/net/sophgo,sg2044-dwmac.yaml | 126 ++++++++++++++++++ 2 files changed, 130 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml index 91e75eb3f329..02ab6a9aded2 100644 --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml @@ -32,6 +32,7 @@ select: - snps,dwmac-4.20a - snps,dwmac-5.10a - snps,dwmac-5.20 + - snps,dwmac-5.30a - snps,dwxgmac - snps,dwxgmac-2.10 @@ -98,8 +99,10 @@ properties: - snps,dwmac-4.20a - snps,dwmac-5.10a - snps,dwmac-5.20 + - snps,dwmac-5.30a - snps,dwxgmac - snps,dwxgmac-2.10 + - sophgo,sg2044-dwmac - starfive,jh7100-dwmac - starfive,jh7110-dwmac - thead,th1520-gmac @@ -631,6 +634,7 @@ allOf: - snps,dwmac-4.20a - snps,dwmac-5.10a - snps,dwmac-5.20 + - snps,dwmac-5.30a - snps,dwxgmac - snps,dwxgmac-2.10 - st,spear600-gmac diff --git a/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml b/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml new file mode 100644 index 000000000000..4dd2dc9c678b --- /dev/null +++ b/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml @@ -0,0 +1,126 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/sophgo,sg2044-dwmac.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Sophgo SG2044 DWMAC glue layer + +maintainers: + - Inochi Amaoto + +select: + properties: + compatible: + contains: + enum: + - sophgo,sg2044-dwmac + required: + - compatible + +properties: + compatible: + items: + - const: sophgo,sg2044-dwmac + - const: snps,dwmac-5.30a + + reg: + maxItems: 1 + + clocks: + items: + - description: GMAC main clock + - description: PTP clock + - description: TX clock + + clock-names: + items: + - const: stmmaceth + - const: ptp_ref + - const: tx + + dma-noncoherent: true + + interrupts: + maxItems: 1 + + interrupt-names: + maxItems: 1 + + resets: + maxItems: 1 + + reset-names: + const: stmmaceth + +required: + - compatible + - reg + - clocks + - clock-names + - interrupts + - interrupt-names + - resets + - reset-names + +allOf: + - $ref: snps,dwmac.yaml# + +unevaluatedProperties: false + +examples: + - | + #include + + ethernet@30006000 { + compatible = "sophgo,sg2044-dwmac", "snps,dwmac-5.30a"; + reg = <0x30006000 0x4000>; + clocks = <&clk 151>, <&clk 152>, <&clk 154>; + clock-names = "stmmaceth", "ptp_ref", "tx"; + interrupt-parent = <&intc>; + interrupts = <296 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "macirq"; + resets = <&rst 30>; + reset-names = "stmmaceth"; + snps,multicast-filter-bins = <0>; + snps,perfect-filter-entries = <1>; + snps,aal; + snps,tso; + snps,txpbl = <32>; + snps,rxpbl = <32>; + snps,mtl-rx-config = <&gmac0_mtl_rx_setup>; + snps,mtl-tx-config = <&gmac0_mtl_tx_setup>; + snps,axi-config = <&gmac0_stmmac_axi_setup>; + status = "disabled"; + + gmac0_mtl_rx_setup: rx-queues-config { + snps,rx-queues-to-use = <8>; + snps,rx-sched-wsp; + queue0 {}; + queue1 {}; + queue2 {}; + queue3 {}; + queue4 {}; + queue5 {}; + queue6 {}; + queue7 {}; + }; + + gmac0_mtl_tx_setup: tx-queues-config { + snps,tx-queues-to-use = <8>; + queue0 {}; + queue1 {}; + queue2 {}; + queue3 {}; + queue4 {}; + queue5 {}; + queue6 {}; + queue7 {}; + }; + + gmac0_stmmac_axi_setup: stmmac-axi-config { + snps,blen = <16 8 4 0 0 0 0>; + snps,wr_osr_lmt = <1>; + snps,rd_osr_lmt = <2>; + }; + };