From patchwork Fri Jan 6 02:59:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yanhong wang X-Patchwork-Id: 13090823 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 4E173C3DA7A for ; Fri, 6 Jan 2023 03:01:11 +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=EdkZymSYEGQyF9KCN9j4FltqdJrK6kdWax0YaLs+abI=; b=VCW/TM+PZa1Ujk L9n/FFT0f0/hzQb1tMdjhXZlk6IkaJBaIWdiVR1ItCvRChv1VfBzlo60FqFpgyisyByqERBRji6cz tkCwbkWBmRCfXr5guZkMzMRIBuRTD/P4UVNnk+Mq9jA4IW5a9PtT+UmxgdW2r85qiFtk9SESm0CQZ Bfrks4OPtY3PUOGwELYqaSMjvISV2XdTEA3xs1yn8lC1prEF6BkDMQyZrI6Qln8Q+hpkR4zO1c/2z wejeAc1cWMnCLpZoq9LuExPO/mpqgGe2vXTUkloCxGkSNwz0P+mqLQ4/aEWRorj9KaozTr2+woREA 1DvTfKW5ZHWnuBs8jEdA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDcyY-00HMjM-H6; Fri, 06 Jan 2023 03:00:59 +0000 Received: from ex01.ufhost.com ([61.152.239.75]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDcyQ-00HMOv-Jh for linux-riscv@lists.infradead.org; Fri, 06 Jan 2023 03:00:52 +0000 Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id BDDED24E1DF; Fri, 6 Jan 2023 11:00:04 +0800 (CST) Received: from EXMBX173.cuchost.com (172.16.6.93) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 6 Jan 2023 11:00:04 +0800 Received: from wyh-VirtualBox.starfivetech.com (171.223.208.138) by EXMBX173.cuchost.com (172.16.6.93) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 6 Jan 2023 11:00:03 +0800 From: Yanhong Wang To: , , , CC: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Emil Renner Berthing , Richard Cochran , Andrew Lunn , Heiner Kallweit , Peter Geis , Yanhong Wang Subject: [PATCH v3 1/7] dt-bindings: net: snps,dwmac: Add dwmac-5.20 version Date: Fri, 6 Jan 2023 10:59:55 +0800 Message-ID: <20230106030001.1952-2-yanhong.wang@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230106030001.1952-1-yanhong.wang@starfivetech.com> References: <20230106030001.1952-1-yanhong.wang@starfivetech.com> MIME-Version: 1.0 X-Originating-IP: [171.223.208.138] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX173.cuchost.com (172.16.6.93) X-YovoleRuleAgent: yovoleflag X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230105_190050_988218_7A3D72A5 X-CRM114-Status: UNSURE ( 8.97 ) X-CRM114-Notice: Please train this message. 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 From: Emil Renner Berthing Add dwmac-5.20 IP version to snps.dwmac.yaml Signed-off-by: Emil Renner Berthing Signed-off-by: Yanhong Wang Acked-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/net/snps,dwmac.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml index 13b984076af5..e26c3e76ebb7 100644 --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml @@ -30,6 +30,7 @@ select: - snps,dwmac-4.10a - snps,dwmac-4.20a - snps,dwmac-5.10a + - snps,dwmac-5.20 - snps,dwxgmac - snps,dwxgmac-2.10 @@ -87,6 +88,7 @@ properties: - snps,dwmac-4.10a - snps,dwmac-4.20a - snps,dwmac-5.10a + - snps,dwmac-5.20 - snps,dwxgmac - snps,dwxgmac-2.10 @@ -393,6 +395,7 @@ allOf: - snps,dwmac-3.50a - snps,dwmac-4.10a - snps,dwmac-4.20a + - snps,dwmac-5.20 - snps,dwxgmac - snps,dwxgmac-2.10 - st,spear600-gmac @@ -447,6 +450,7 @@ allOf: - snps,dwmac-4.10a - snps,dwmac-4.20a - snps,dwmac-5.10a + - snps,dwmac-5.20 - snps,dwxgmac - snps,dwxgmac-2.10 - st,spear600-gmac From patchwork Fri Jan 6 02:59:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yanhong wang X-Patchwork-Id: 13090816 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 1851FC3DA7A for ; Fri, 6 Jan 2023 03:01: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: 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=8BZ1kAsiC2dUMvut/4ZxqFltvAEDGbQPBbU7aB5XAzs=; b=dx/E+1FtSctOqz NcYUhz2qw6svfjrvY9Euim7MlPs9CnrqD5C2pOX1Eev7G75OEk6NWPbzngmdaMrpI5EoPoZ/xICrh fKVngda3r2xggroSyd3y8GAGbMIhURxRRmkdni8mQjfw3aOmMfbxuLxisznXyDnrOrlW6xCQi2p9B uE/YjZC6IxML16f4p483NYTfCk/8kF35YrN2qAFFC3WNDKv7sq3l9qRAD0hqt9I4WmDC/+lb6bjbo 6DGzDIDcmuHQLuLSI2gyXwUbFOWG/WX2vel4aegg54UO0K1T3f4aY4hM12Cnr3C9EkdShnAqvp3Vf 0sibXDWIKh+kgtnjQFnw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDcyS-00HMfG-Tn; Fri, 06 Jan 2023 03:00:52 +0000 Received: from ex01.ufhost.com ([61.152.239.75]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDcyQ-00HMOx-1d for linux-riscv@lists.infradead.org; Fri, 06 Jan 2023 03:00:51 +0000 Received: from EXMBX166.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX166", Issuer "EXMBX166" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id 9130B24E1D3; Fri, 6 Jan 2023 11:00:05 +0800 (CST) Received: from EXMBX173.cuchost.com (172.16.6.93) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 6 Jan 2023 11:00:05 +0800 Received: from wyh-VirtualBox.starfivetech.com (171.223.208.138) by EXMBX173.cuchost.com (172.16.6.93) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 6 Jan 2023 11:00:04 +0800 From: Yanhong Wang To: , , , CC: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Emil Renner Berthing , Richard Cochran , Andrew Lunn , Heiner Kallweit , Peter Geis , Yanhong Wang Subject: [PATCH v3 2/7] dt-bindings: net: snps,dwmac: Update the maxitems number of resets and reset-names Date: Fri, 6 Jan 2023 10:59:56 +0800 Message-ID: <20230106030001.1952-3-yanhong.wang@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230106030001.1952-1-yanhong.wang@starfivetech.com> References: <20230106030001.1952-1-yanhong.wang@starfivetech.com> MIME-Version: 1.0 X-Originating-IP: [171.223.208.138] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX173.cuchost.com (172.16.6.93) X-YovoleRuleAgent: yovoleflag X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230105_190050_271877_BF4613B0 X-CRM114-Status: UNSURE ( 9.77 ) X-CRM114-Notice: Please train this message. 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 Some boards(such as StarFive VisionFive v2) require more than one value which defined by resets property, so the original definition can not meet the requirements. In order to adapt to different requirements, adjust the maxitems number definition. Signed-off-by: Yanhong Wang --- .../devicetree/bindings/net/snps,dwmac.yaml | 36 ++++++++++++++----- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml index e26c3e76ebb7..f7693e8c8d6d 100644 --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml @@ -132,14 +132,6 @@ properties: - pclk - ptp_ref - resets: - maxItems: 1 - description: - MAC Reset signal. - - reset-names: - const: stmmaceth - power-domains: maxItems: 1 @@ -463,6 +455,34 @@ allOf: Enables the TSO feature otherwise it will be managed by MAC HW capability register. + - if: + properties: + compatible: + contains: + const: starfive,jh7110-dwmac + + then: + properties: + resets: + minItems: 2 + maxItems: 2 + reset-names: + items: + - const: stmmaceth + - const: ahb + required: + - resets + - reset-names + else: + properties: + resets: + maxItems: 1 + description: + MAC Reset signal. + + reset-names: + const: stmmaceth + additionalProperties: true examples: From patchwork Fri Jan 6 02:59:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yanhong wang X-Patchwork-Id: 13090815 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 6CF8BC3DA7A for ; Fri, 6 Jan 2023 03:00:53 +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=UZn/QnVW8m2Xm5hmGuyinaSfs5BiX9hcKeQXqBajdt4=; b=GAWPL8B6gfbBpU e53FtYd1cym0gSAiT2XNTfGxtwDNLDgXSAbOcugoihIlKZmJoMe2IvYIJKOPRVNyv0NKLRUtEv3bn wa/JdCivD0PopndHNoNtMHOUt6K5GT863orFu/JxHvDruz3+GEVtwwM3VlrOj9yIRijxuVyhFc3lv arDevIa5SQ88YPadLIkubCf+5QtLmxvzfoK/WdyZ8xJKIxQRqy56P+5Y7qJtMt6iLzdkSmrq6vlHG xj1ar/ZUceIOkBGb5kWgp4n3lOnCdmhEJ7piBY5l2EC+613c4e+h7sqxFka0NlqjC1vj5qrPBLrCu tu2gq4aIhorreyHpGT3g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDcyK-00HMae-7P; Fri, 06 Jan 2023 03:00:44 +0000 Received: from fd01.gateway.ufhost.com ([61.152.239.71]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDcyG-00HMRC-75 for linux-riscv@lists.infradead.org; Fri, 06 Jan 2023 03:00:42 +0000 Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id 8564D24E115; Fri, 6 Jan 2023 11:00:06 +0800 (CST) Received: from EXMBX173.cuchost.com (172.16.6.93) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 6 Jan 2023 11:00:06 +0800 Received: from wyh-VirtualBox.starfivetech.com (171.223.208.138) by EXMBX173.cuchost.com (172.16.6.93) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 6 Jan 2023 11:00:04 +0800 From: Yanhong Wang To: , , , CC: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Emil Renner Berthing , Richard Cochran , Andrew Lunn , Heiner Kallweit , Peter Geis , Yanhong Wang Subject: [PATCH v3 3/7] net: stmmac: platform: Add snps,dwmac-5.20 IP compatible string Date: Fri, 6 Jan 2023 10:59:57 +0800 Message-ID: <20230106030001.1952-4-yanhong.wang@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230106030001.1952-1-yanhong.wang@starfivetech.com> References: <20230106030001.1952-1-yanhong.wang@starfivetech.com> MIME-Version: 1.0 X-Originating-IP: [171.223.208.138] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX173.cuchost.com (172.16.6.93) X-YovoleRuleAgent: yovoleflag X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230105_190040_479253_31FACAFF X-CRM114-Status: GOOD ( 11.28 ) 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 From: Emil Renner Berthing Add "snps,dwmac-5.20" compatible string for 5.20 version that can avoid to define some platform data in the glue layer. Signed-off-by: Emil Renner Berthing Signed-off-by: Yanhong Wang --- 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 50f6b4a14be4..cc3b701af802 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -519,7 +519,8 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) if (of_device_is_compatible(np, "snps,dwmac-4.00") || 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.10a") || + of_device_is_compatible(np, "snps,dwmac-5.20")) { plat->has_gmac4 = 1; plat->has_gmac = 0; plat->pmt = 1; From patchwork Fri Jan 6 02:59:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yanhong wang X-Patchwork-Id: 13090817 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 6825CC53210 for ; Fri, 6 Jan 2023 03:01: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: 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=zhiqqeJDgvkzfOA/yzFw5X1PLQr+duQ/VhzdjiIJ2rs=; b=cwdA18urntHkPJ HCmu3ZUw4EpVLs+BXpkh5kxwDeYiYIEJajuqvPsvm8HnCjB7wlZkRKQFoQSRS40QnD67fa+FlV5jb 6A+bLuLr2RFFB6Ia3sY3DJKJWOYcUOXiUg2nRpAFXYMHKY63E7JvKnJOoVjL6kU7y8oizSFHMsMPM Vn5Ja7MIgVdyODEgfkhZkT/NprCmmYz+f6W07ik2tsSR7TiYhy5kP+RmwiJ4djuJP98icAny+Mmnc 8+8QIuyEY4iLlalDHKDSx2BzxlazwYu07Xpfm8eMWlmYzWy9sIMcjomKIIXOui4bX24vqGeZw6qOZ xkGZtZH9qYWQEuS/bQHg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDcyU-00HMgY-Qx; Fri, 06 Jan 2023 03:00:54 +0000 Received: from fd01.gateway.ufhost.com ([61.152.239.71]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDcyQ-00HMRB-4A for linux-riscv@lists.infradead.org; Fri, 06 Jan 2023 03:00:52 +0000 Received: from EXMBX166.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX166", Issuer "EXMBX166" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id 689A924E020; Fri, 6 Jan 2023 11:00:07 +0800 (CST) Received: from EXMBX173.cuchost.com (172.16.6.93) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 6 Jan 2023 11:00:07 +0800 Received: from wyh-VirtualBox.starfivetech.com (171.223.208.138) by EXMBX173.cuchost.com (172.16.6.93) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 6 Jan 2023 11:00:05 +0800 From: Yanhong Wang To: , , , CC: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Emil Renner Berthing , Richard Cochran , Andrew Lunn , Heiner Kallweit , Peter Geis , Yanhong Wang Subject: [PATCH v3 4/7] dt-bindings: net: Add support StarFive dwmac Date: Fri, 6 Jan 2023 10:59:58 +0800 Message-ID: <20230106030001.1952-5-yanhong.wang@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230106030001.1952-1-yanhong.wang@starfivetech.com> References: <20230106030001.1952-1-yanhong.wang@starfivetech.com> MIME-Version: 1.0 X-Originating-IP: [171.223.208.138] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX173.cuchost.com (172.16.6.93) X-YovoleRuleAgent: yovoleflag X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230105_190050_553564_8D324FBD X-CRM114-Status: GOOD ( 15.34 ) 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 Add documentation to describe StarFive dwmac driver(GMAC). Signed-off-by: Yanhong Wang --- .../devicetree/bindings/net/snps,dwmac.yaml | 1 + .../bindings/net/starfive,jh7110-dwmac.yaml | 113 ++++++++++++++++++ MAINTAINERS | 5 + 3 files changed, 119 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml index f7693e8c8d6d..2542f3a0538c 100644 --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml @@ -91,6 +91,7 @@ properties: - snps,dwmac-5.20 - snps,dwxgmac - snps,dwxgmac-2.10 + - starfive,jh7110-dwmac reg: minItems: 1 diff --git a/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml b/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml new file mode 100644 index 000000000000..eb0767da834a --- /dev/null +++ b/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml @@ -0,0 +1,113 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +# Copyright (C) 2022 StarFive Technology Co., Ltd. +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/starfive,jh7110-dwmac.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive JH7110 DWMAC glue layer + +maintainers: + - Yanhong Wang + +select: + properties: + compatible: + contains: + enum: + - starfive,jh7110-dwmac + required: + - compatible + +properties: + compatible: + items: + - enum: + - starfive,jh7110-dwmac + - const: snps,dwmac-5.20 + + clocks: + items: + - description: GMAC main clock + - description: GMAC AHB clock + - description: PTP clock + - description: TX clock + - description: GTXC clock + - description: GTX clock + + clock-names: + items: + - const: stmmaceth + - const: pclk + - const: ptp_ref + - const: tx + - const: gtxc + - const: gtx + + resets: + items: + - description: MAC Reset signal. + - description: AHB Reset signal. + + reset-names: + items: + - const: stmmaceth + - const: ahb + +allOf: + - $ref: snps,dwmac.yaml# + +unevaluatedProperties: true + +required: + - compatible + - clocks + - clock-names + - resets + - reset-names + +examples: + - | + ethernet@16030000 { + compatible = "starfive,jh7110-dwmac", "snps,dwmac-5.20"; + reg = <0x16030000 0x10000>; + clocks = <&clk 3>, <&clk 2>, <&clk 109>, + <&clk 5>, <&clk 111>, <&clk 108>; + clock-names = "stmmaceth", "pclk", "ptp_ref", + "tx", "gtxc", "gtx"; + resets = <&rst 1>, <&rst 2>; + reset-names = "stmmaceth", "ahb"; + interrupts = <7>, <6>, <5>; + interrupt-names = "macirq", "eth_wake_irq", "eth_lpi"; + phy-mode = "rgmii-id"; + snps,multicast-filter-bins = <64>; + snps,perfect-filter-entries = <8>; + rx-fifo-depth = <2048>; + tx-fifo-depth = <2048>; + snps,fixed-burst; + snps,no-pbl-x8; + snps,tso; + snps,force_thresh_dma_mode; + snps,axi-config = <&stmmac_axi_setup>; + snps,en-tx-lpi-clockgating; + snps,txpbl = <16>; + snps,rxpbl = <16>; + phy-handle = <&phy0>; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + compatible = "snps,dwmac-mdio"; + + phy0: ethernet-phy@0 { + reg = <0>; + }; + }; + + stmmac_axi_setup: stmmac-axi-config { + snps,lpi_en; + snps,wr_osr_lmt = <4>; + snps,rd_osr_lmt = <4>; + snps,blen = <256 128 64 32 0 0 0>; + }; + }; diff --git a/MAINTAINERS b/MAINTAINERS index a70c1d0f303e..56be59bb09f7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -19606,6 +19606,11 @@ F: Documentation/devicetree/bindings/clock/starfive* F: drivers/clk/starfive/ F: include/dt-bindings/clock/starfive* +STARFIVE DWMAC GLUE LAYER +M: Yanhong Wang +S: Maintained +F: Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml + STARFIVE PINCTRL DRIVER M: Emil Renner Berthing M: Jianlong Huang From patchwork Fri Jan 6 02:59:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yanhong wang X-Patchwork-Id: 13090824 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 5265EC3DA7A for ; Fri, 6 Jan 2023 03:01:15 +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=7UdJJvLaXddAuHgDdROhyaaHIXYiWTm0yd9Uxb6UOaw=; b=mwqfhtlEdZtc0o 0BaiDrMu2IW4VOdvF4Fv4TdqpQaeI3r4UPjx5sn1w6xMNE54VN1FdItDMKQq6tgwK3nqaTL0WJ2IA sfg+t2s/dNlpXQE6I+daR5p8uMPfCLM/+wOP5m1uDnrl2bYZxaWG0XvlJI2rLtTF8017brcFU4hh9 71hM+AEK1k+0UKv89Dl1IeAqd28fbRPGctXynpk3oNMSIOYCuVY2LAfwM8u8g/H275wOm/kK0I+K3 OJTc5VEArxIScdNdF3VMA1tYTP3lybbNxmyzBuLkDemvrWMKVQtZt8VhD4Y9k7PI/8BB2YB3DKCcs sm7X9Eyo3qSYSaduReqQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDcyh-00HMp2-FW; Fri, 06 Jan 2023 03:01:07 +0000 Received: from ex01.ufhost.com ([61.152.239.75]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDcyS-00HMOw-H9 for linux-riscv@lists.infradead.org; Fri, 06 Jan 2023 03:00:54 +0000 Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id 3F82F24E197; Fri, 6 Jan 2023 11:00:08 +0800 (CST) Received: from EXMBX173.cuchost.com (172.16.6.93) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 6 Jan 2023 11:00:08 +0800 Received: from wyh-VirtualBox.starfivetech.com (171.223.208.138) by EXMBX173.cuchost.com (172.16.6.93) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 6 Jan 2023 11:00:06 +0800 From: Yanhong Wang To: , , , CC: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Emil Renner Berthing , Richard Cochran , Andrew Lunn , Heiner Kallweit , Peter Geis , Yanhong Wang Subject: [PATCH v3 5/7] net: stmmac: Add glue layer for StarFive JH7110 SoCs Date: Fri, 6 Jan 2023 10:59:59 +0800 Message-ID: <20230106030001.1952-6-yanhong.wang@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230106030001.1952-1-yanhong.wang@starfivetech.com> References: <20230106030001.1952-1-yanhong.wang@starfivetech.com> MIME-Version: 1.0 X-Originating-IP: [171.223.208.138] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX173.cuchost.com (172.16.6.93) X-YovoleRuleAgent: yovoleflag X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230105_190052_910371_126B43D1 X-CRM114-Status: GOOD ( 22.60 ) 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 This adds StarFive dwmac driver support on the StarFive JH7110 SoCs. Signed-off-by: Yanhong Wang Co-developed-by: Emil Renner Berthing Signed-off-by: Emil Renner Berthing --- MAINTAINERS | 1 + drivers/net/ethernet/stmicro/stmmac/Kconfig | 12 ++ drivers/net/ethernet/stmicro/stmmac/Makefile | 1 + .../stmicro/stmmac/dwmac-starfive-plat.c | 123 ++++++++++++++++++ 4 files changed, 137 insertions(+) create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c diff --git a/MAINTAINERS b/MAINTAINERS index 56be59bb09f7..5b50b52d3dbb 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -19609,6 +19609,7 @@ F: include/dt-bindings/clock/starfive* STARFIVE DWMAC GLUE LAYER M: Yanhong Wang S: Maintained +F: Documentation/devicetree/bindings/net/dwmac-starfive-plat.c F: Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml STARFIVE PINCTRL DRIVER diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig index 31ff35174034..f9a4ad4abd54 100644 --- a/drivers/net/ethernet/stmicro/stmmac/Kconfig +++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig @@ -235,6 +235,18 @@ config DWMAC_INTEL_PLAT the stmmac device driver. This driver is used for the Intel Keem Bay SoC. +config DWMAC_STARFIVE_PLAT + tristate "StarFive dwmac support" + depends on OF && COMMON_CLK + depends on STMMAC_ETH + default SOC_STARFIVE + help + Support for ethernet controllers on StarFive RISC-V SoCs + + This selects the StarFive platform specific glue layer support for + the stmmac device driver. This driver is used for StarFive JH7110 + ethernet controller. + config DWMAC_VISCONTI tristate "Toshiba Visconti DWMAC support" default ARCH_VISCONTI diff --git a/drivers/net/ethernet/stmicro/stmmac/Makefile b/drivers/net/ethernet/stmicro/stmmac/Makefile index d4e12e9ace4f..a63ab0ab5071 100644 --- a/drivers/net/ethernet/stmicro/stmmac/Makefile +++ b/drivers/net/ethernet/stmicro/stmmac/Makefile @@ -31,6 +31,7 @@ obj-$(CONFIG_DWMAC_DWC_QOS_ETH) += dwmac-dwc-qos-eth.o obj-$(CONFIG_DWMAC_INTEL_PLAT) += dwmac-intel-plat.o obj-$(CONFIG_DWMAC_GENERIC) += dwmac-generic.o obj-$(CONFIG_DWMAC_IMX8) += dwmac-imx.o +obj-$(CONFIG_DWMAC_STARFIVE_PLAT) += dwmac-starfive-plat.o obj-$(CONFIG_DWMAC_VISCONTI) += dwmac-visconti.o stmmac-platform-objs:= stmmac_platform.o dwmac-altr-socfpga-objs := altr_tse_pcs.o dwmac-socfpga.o diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c new file mode 100644 index 000000000000..910095b10fe4 --- /dev/null +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c @@ -0,0 +1,123 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * StarFive DWMAC platform driver + * + * Copyright(C) 2022 StarFive Technology Co., Ltd. + * + */ + +#include +#include "stmmac_platform.h" + +struct starfive_dwmac { + struct device *dev; + struct clk *clk_tx; + struct clk *clk_gtx; + struct clk *clk_gtxc; +}; + +static void starfive_eth_plat_fix_mac_speed(void *priv, unsigned int speed) +{ + struct starfive_dwmac *dwmac = priv; + unsigned long rate; + int err; + + 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); + return; + } + + err = clk_set_rate(dwmac->clk_gtx, rate); + if (err) + dev_err(dwmac->dev, "failed to set tx rate %lu\n", rate); +} + +static int starfive_eth_plat_probe(struct platform_device *pdev) +{ + struct plat_stmmacenet_data *plat_dat; + struct stmmac_resources stmmac_res; + struct starfive_dwmac *dwmac; + int (*syscon_init)(struct device *dev); + int err; + + err = stmmac_get_platform_resources(pdev, &stmmac_res); + if (err) + return err; + + plat_dat = stmmac_probe_config_dt(pdev, stmmac_res.mac); + if (IS_ERR(plat_dat)) { + dev_err(&pdev->dev, "dt configuration failed\n"); + return PTR_ERR(plat_dat); + } + + dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL); + if (!dwmac) + return -ENOMEM; + + syscon_init = of_device_get_match_data(&pdev->dev); + if (syscon_init) { + err = syscon_init(&pdev->dev); + if (err) + return err; + } + + 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), + "error getting tx clock\n"); + + dwmac->clk_gtx = devm_clk_get_enabled(&pdev->dev, "gtx"); + if (IS_ERR(dwmac->clk_gtx)) + return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_gtx), + "error getting gtx clock\n"); + + dwmac->clk_gtxc = devm_clk_get_enabled(&pdev->dev, "gtxc"); + if (IS_ERR(dwmac->clk_gtxc)) + return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_gtxc), + "error getting gtxc clock\n"); + + dwmac->dev = &pdev->dev; + plat_dat->fix_mac_speed = starfive_eth_plat_fix_mac_speed; + plat_dat->init = NULL; + plat_dat->bsp_priv = dwmac; + plat_dat->dma_cfg->dche = true; + + err = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); + if (err) { + stmmac_remove_config_dt(pdev, plat_dat); + return err; + } + + return 0; +} + +static const struct of_device_id starfive_eth_plat_match[] = { + { .compatible = "starfive,jh7110-dwmac" }, + { } +}; + +static struct platform_driver starfive_eth_plat_driver = { + .probe = starfive_eth_plat_probe, + .remove = stmmac_pltfr_remove, + .driver = { + .name = "starfive-eth-plat", + .pm = &stmmac_pltfr_pm_ops, + .of_match_table = starfive_eth_plat_match, + }, +}; + +module_platform_driver(starfive_eth_plat_driver); + +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("StarFive DWMAC platform driver"); +MODULE_AUTHOR("Yanhong Wang "); From patchwork Fri Jan 6 03:00:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yanhong wang X-Patchwork-Id: 13090814 X-Patchwork-Delegate: mail@conchuod.ie 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 ABF85C4708E for ; Fri, 6 Jan 2023 03:00:50 +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=279iMdi0fMlBUbZ7aETboKjCv5RzLIHTJ0alI4r1+bk=; b=AdXOIISCLrw81T Xq+hBfejmY1D+/9ViS4qe9SeLlX07Zi/+puDA5SFshkpC5F/AF3XNk/kuJIhXhantYD5M75Jiv6Zi 2OZKyQGJC3MwgJ+PxrXboiQQO+Zf7L0vGa5qqpqQ0eaH+xFFSIV6eMwofTV5GieSrkKSv0uYOlsQe ufNFrZuhJCK711NFg1JgeA5lHtH2Lgg0JC6/ruaiEziGpcY8TnRcr3npTjhmS0FkWR4vFg32fxqUe QSF75M1mxvVo6R3d7+f/04+/W1p8XvNjdf+nr2QIGw3D+RFMqVaP1OvmRy5ciq3P2XqIJkZ/cvjqr e7ts/q4GUpOjl8mnPidQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDcyI-00HMZ5-Pu; Fri, 06 Jan 2023 03:00:42 +0000 Received: from ex01.ufhost.com ([61.152.239.75]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDcyE-00HMOz-R3 for linux-riscv@lists.infradead.org; Fri, 06 Jan 2023 03:00:41 +0000 Received: from EXMBX166.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX166", Issuer "EXMBX166" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id 48AD424E1E2; Fri, 6 Jan 2023 11:00:09 +0800 (CST) Received: from EXMBX173.cuchost.com (172.16.6.93) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 6 Jan 2023 11:00:09 +0800 Received: from wyh-VirtualBox.starfivetech.com (171.223.208.138) by EXMBX173.cuchost.com (172.16.6.93) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 6 Jan 2023 11:00:07 +0800 From: Yanhong Wang To: , , , CC: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Emil Renner Berthing , Richard Cochran , Andrew Lunn , Heiner Kallweit , Peter Geis , Yanhong Wang Subject: [PATCH v3 6/7] riscv: dts: starfive: jh7110: Add ethernet device node Date: Fri, 6 Jan 2023 11:00:00 +0800 Message-ID: <20230106030001.1952-7-yanhong.wang@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230106030001.1952-1-yanhong.wang@starfivetech.com> References: <20230106030001.1952-1-yanhong.wang@starfivetech.com> MIME-Version: 1.0 X-Originating-IP: [171.223.208.138] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX173.cuchost.com (172.16.6.93) X-YovoleRuleAgent: yovoleflag X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230105_190039_206077_3E371095 X-CRM114-Status: GOOD ( 10.02 ) 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 Add JH7110 ethernet device node to support gmac driver for the JH7110 RISC-V SoC. Signed-off-by: Yanhong Wang --- arch/riscv/boot/dts/starfive/jh7110.dtsi | 93 ++++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi index c22e8f1d2640..c6de6e3b1a25 100644 --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi @@ -433,5 +433,98 @@ reg-shift = <2>; status = "disabled"; }; + + stmmac_axi_setup: stmmac-axi-config { + snps,lpi_en; + snps,wr_osr_lmt = <4>; + snps,rd_osr_lmt = <4>; + snps,blen = <256 128 64 32 0 0 0>; + }; + + gmac0: ethernet@16030000 { + compatible = "starfive,jh7110-dwmac", "snps,dwmac-5.20"; + reg = <0x0 0x16030000 0x0 0x10000>; + clocks = <&aoncrg JH7110_AONCLK_GMAC0_AXI>, + <&aoncrg JH7110_AONCLK_GMAC0_AHB>, + <&syscrg JH7110_SYSCLK_GMAC0_PTP>, + <&aoncrg JH7110_AONCLK_GMAC0_TX>, + <&syscrg JH7110_SYSCLK_GMAC0_GTXC>, + <&syscrg JH7110_SYSCLK_GMAC0_GTXCLK>; + clock-names = "stmmaceth", "pclk", "ptp_ref", + "tx", "gtxc", "gtx"; + resets = <&aoncrg JH7110_AONRST_GMAC0_AXI>, + <&aoncrg JH7110_AONRST_GMAC0_AHB>; + reset-names = "stmmaceth", "ahb"; + interrupts = <7>, <6>, <5>; + interrupt-names = "macirq", "eth_wake_irq", "eth_lpi"; + phy-mode = "rgmii-id"; + snps,multicast-filter-bins = <64>; + snps,perfect-filter-entries = <8>; + rx-fifo-depth = <2048>; + tx-fifo-depth = <2048>; + snps,fixed-burst; + snps,no-pbl-x8; + snps,force_thresh_dma_mode; + snps,axi-config = <&stmmac_axi_setup>; + snps,tso; + snps,en-tx-lpi-clockgating; + snps,txpbl = <16>; + snps,rxpbl = <16>; + status = "disabled"; + phy-handle = <&phy0>; + + mdio0: mdio { + #address-cells = <1>; + #size-cells = <0>; + compatible = "snps,dwmac-mdio"; + + phy0: ethernet-phy@0 { + reg = <0>; + }; + }; + }; + + gmac1: ethernet@16040000 { + compatible = "starfive,jh7110-dwmac", "snps,dwmac-5.20"; + reg = <0x0 0x16040000 0x0 0x10000>; + clocks = <&syscrg JH7110_SYSCLK_GMAC1_AXI>, + <&syscrg JH7110_SYSCLK_GMAC1_AHB>, + <&syscrg JH7110_SYSCLK_GMAC1_PTP>, + <&syscrg JH7110_SYSCLK_GMAC1_TX>, + <&syscrg JH7110_SYSCLK_GMAC1_GTXC>, + <&syscrg JH7110_SYSCLK_GMAC1_GTXCLK>; + clock-names = "stmmaceth", "pclk", "ptp_ref", + "tx", "gtxc", "gtx"; + resets = <&syscrg JH7110_SYSRST_GMAC1_AXI>, + <&syscrg JH7110_SYSRST_GMAC1_AHB>; + reset-names = "stmmaceth", "ahb"; + interrupts = <78>, <77>, <76>; + interrupt-names = "macirq", "eth_wake_irq", "eth_lpi"; + phy-mode = "rgmii-id"; + snps,multicast-filter-bins = <64>; + snps,perfect-filter-entries = <8>; + rx-fifo-depth = <2048>; + tx-fifo-depth = <2048>; + snps,fixed-burst; + snps,no-pbl-x8; + snps,force_thresh_dma_mode; + snps,axi-config = <&stmmac_axi_setup>; + snps,tso; + snps,en-tx-lpi-clockgating; + snps,txpbl = <16>; + snps,rxpbl = <16>; + status = "disabled"; + phy-handle = <&phy1>; + + mdio1: mdio { + #address-cells = <1>; + #size-cells = <0>; + compatible = "snps,dwmac-mdio"; + + phy1: ethernet-phy@1 { + reg = <1>; + }; + }; + }; }; }; From patchwork Fri Jan 6 03:00:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yanhong wang X-Patchwork-Id: 13090825 X-Patchwork-Delegate: mail@conchuod.ie 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 2D788C53210 for ; Fri, 6 Jan 2023 03:01:17 +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=PN3A851J4Moc8pYQcGCBqHUu1z/O3UE8LkrxuFjfuis=; b=Uhr06oJDekZRXn YmUEaqPLl7o94CsUKAvoPfT0pVGzY/Ms1v1frf9P6JCjReHVrwHrzKOcf342zKoq30i9Fq/flucBV Ty94Ibjdk50QXpguwH5ygJuODHZA5PrPALT/D1h0xIOgYAUvf9OQcS+hobjsRj7WdsIRYBOK1cU4c Ugjb6P/1Jr8Rwjsah2Gmup6tR6MA4B/JDrDY3tkCPlfBu/oLaHhpci6TKq9uQqMunqrtJwxLAjQ3Q KxgunJ9OdndhPiQVmyV5VKnWsZIjsGVp5fL3K9ip7VnFwPqJQj1ejqw/4rtBFVb09goXrqdc74LjP XK2YmRDu+QPgUH8ZUXhg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDcyj-00HMrX-Kk; Fri, 06 Jan 2023 03:01:09 +0000 Received: from fd01.gateway.ufhost.com ([61.152.239.71]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDcyU-00HMRA-M0 for linux-riscv@lists.infradead.org; Fri, 06 Jan 2023 03:00:56 +0000 Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id 06A9724E1C6; Fri, 6 Jan 2023 11:00:10 +0800 (CST) Received: from EXMBX173.cuchost.com (172.16.6.93) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 6 Jan 2023 11:00:10 +0800 Received: from wyh-VirtualBox.starfivetech.com (171.223.208.138) by EXMBX173.cuchost.com (172.16.6.93) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 6 Jan 2023 11:00:08 +0800 From: Yanhong Wang To: , , , CC: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Emil Renner Berthing , Richard Cochran , Andrew Lunn , Heiner Kallweit , Peter Geis , Yanhong Wang Subject: [PATCH v3 7/7] riscv: dts: starfive: visionfive-v2: Enable gmac device tree node Date: Fri, 6 Jan 2023 11:00:01 +0800 Message-ID: <20230106030001.1952-8-yanhong.wang@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230106030001.1952-1-yanhong.wang@starfivetech.com> References: <20230106030001.1952-1-yanhong.wang@starfivetech.com> MIME-Version: 1.0 X-Originating-IP: [171.223.208.138] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX173.cuchost.com (172.16.6.93) X-YovoleRuleAgent: yovoleflag X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230105_190054_935875_1A8604E2 X-CRM114-Status: UNSURE ( 9.55 ) X-CRM114-Notice: Please train this message. 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 Update gmac device tree node status to okay. Signed-off-by: Yanhong Wang --- .../dts/starfive/jh7110-starfive-visionfive-v2.dts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts index c8946cf3a268..b22363d5f9dc 100644 --- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts +++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts @@ -15,6 +15,8 @@ aliases { serial0 = &uart0; + ethernet0 = &gmac0; + ethernet1 = &gmac1; }; chosen { @@ -114,3 +116,11 @@ pinctrl-0 = <&uart0_pins>; status = "okay"; }; + +&gmac0 { + status = "okay"; +}; + +&gmac1 { + status = "okay"; +};