From patchwork Mon Oct 21 10:36:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 13843955 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 25193D0E6FA for ; Mon, 21 Oct 2024 11:45:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zgTXpRaa0CS94DWebND0XpyXT65bwzGX/MVLfeTayUc=; b=b0xG/rYGp50J4w9gkEzOIjc3kf 4vEOGGW0l8bdTyNPjqa0ZpEpwd36k4bNK9DL2DmNxnAD70ushhZ1ixv+cPz4h0umjr/ybMgjWXRyT Gggyed5UHFrczbarPv57MljX8eY+nxpI8/g02aNWiW4FOVFBkhq0Rk1xt7+bAExLNjvkp/t1tea72 nRKChUYS3m/XtcftA2euJQ9ixsagLuPsv95ZA+AbwuvRxWALgpsUlHlMhaC+w5tbDDVJV7Y39w8YL 9ta7u4dBW37xetLT0pM8CYp4LchaXWWY8gZJsfPLbVV33ROrZP9VwgMOljlsd4pqx59OdnPwJBOaw iLVi9zlA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t2qqm-000000075q7-24fa; Mon, 21 Oct 2024 11:45:28 +0000 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t2pmM-00000006uU4-19wN; Mon, 21 Oct 2024 10:36:51 +0000 Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-7d4fa972cbeso3358178a12.2; Mon, 21 Oct 2024 03:36:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729507009; x=1730111809; 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=zgTXpRaa0CS94DWebND0XpyXT65bwzGX/MVLfeTayUc=; b=DatMdYIs2RNY622C1jKymWL4S3QmrJo/i6Kbx6e6iuG0OkE2cfKWpVmdr/lZBvxeQd WFnSmwvKYk8uZKqtFcgu/5v/g0y9QAihhY3vYnjiDuK68o7WZZM0NXSdCY5fWM0Vu3/O WFHxVMwQ+6ZyC4B9/bxeQnLn30DByJglwzsN5I+sEjTdP32edqMpHn1otFqY5CKcxOl2 WmyIGayVffgu1M43r7lV1wV87W8Rm29P6IQ+WLRsm/3DM4xZKBZeNXxSXamzleWfP1rZ WQY+0v2PMQAFly1ukVITk5xiWk+6Gq9nK2ozDeGomJ3w6uAl7daaWcq6e9wjMO2X6Os1 /Bzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729507009; x=1730111809; 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=zgTXpRaa0CS94DWebND0XpyXT65bwzGX/MVLfeTayUc=; b=HkL9bLZzvGeAMQkqJJZLe/X/ZSuSgqOuqixQb2VqFCduGZGHcYMI64UbR6bsuzbJxx tUqqD60FfUBe3sl85aKFuBJLWJKGLx9YIyKQKmkJBCsDxsqxA8tkBOjAufx4a+6K1csC omqK3nxPNxB7COLQAj2DV5wuZhe0UTBYerxFUnXRu8c07XZ4xNbrmcDPj+Nx5hT/23Nu 2yQgqfCu+a6P/BDQQqgqlvUQzOl8nEf7trDFv3VsowBh+8i5so9WSPLnzKghFTGb/MDt pKPhmQb0M5RmYgVuKB42lJ4RY35QnAMTbNj4wyOdtTpStJDum8ORAd/0cJyJYEL/Fcum RLAA== X-Forwarded-Encrypted: i=1; AJvYcCV6CmelGJcxtPZ0YSAWadXh5QMzRQpNvy7BOZoz9qD3GNn+fs9b2pBWJLn0mKi9UGkxlU0vzf7jCjcIgDw=@lists.infradead.org, AJvYcCVaV+1+6tcR8kVMxSCBS7IlG28YnyAfgsrCyvtwNteKwvbNeajR5F7QJQW72YpzKgj+/NQsCAwA3BSCInofs/wQ@lists.infradead.org X-Gm-Message-State: AOJu0YyJa277HZI3Daa5jPxFnViIj0woryoh4a564aumOfryfw02OSRc mljnjqqJ+41rlK/8xz4F0MnyqNrlm2JttcbjOHGy81Wh3zFv++Im X-Google-Smtp-Source: AGHT+IHcfOB8KvzIPdr/4gmQUpcTvuERKiXFCsr6Yz6aTePpzQBGy3C9mW284sw41jWu8/yv/Ub+BA== X-Received: by 2002:a05:6300:44:b0:1d8:a759:525c with SMTP id adf61e73a8af0-1d92c572670mr15063786637.39.1729507009210; Mon, 21 Oct 2024 03:36:49 -0700 (PDT) Received: from localhost ([2001:da8:7001:11::cb]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20e7eee63a1sm23044785ad.18.2024.10.21.03.36.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2024 03:36:48 -0700 (PDT) From: Inochi Amaoto To: Chen Wang , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Inochi Amaoto , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Richard Cochran , Paul Walmsley , Palmer Dabbelt , Albert Ou , Giuseppe Cavallaro Cc: Yixun Lan , Inochi Amaoto , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org Subject: [PATCH 1/4] dt-bindings: net: snps,dwmac: Add dwmac-5.30a version Date: Mon, 21 Oct 2024 18:36:14 +0800 Message-ID: <20241021103617.653386-2-inochiama@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241021103617.653386-1-inochiama@gmail.com> References: <20241021103617.653386-1-inochiama@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241021_033650_337660_BE9880A9 X-CRM114-Status: UNSURE ( 8.49 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add compatible string for dwmac-5.30a IP. Signed-off-by: Inochi Amaoto --- Documentation/devicetree/bindings/net/snps,dwmac.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml index 4e2ba1bf788c..3c4007cb65f8 100644 --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml @@ -31,6 +31,7 @@ select: - snps,dwmac-4.20a - snps,dwmac-5.10a - snps,dwmac-5.20 + - snps,dwmac-5.30a - snps,dwxgmac - snps,dwxgmac-2.10 @@ -95,6 +96,7 @@ properties: - snps,dwmac-4.20a - snps,dwmac-5.10a - snps,dwmac-5.20 + - snps,dwmac-5.30a - snps,dwxgmac - snps,dwxgmac-2.10 - starfive,jh7100-dwmac @@ -627,6 +629,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 From patchwork Mon Oct 21 10:36:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 13843892 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 05EDAD0E6EE for ; Mon, 21 Oct 2024 10:41:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ROalFAeuv2FT5XJcCDsa2eyjiagS1IAfhK+ybSBBNOk=; b=1WCfDnwqNlhy2gusdOtxvB0wrS ywgRgBwxpqTfqP1tfDHlSEdNUiOv0l5l4NSkyHu/4qmZRVOSoma679i0TkoEcUHoL+Mxi5RNk3xBQ uSPK650eT6GOpd+iyJ+GeXwc3RCW6NjfA1FSD9PUt3PsUtghUoQ5xvLaZWIwQXbBaic7HuugfuJUV 6VcxldVm2+GlG0ERe9Pkv6v/YoWJMCC0Pe4bdmhL0klUoPPLdhXslr0dnhvGSXiZDlDOi3awLamjI FujNj90Ckjq5V8YQLgrPbc6iWDV+1G3khF6WZf9IuikpAzyQgO1+QUQ7chl/jXrpr4wftA4uvaOtr pVTS81lg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t2pqk-00000006vGF-2Zkr; Mon, 21 Oct 2024 10:41:22 +0000 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t2pmO-00000006uUl-1Ulq; Mon, 21 Oct 2024 10:36:54 +0000 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-20cdbe608b3so34641135ad.1; Mon, 21 Oct 2024 03:36:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729507011; x=1730111811; 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=ROalFAeuv2FT5XJcCDsa2eyjiagS1IAfhK+ybSBBNOk=; b=FjjyGw0oZdTC1EfxciLl8HB6w1iFiegonUvD/kdiUTVY4d//NbEB/hqlAPDCcN2EHC dy3XWDJCgNsmRtn5YuZ9wZo1P7aMuun2pJREK7uuhFmjdhPeROn4x3B1wtS0StHMSsXx 3RwNQcFXFT2sA5lNujlotvdz9eKk431hrJxLh1c8kVctIEMfhy57azZByxQp5pNmtz4u iuX3Bde4FyVUfy3iqhvFVPmYCMH0V4g/Zu9RLgCjDACWZLhacZjqFhA9QrB3pLMkunj2 1mq1pFHgL/O+OHP34may2cxcIJ1aV1jpbprqsLzXIAHRQSDjihedpwD8x1D93GmpndX1 G0fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729507011; x=1730111811; 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=ROalFAeuv2FT5XJcCDsa2eyjiagS1IAfhK+ybSBBNOk=; b=YfZFf3Digv3z/MwXyeCuZp0GqiT2rwX1jBUNqBgre9Cal5X2b4+gJZ4LhbLldJ/QOM wtPficlMXziiyvh6reaqUddWF6gPAJ+rric5V1XkFkhpfGOeSoft60wfVKzUaBM78qMy 9r+6rMGLbbHakg+xgGMeuacYTmvHYccv5z1YnzxcoFJfQjQAlcnyY8Z9Cs1cwxxq1wvh Jj60tUsk0XLHZHIUG/4dyV4uIn2PJS+GuRg6wl2uOnHLn8sdQBliYTa+Q0o/g7PwK2Qw LD+cavFxE2061Qwt9AWmkX7wbUSZKmPEUnZuoZO1LkZDl5gaCTfZAgimBSjKCSLfXuzQ wAkg== X-Forwarded-Encrypted: i=1; AJvYcCVJhe2hO26YCTieyFLc4r686qDMIcdglYoKgCWMDJxlUPKpDVIz9mx8mmHyu/LsRDqht9+ka6LqOEPYHEXmlIje@lists.infradead.org, AJvYcCXct8MhyXSzRoVTuhcweGRsEMoXcaOujp6HRjAESLeySjYdQd7Xie24sEDvp6ayCPPHgLtgXylJMYKK84c=@lists.infradead.org X-Gm-Message-State: AOJu0YycJ/xIMCmZBnEeajhTP+dvjLvnlmgA9f5zVh6IrvkFLejfcFVh hQaZ7X+ad+WVrVBIDVqpAydLlutPmvpfDqRsdkB/xCeib9a7yFfG X-Google-Smtp-Source: AGHT+IGtGQdZs96OgFnH+jxQO02blnd9Mr30IOhQfnSRFPAMbUhlzzNhum28G7bu+yZXf1ru9cnQAw== X-Received: by 2002:a17:902:e846:b0:20c:a8cf:fa25 with SMTP id d9443c01a7336-20e5a9339efmr140267755ad.46.1729507011181; Mon, 21 Oct 2024 03:36:51 -0700 (PDT) Received: from localhost ([2001:da8:7001:11::cb]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20e7f0c0e5asm22850335ad.167.2024.10.21.03.36.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2024 03:36:50 -0700 (PDT) From: Inochi Amaoto To: Chen Wang , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Inochi Amaoto , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Richard Cochran , Paul Walmsley , Palmer Dabbelt , Albert Ou , Giuseppe Cavallaro Cc: Yixun Lan , Inochi Amaoto , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org Subject: [PATCH 2/4] dt-bindings: net: Add support for Sophgo SG2044 dwmac Date: Mon, 21 Oct 2024 18:36:15 +0800 Message-ID: <20241021103617.653386-3-inochiama@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241021103617.653386-1-inochiama@gmail.com> References: <20241021103617.653386-1-inochiama@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241021_033652_423694_1AF69B4D X-CRM114-Status: GOOD ( 16.17 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The GMAC IP on SG2044 is almost a standard Synopsys DesignWare MAC with some extra clock. Add necessary compatible string for this device. Signed-off-by: Inochi Amaoto --- .../devicetree/bindings/net/snps,dwmac.yaml | 1 + .../bindings/net/sophgo,sg2044-dwmac.yaml | 145 ++++++++++++++++++ 2 files changed, 146 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 3c4007cb65f8..69f6bb36970b 100644 --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml @@ -99,6 +99,7 @@ properties: - snps,dwmac-5.30a - snps,dwxgmac - snps,dwxgmac-2.10 + - sophgo,sg2044-dwmac - starfive,jh7100-dwmac - starfive,jh7110-dwmac 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..93c41550b0b6 --- /dev/null +++ b/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml @@ -0,0 +1,145 @@ +# 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: StarFive JH7110 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 + + sophgo,syscon: + $ref: /schemas/types.yaml#/definitions/phandle-array + items: + - items: + - description: phandle to syscon that configures phy + - description: offset of phy mode register + - description: length of the phy mode register + description: + A phandle to syscon with two arguments that configure phy mode. + The argument one is the offset of phy mode register, the + argument two is the length of phy mode register. + +required: + - compatible + - reg + - clocks + - clock-names + - interrupts + - interrupt-names + - resets + - reset-names + +allOf: + - $ref: snps,dwmac.yaml# + + - if: + properties: + compatible: + contains: + const: sophgo,sg2044-dwmac + then: + properties: + interrupts: + minItems: 1 + maxItems: 1 + + interrupt-names: + minItems: 1 + maxItems: 1 + + resets: + maxItems: 1 + + reset-names: + const: stmmaceth + +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>; + }; + }; From patchwork Mon Oct 21 10:36:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 13843896 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 77EAAD0E6EE for ; Mon, 21 Oct 2024 10:43:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ObJWQqbamWQLgW3lRvM1Wb6QskCzdsvaBlS+OW3U2H4=; b=P4zHaQkML4Wk4ke+Yce2jWWoX7 14sYVwFy5YR9S9WWK8vrFAwLodWZP37LBPQ4GdHkdqrwYuehHBGEtA6i3NA3pPQaWo4G81WEcPB6n WbjaYPJT2MIzRTK6yEZVX8XshBgI8FrNVIM1nXZkcwTu+vS8cMF0kSD+yx+TkrbF78omZtZYnnhGt SW83WupGMelxziykSXuKiT2Somh15i/BvSv4M3v+c1ALlZPQ30tdS+TkuSJRrVuW7FvOZWSEielCs u3Xa5P3+V34fmqPtSXAurumzl1V7hcCnyTm1BfLRy1lEA10HtCHB/HBVRHt/i8bR/KRN9vJmtxUUu SbLiVNqw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t2psD-00000006vdY-2vsI; Mon, 21 Oct 2024 10:42:53 +0000 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t2pmQ-00000006uVQ-0VaZ; Mon, 21 Oct 2024 10:36:55 +0000 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-71e49ad46b1so2938361b3a.1; Mon, 21 Oct 2024 03:36:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729507013; x=1730111813; 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=ObJWQqbamWQLgW3lRvM1Wb6QskCzdsvaBlS+OW3U2H4=; b=D7KuLUwK2AvwjqSb+bwXqA+qWw4qHFTOJMQeVtooSlVQa35MuUf+vAEyqIIfOy1Rx1 lYf4g4hum7lE1d67yzsUjDgMqIXJpqJwVrileq3WR3O4RFcf0bn7EylBHoGMXlnzMVEU hHogH8lCkvEFVCdEnmGbH0KyBwu1poaO/9hRV7e1onpwqdYU4IkKsRXRwiu0b6uVSCfF t2PHW0qpe9rx6MRrC66QkGETvQna47MVXea4VNyuJ6aFZEA0hI5yXpAR26+VfkdAe/ic S4gZ+W6Epagi1/ykqHIjlUY0i0zMhV2ZL78GQw6m6qz0e0pjJWnVL00jnnZ6Pr3xKYFf sjFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729507013; x=1730111813; 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=ObJWQqbamWQLgW3lRvM1Wb6QskCzdsvaBlS+OW3U2H4=; b=hEqATh7QO93L0Dd3F+mWqLukNnbFbJeJl+I3aSJEL8crtykaTaqN224WTV7QSKFgEA 9NvUydKHm43eGFRIctBVNVaSmZ/i5BA8BXoyNYUFr0qe9aJOMV1yWftrQoYRvEFQAGIU ZNqa65oo33E3oL7L7ByXdoO8WiyRdS/Dg47k5NwxozUIwYnkQaAwHKyEhvWoRkxhRKx9 2s6uk+5Kr/1Y1iLmgLXhZR48TCxJrBMWqIMWY5JhNacfUkXxzxbUqh3c1bfulb5a9Eo7 IDnPMfjVN9YlvdiwzZIPyjSHJRNrVW/9cucM0T9p/QgC6Qc4rx6BCpIRZKbtlkMSon8i MF1A== X-Forwarded-Encrypted: i=1; AJvYcCUOA3cQsGpc75WLM9/2Q8BfDHUVSj1baM2j4T1Ql8LlBVKABiZNahl6AQPEPDhB0QRZiMWy0Bmcw8JwOHA=@lists.infradead.org, AJvYcCWFcM606AbTZOkvZWJPBF+KfEq7/nn+BvoPOWvueD6CeibcS+7WCAB+OTgP4h2b0GcKRy7CKNZqkrzNsZBjqDW+@lists.infradead.org X-Gm-Message-State: AOJu0YznMIGdn+48+oC6KSThkTOD/siXFjNOdeUx+nZBm6gyo05HUEsL 9ykK1GjMUMNfd65mCNJxKp8x/yl4rzW62Ti2hHuVij+GIrgR7Ig/ X-Google-Smtp-Source: AGHT+IH92yYXC4eqDoteqMVnaKaZwnewH6U4taRuuS75GAekpZY3rtWoFcqSB+3PqyFf4WP9/QcVHw== X-Received: by 2002:a05:6a00:23d1:b0:71e:6f63:f076 with SMTP id d2e1a72fcca58-71ea31927d8mr16089602b3a.5.1729507013033; Mon, 21 Oct 2024 03:36:53 -0700 (PDT) Received: from localhost ([2001:da8:7001:11::cb]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71ec132ffc3sm2556008b3a.62.2024.10.21.03.36.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2024 03:36:52 -0700 (PDT) From: Inochi Amaoto To: Chen Wang , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Inochi Amaoto , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Richard Cochran , Paul Walmsley , Palmer Dabbelt , Albert Ou , Giuseppe Cavallaro Cc: Yixun Lan , Inochi Amaoto , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org Subject: [PATCH 3/4] net: stmmac: platform: Add snps,dwmac-5.30a IP compatible string Date: Mon, 21 Oct 2024 18:36:16 +0800 Message-ID: <20241021103617.653386-4-inochiama@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241021103617.653386-1-inochiama@gmail.com> References: <20241021103617.653386-1-inochiama@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241021_033654_320710_F680D628 X-CRM114-Status: GOOD ( 10.29 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add "snps,dwmac-5.30a" compatible string for 5.30a version that can avoid to define some platform data in the glue layer. Signed-off-by: Inochi Amaoto --- drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index ad868e8d195d..3c4e78b10dd6 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -555,7 +555,8 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) of_device_is_compatible(np, "snps,dwmac-4.10a") || of_device_is_compatible(np, "snps,dwmac-4.20a") || of_device_is_compatible(np, "snps,dwmac-5.10a") || - of_device_is_compatible(np, "snps,dwmac-5.20")) { + of_device_is_compatible(np, "snps,dwmac-5.20") || + of_device_is_compatible(np, "snps,dwmac-5.30a")) { plat->has_gmac4 = 1; plat->has_gmac = 0; plat->pmt = 1; From patchwork Mon Oct 21 10:36:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 13843897 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 74410D0E6F0 for ; Mon, 21 Oct 2024 10:44:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=svclsiCEeUb5+9t03qJl3db9yymwfO2bBzTcRxMC9P8=; b=oCnxn8yDsQ9DiNg8KPzdr+ETOF ayv3wZDRchrFnI+YUjZP3rCLGXzljwh8QncjD97e5/9vfyW2p4ms8YWpUVMdNUzCJZp63DGedTI0C ISTAltECrYzQflU7Yb9OnIJ52fkW9RORToNEqFgV4MGA4VrZg0FSZ6Y+F/3oQesya3et/ox/MAWe6 L3npVRgg7WkTBzvLzaYjubU6rxJXL4huUDlvWcPs5yIta1nzOIinqmRyISRGdzDJCZ+16E+rHmPcv XyRX4/Q5tLN4W+jt7o1/kxiKCyUVAWTVRNrmnoYyb+Mt056kQ5Kra7WqL8Tx6qfSW8FC1dIPIO89K WK3TGdow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t2ptf-00000006vuI-2Vi4; Mon, 21 Oct 2024 10:44:23 +0000 Received: from mail-yb1-xb36.google.com ([2607:f8b0:4864:20::b36]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t2pmV-00000006uWF-1uC8; Mon, 21 Oct 2024 10:37:00 +0000 Received: by mail-yb1-xb36.google.com with SMTP id 3f1490d57ef6-e2974743675so3779566276.1; Mon, 21 Oct 2024 03:36:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729507017; x=1730111817; 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=svclsiCEeUb5+9t03qJl3db9yymwfO2bBzTcRxMC9P8=; b=J/ZR0CwmZ/QW+Ubkdi7ijlpa+qgzUbQmvB0+icjS+zfxELTR2k6uyUixqnfHl5TPR8 YPJayjqRERa5M87j2Ew//CuT9rrpsSstB5LZl9f4yRT6YZRqRlp3efLnWAOFjESDZ453 W2KboZ6t0LTffZwidkvPTpaLpdtvE0dRDnkh79OGko39t6yPHJUww8buZ198aVkG/Fvw k7ULAGrXCa8uLLlhwGySNdObtD3E7cOIFwtor7K4PF4s1cedQlzLN92y/uSXu0g0IHTT O25xFp/xrnJy0Ks/sTsJAV6zz1Q13OoCgvib9oVMcY5Otk+oI/Inr40PN4TIZroKP46A ex9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729507017; x=1730111817; 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=svclsiCEeUb5+9t03qJl3db9yymwfO2bBzTcRxMC9P8=; b=f3zicsqHX0nItH+qvwoC+PRbrlBuaiGqtJDslA41JJnTpP7Ydi+/Ut9gMKSqCxGeOP PeNx7oZLde5mz6QZUb+JzwdQCQ8KkeFKDiCmJBtuVjCwdaSqhvOF74tGSv3OThtdJJio K9Pg4SQxMra28SSBn47mSMGpPoaZHf31zhwZ/KNEX2Bb7L55en8JDOJGgf2Vxog5JH7g UkCRyT+6grJaw4/7sk+3m3MppcDPlPAkKFXiM2IV4ZW7uAmd9yH5PAA38sgczbBGom1l zgkGnMd9zww0+QFZSx16H4KMTP81GNsUOQqs2F8+dhjJyOU+bkzrlm9ahKL80cvO0kc+ a0hQ== X-Forwarded-Encrypted: i=1; AJvYcCVeWZjrMbIRLBji8q8JcTs1DmjS/ASzScpnqZ3b5pCfiRaOw6H9YoMr3IuDcQpIDF2WuHucrrAsddNeQLs=@lists.infradead.org, AJvYcCXDWGgBltQ8SpO21Z1AEgM36wElvzbh9YOkniIKP2C5jzHY0GY/3VIooaosqA2QjU99QE6MAKI0TQZbHJhwBgTp@lists.infradead.org X-Gm-Message-State: AOJu0Ywuy9MM1KdXQQgIaChz8PMzDUIhfhluVq2BhpHgcHbWD73THfk6 FnYI7GBsis0QLmHi3vrDOXXuKO7tlpJHMcIUEow6Fclb1akKmjAD X-Google-Smtp-Source: AGHT+IHlrA+/dcj1vd4lrPU9QHu+0p+ysA9RIWhCRIkhzXUN8cuwR3GxzlOFB2/p619LdCBVuIUTOA== X-Received: by 2002:a05:6902:1b8b:b0:e29:1572:6d03 with SMTP id 3f1490d57ef6-e2bb16cf119mr9061983276.47.1729507015417; Mon, 21 Oct 2024 03:36:55 -0700 (PDT) Received: from localhost ([2001:da8:7001:11::cb]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7eaeabd8dc8sm2772799a12.77.2024.10.21.03.36.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2024 03:36:55 -0700 (PDT) From: Inochi Amaoto To: Chen Wang , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Inochi Amaoto , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Richard Cochran , Paul Walmsley , Palmer Dabbelt , Albert Ou , Giuseppe Cavallaro Cc: Yixun Lan , Inochi Amaoto , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org Subject: [PATCH 4/4] net: stmmac: Add glue layer for Sophgo SG2044 SoC Date: Mon, 21 Oct 2024 18:36:17 +0800 Message-ID: <20241021103617.653386-5-inochiama@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241021103617.653386-1-inochiama@gmail.com> References: <20241021103617.653386-1-inochiama@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241021_033659_517500_180C0437 X-CRM114-Status: GOOD ( 22.50 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Adds Sophgo dwmac driver support on the Sophgo SG2044 SoC. Signed-off-by: Inochi Amaoto --- drivers/net/ethernet/stmicro/stmmac/Kconfig | 11 ++ drivers/net/ethernet/stmicro/stmmac/Makefile | 1 + .../ethernet/stmicro/stmmac/dwmac-sophgo.c | 132 ++++++++++++++++++ 3 files changed, 144 insertions(+) create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig index 05cc07b8f48c..bc44b21c593f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/Kconfig +++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig @@ -169,6 +169,17 @@ config DWMAC_SOCFPGA for the stmmac device driver. This driver is used for arria5 and cyclone5 FPGA SoCs. +config DWMAC_SOPHGO + tristate "Sophgo dwmac support" + depends on OF && (ARCH_SOPHGO || COMPILE_TEST) + default m if ARCH_SOPHGO + help + Support for ethernet controllers on Sophgo RISC-V SoCs + + This selects the Sophgo SoC specific glue layer support + for the stmmac device driver. This driver is used for the + ethernet controllers on various Sophgo SoCs. + config DWMAC_STARFIVE tristate "StarFive dwmac support" depends on OF && (ARCH_STARFIVE || COMPILE_TEST) diff --git a/drivers/net/ethernet/stmicro/stmmac/Makefile b/drivers/net/ethernet/stmicro/stmmac/Makefile index c2f0e91f6bf8..e1287b53047b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/Makefile +++ b/drivers/net/ethernet/stmicro/stmmac/Makefile @@ -23,6 +23,7 @@ obj-$(CONFIG_DWMAC_QCOM_ETHQOS) += dwmac-qcom-ethqos.o obj-$(CONFIG_DWMAC_ROCKCHIP) += dwmac-rk.o obj-$(CONFIG_DWMAC_RZN1) += dwmac-rzn1.o obj-$(CONFIG_DWMAC_SOCFPGA) += dwmac-altr-socfpga.o +obj-$(CONFIG_DWMAC_SOPHGO) += dwmac-sophgo.o obj-$(CONFIG_DWMAC_STARFIVE) += dwmac-starfive.o obj-$(CONFIG_DWMAC_STI) += dwmac-sti.o obj-$(CONFIG_DWMAC_STM32) += dwmac-stm32.o diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c new file mode 100644 index 000000000000..83c67c061182 --- /dev/null +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c @@ -0,0 +1,132 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Sophgo DWMAC platform driver + * + * Copyright (C) 2024 Inochi Amaoto + * + */ + +#include +#include +#include +#include +#include +#include + +#include "stmmac_platform.h" + +struct sophgo_dwmac { + struct device *dev; + struct clk *clk_tx; +}; + +#define DWMAC_SG2044_FLAG_USE_RX_DELAY BIT(16) + +static void sophgo_dwmac_fix_mac_speed(void *priv, unsigned int speed, unsigned int mode) +{ + struct sophgo_dwmac *dwmac = priv; + unsigned long rate; + int ret; + + switch (speed) { + case SPEED_1000: + rate = 125000000; + break; + case SPEED_100: + rate = 25000000; + break; + case SPEED_10: + rate = 2500000; + break; + default: + dev_err(dwmac->dev, "invalid speed %u\n", speed); + break; + } + + ret = clk_set_rate(dwmac->clk_tx, rate); + if (ret) + dev_err(dwmac->dev, "failed to set tx rate %lu\n", rate); +} + +static int sophgo_sg2044_dwmac_init(struct platform_device *pdev, + struct plat_stmmacenet_data *plat_dat, + struct stmmac_resources *stmmac_res) +{ + struct sophgo_dwmac *dwmac; + struct regmap *regmap; + unsigned int args[2]; + int ret; + + dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL); + if (!dwmac) + return -ENOMEM; + + dwmac->clk_tx = devm_clk_get_enabled(&pdev->dev, "tx"); + if (IS_ERR(dwmac->clk_tx)) + return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_tx), + "failed to get tx clock\n"); + + regmap = syscon_regmap_lookup_by_phandle_args(pdev->dev.of_node, + "sophgo,syscon", + 2, args); + if (IS_ERR(regmap)) + return dev_err_probe(&pdev->dev, PTR_ERR(regmap), + "failed to get the regmap\n"); + + ret = regmap_set_bits(regmap, args[0], DWMAC_SG2044_FLAG_USE_RX_DELAY); + if (ret) + return dev_err_probe(&pdev->dev, ret, + "failed to set the phy rx delay\n"); + + dwmac->dev = &pdev->dev; + plat_dat->bsp_priv = dwmac; + plat_dat->flags |= STMMAC_FLAG_SPH_DISABLE; + plat_dat->fix_mac_speed = sophgo_dwmac_fix_mac_speed; + plat_dat->multicast_filter_bins = 0; + plat_dat->unicast_filter_entries = 1; + + return 0; +} + +static int sophgo_dwmac_probe(struct platform_device *pdev) +{ + struct plat_stmmacenet_data *plat_dat; + struct stmmac_resources stmmac_res; + int ret; + + ret = stmmac_get_platform_resources(pdev, &stmmac_res); + if (ret) + return dev_err_probe(&pdev->dev, ret, + "failed to get resources\n"); + + plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac); + if (IS_ERR(plat_dat)) + return dev_err_probe(&pdev->dev, PTR_ERR(plat_dat), + "dt configuration failed\n"); + + ret = sophgo_sg2044_dwmac_init(pdev, plat_dat, &stmmac_res); + if (ret) + return ret; + + return stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); +} + +static const struct of_device_id sophgo_dwmac_match[] = { + { .compatible = "sophgo,sg2044-dwmac" }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, sophgo_dwmac_match); + +static struct platform_driver sophgo_dwmac_driver = { + .probe = sophgo_dwmac_probe, + .remove_new = stmmac_pltfr_remove, + .driver = { + .name = "sophgo-dwmac", + .pm = &stmmac_pltfr_pm_ops, + .of_match_table = sophgo_dwmac_match, + }, +}; +module_platform_driver(sophgo_dwmac_driver); + +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Sophgo DWMAC platform driver");