From patchwork Mon Mar 13 22:50:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 662772 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 7F0F2C61DA4 for ; Mon, 13 Mar 2023 22:52:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229813AbjCMWwS (ORCPT ); Mon, 13 Mar 2023 18:52:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230137AbjCMWwO (ORCPT ); Mon, 13 Mar 2023 18:52:14 -0400 Received: from post.baikalelectronics.com (post.baikalelectronics.com [213.79.110.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1A65F49F0; Mon, 13 Mar 2023 15:51:51 -0700 (PDT) Received: from post.baikalelectronics.com (localhost.localdomain [127.0.0.1]) by post.baikalelectronics.com (Proxmox) with ESMTP id DDD01E0EB4; Tue, 14 Mar 2023 01:51:10 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= baikalelectronics.ru; h=cc:cc:content-transfer-encoding :content-type:content-type:date:from:from:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=post; bh=VFkPUzOm4WO2kZ00mW10/1EQVEqfv291U9mtDB6u7+g=; b=nsN4DFTnkKHe c+gHezWyGZF/KYPFyUOHVDz/QIMSOZVaFSlsGE0XK+k7ULDofcqyuFEcqSOPQuSQ +F5qVSEO+Z57uioppuZwpAifeBYkXttIYY4raz4DwYvlix/4nEQCHI6sWOmDsPHZ XWA10Gc9VYZl/KqllKOVK4Ms9CedCtk= Received: from mail.baikal.int (mail.baikal.int [192.168.51.25]) by post.baikalelectronics.com (Proxmox) with ESMTP id CD137E0E6A; Tue, 14 Mar 2023 01:51:10 +0300 (MSK) Received: from localhost (10.8.30.10) by mail (192.168.51.25) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 14 Mar 2023 01:51:10 +0300 From: Serge Semin To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Rob Herring , Krzysztof Kozlowski CC: Serge Semin , Serge Semin , Alexey Malahov , Pavel Parkhomenko , Christian Marangi , Richard Cochran , Biao Huang , Yang Yingliang , , , , , , Rob Herring Subject: [PATCH net-next 03/16] dt-bindings: net: dwmac: Fix the TSO property declaration Date: Tue, 14 Mar 2023 01:50:50 +0300 Message-ID: <20230313225103.30512-4-Sergey.Semin@baikalelectronics.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230313225103.30512-1-Sergey.Semin@baikalelectronics.ru> References: <20230313225103.30512-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 X-Originating-IP: [10.8.30.10] X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Indeed the STMMAC driver doesn't take the vendor-specific compatible string into account to parse the "snps,tso" boolean property. It just makes sure the node is compatible with DW MAC 4.x, 5.x and DW xGMAC IP-cores. The original allwinner sunXi bindings file also didn't have the TSO-related property declared. Neither Ingenic nor Loongson LLD drivers activate the GMAC4/5/etc-specific core code. Taking all of that into account fix the conditional statement so the TSO-property would be evaluated for the compatibles having the corresponding IP-core version by dropping all of the vendor-specific compatibles from the property conditional statement. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Note this won't break the bindings description, since the "snps,tso" property isn't parsed by the denoted glue drivers, but only by the generic platform DT-parser. Changelog v1: - Use correct syntax of the JSON pointers, so the later would begin with a '/' after the '#'. --- .../devicetree/bindings/net/snps,dwmac.yaml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml index fb9b8506a48f..92feed3c29bc 100644 --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml @@ -590,27 +590,12 @@ allOf: compatible: contains: enum: - - allwinner,sun7i-a20-gmac - - allwinner,sun8i-a83t-emac - - allwinner,sun8i-h3-emac - - allwinner,sun8i-r40-gmac - - allwinner,sun8i-v3s-emac - - allwinner,sun50i-a64-emac - - loongson,ls2k-dwmac - - loongson,ls7a-dwmac - - ingenic,jz4775-mac - - ingenic,x1000-mac - - ingenic,x1600-mac - - ingenic,x1830-mac - - ingenic,x2000-mac - snps,dwmac-4.00 - snps,dwmac-4.10a - snps,dwmac-4.20a - snps,dwmac-5.10a - snps,dwxgmac - snps,dwxgmac-2.10 - - st,spear600-gmac - then: properties: snps,tso: From patchwork Mon Mar 13 22:50:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 662771 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 34D80C6FD19 for ; Mon, 13 Mar 2023 22:53:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230186AbjCMWxD (ORCPT ); Mon, 13 Mar 2023 18:53:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230234AbjCMWwx (ORCPT ); Mon, 13 Mar 2023 18:52:53 -0400 Received: from post.baikalelectronics.com (post.baikalelectronics.com [213.79.110.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 872208C0DA; Mon, 13 Mar 2023 15:52:15 -0700 (PDT) Received: from post.baikalelectronics.com (localhost.localdomain [127.0.0.1]) by post.baikalelectronics.com (Proxmox) with ESMTP id 79972E0EB6; Tue, 14 Mar 2023 01:51:14 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= baikalelectronics.ru; h=cc:cc:content-transfer-encoding :content-type:content-type:date:from:from:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=post; bh=kB5Ypu9uI3/FVnScRsT5+ZCB/6/xGkijVX1+bsbiHl8=; b=AEiiwI5J1GW3 D/CidPHbAkj76a8RRcOgx654EoNK2OStvsjMtS4MEDlWxcM8AZMYkpHGHJ26Jleb 5WRkgKgzT+IEOYdGquZxV0kmd/1GbW/hVCKvLrBwTDIRFXbVpulymvcCiMjCF3DP LQeGU7zYIPNRS5PWZ1Qo2az1Js2YFX0= Received: from mail.baikal.int (mail.baikal.int [192.168.51.25]) by post.baikalelectronics.com (Proxmox) with ESMTP id 63DCDE0E6A; Tue, 14 Mar 2023 01:51:14 +0300 (MSK) Received: from localhost (10.8.30.10) by mail (192.168.51.25) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 14 Mar 2023 01:51:13 +0300 From: Serge Semin To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Rob Herring , Krzysztof Kozlowski CC: Serge Semin , Serge Semin , Alexey Malahov , Pavel Parkhomenko , Christian Marangi , Richard Cochran , Biao Huang , Yang Yingliang , , , , , Subject: [PATCH net-next 05/16] dt-bindings: net: dwmac: Elaborate snps,clk-csr description Date: Tue, 14 Mar 2023 01:50:52 +0300 Message-ID: <20230313225103.30512-6-Sergey.Semin@baikalelectronics.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230313225103.30512-1-Sergey.Semin@baikalelectronics.ru> References: <20230313225103.30512-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 X-Originating-IP: [10.8.30.10] X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The property is utilized to set the CSR-MDC clock selector in the STMMAC driver. The specified value is used instead of auto-detecting the CSR/application clocks divider based on the reference clock rate. Let's add a more detailed description to clarify the property purpose and permitted values. In the later case the constraints are specified based on the DW *MAC CR registers permitted values. Signed-off-by: Serge Semin Acked-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/net/snps,dwmac.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml index 224f8f70db85..edef405766e4 100644 --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml @@ -427,7 +427,15 @@ properties: snps,clk-csr: $ref: /schemas/types.yaml#/definitions/uint32 description: - Frequency division factor for MDC clock. + CSR-MDC clock selector. It sets up a divider of the CSR/application + clock to create an MDC signal with desired frequency. Note the + property value doesn't specify the divider itself by encodes the + corresponding divider value specific to the IP-core. + DW GMAC 0 - 42, 1 - 62, 2 - 16, 3 - 26, 4 - 102, 5 - 124, 8 - 4, + 9 - 6, 10 - 8, 11 - 10, 12 - 12, 13 - 14, 14 - 16, 15 - 18. + DW xGMAC 0 - 62, 1 - 102, 2 - 122, 3 - 142, 4 - 162, 5 - 202. + minimum: 0 + maximum: 15 mdio: $ref: mdio.yaml# From patchwork Mon Mar 13 22:50:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 662770 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 A7E2BC7618B for ; Mon, 13 Mar 2023 22:53:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229519AbjCMWxF (ORCPT ); Mon, 13 Mar 2023 18:53:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230240AbjCMWwy (ORCPT ); Mon, 13 Mar 2023 18:52:54 -0400 Received: from post.baikalelectronics.com (post.baikalelectronics.com [213.79.110.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 85E938B064; Mon, 13 Mar 2023 15:52:15 -0700 (PDT) Received: from post.baikalelectronics.com (localhost.localdomain [127.0.0.1]) by post.baikalelectronics.com (Proxmox) with ESMTP id 0903DE0EB7; Tue, 14 Mar 2023 01:51:16 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= baikalelectronics.ru; h=cc:cc:content-transfer-encoding :content-type:content-type:date:from:from:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=post; bh=oyRmDVoN+2lAomqaOYUxFd6Rs2QRCU3KaCv853AjErI=; b=iNRjn9CHeGAW ovD3bq746Zx0qmkDhXjwwClvb6q8j+ts/mn6WBauv2l4//vaxR8YwoXDnoqYDsM/ kWLtXoKfBn0fZfJXfzzjY0A34xL9wCEV7bGpCavA6gXGsyXh91rOGpHB/Y+NmZcA Wmh0L1vlts+pO3pgU4LkvFBZgxUFFIk= Received: from mail.baikal.int (mail.baikal.int [192.168.51.25]) by post.baikalelectronics.com (Proxmox) with ESMTP id D28EDE0E6A; Tue, 14 Mar 2023 01:51:15 +0300 (MSK) Received: from localhost (10.8.30.10) by mail (192.168.51.25) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 14 Mar 2023 01:51:15 +0300 From: Serge Semin To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Rob Herring , Krzysztof Kozlowski CC: Serge Semin , Serge Semin , Alexey Malahov , Pavel Parkhomenko , Christian Marangi , Richard Cochran , Biao Huang , Yang Yingliang , , , , , , Rob Herring Subject: [PATCH net-next 06/16] dt-bindings: net: dwmac: Elaborate stmmaceth/pclk clocks description Date: Tue, 14 Mar 2023 01:50:53 +0300 Message-ID: <20230313225103.30512-7-Sergey.Semin@baikalelectronics.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230313225103.30512-1-Sergey.Semin@baikalelectronics.ru> References: <20230313225103.30512-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 X-Originating-IP: [10.8.30.10] X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Current clocks description doesn't provide a comprehensive notion about what "stmmaceth" and "pclk" actually represent from the IP-core manual point of view. The bindings file states: stmmaceth - "GMAC main clock", apb - "Peripheral registers interface clock". It isn't that easy to understand what they actually mean especially seeing the DW *MAC manual operates with clock definitions like Application, System, Host, CSR, Transmit, Receive, etc clocks. Moreover the clocks usage in the driver doesn't shade a full light on their essence. What inferred from there is that the "stmmaceth" name has been assigned to the common clock, which feeds both system and CSR interfaces. But what about "apb"? The bindings defines it as the clock for "peripheral registers interface". So it's close to the CSR clock in the IP-core manual notation. If so then when "apb" clock is specified aside with the "stmmaceth", it represents a case when the DW *MAC is synthesized with CSR_SLV_CLK=y (separate system and CSR clocks). But even though the "apb" clock is requested in the MAC driver, the driver doesn't actually use it as a separate CSR clock where the IP-core manual requires. All of that makes me thinking that the case of separate system and CSR clocks isn't correctly implemented in the driver. Let's start with elaborating the clocks description so anyone reading the DW *MAC bindings file would understand that "stmmaceth" is the system clock and "pclk" is actually the CSR clock. Indeed in accordance with sheets depicted in [1]: system/application clock can be either of: hclk_i, aclk_i, clk_app_i; CSR clock can be either of: hclk_i, aclk_i, clk_app_i, clk_csr_i. (Similar definitions present in the others IP-core manuals.) So the CSR clock can be tied to the application clock considering the later as the main clock, but not the other way around. In case if there is only "stmmaceth" clock specified in a DT node, then it will be considered as a source of clock signal for both application and CSR. But if "pclk" is also specified in the list of the device clocks, then it will be perceived as the separate CSR clock. [1] DesignWare Cores Ethernet MAC Universal Databook, Revision 3.73a, October 2013, p. 564. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- .../devicetree/bindings/net/snps,dwmac.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml index edef405766e4..3e3fbc1dfafa 100644 --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml @@ -37,8 +37,16 @@ properties: maxItems: 8 additionalItems: true items: - - description: GMAC main clock - - description: Peripheral registers interface clock + - description: + GMAC main clock, also called as system/application clock. + This clock is used to provide a periodic signal for the DMA/MTL + interface and optionally for CSR, if the later isn't separately + clocked. + - description: + Peripheral registers interface clock, also called as CSR clock. + MCI, CSR and SMA interfaces run on this clock. If it's omitted, + the CSR interfaces are considered as synchronous to the system + clock domain. - description: PTP reference clock. This clock is used for programming the Timestamp Addend Register. If not passed then the system From patchwork Mon Mar 13 22:50:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 662769 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 1AC18C6FD19 for ; Mon, 13 Mar 2023 22:53:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230092AbjCMWxb (ORCPT ); Mon, 13 Mar 2023 18:53:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230111AbjCMWxD (ORCPT ); Mon, 13 Mar 2023 18:53:03 -0400 Received: from post.baikalelectronics.com (post.baikalelectronics.com [213.79.110.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4D96672BB; Mon, 13 Mar 2023 15:52:18 -0700 (PDT) Received: from post.baikalelectronics.com (localhost.localdomain [127.0.0.1]) by post.baikalelectronics.com (Proxmox) with ESMTP id 2E4DEE0EBC; Tue, 14 Mar 2023 01:51:21 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= baikalelectronics.ru; h=cc:cc:content-transfer-encoding :content-type:content-type:date:from:from:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=post; bh=Y6oIna2GYsMa/tMSylL09FYzZvzOQ9lU2CFxdQGOfk0=; b=SKtYgXiuZg8S apeiyaaMAoOItS4nHGsGT8jBPqU1dYK1JbgTyXFxti7Ojg7do32VL0YqEt4XFiK2 pfM82JbaZ0/G9zbTCQXLz06JusQB2qt1BNst8Aubak4/rko4X7Jvu77e2LUs6WPB mwRvjSNsFz50lqF06FtsQrT3c8Dsi5Y= Received: from mail.baikal.int (mail.baikal.int [192.168.51.25]) by post.baikalelectronics.com (Proxmox) with ESMTP id A1151E0EBB; Tue, 14 Mar 2023 01:51:20 +0300 (MSK) Received: from localhost (10.8.30.10) by mail (192.168.51.25) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 14 Mar 2023 01:51:19 +0300 From: Serge Semin To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Rob Herring , Krzysztof Kozlowski CC: Serge Semin , Serge Semin , Alexey Malahov , Pavel Parkhomenko , Christian Marangi , Richard Cochran , Biao Huang , Yang Yingliang , , , , , Subject: [PATCH net-next 09/16] dt-bindings: net: dwmac: Prohibit additional props in AXI-config Date: Tue, 14 Mar 2023 01:50:56 +0300 Message-ID: <20230313225103.30512-10-Sergey.Semin@baikalelectronics.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230313225103.30512-1-Sergey.Semin@baikalelectronics.ru> References: <20230313225103.30512-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 X-Originating-IP: [10.8.30.10] X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Currently DT-schema of the AXI-bus config sub-node prohibits to have unknown properties by using the unevaluatedProperties property. It's overkill for the sub-node which doesn't use any combining schemas keywords (allOf, anyOf, etc). Instead more natural is to use additionalProperties to prohibit for that. Signed-off-by: Serge Semin --- Documentation/devicetree/bindings/net/snps,dwmac.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml index 89be67e55c3e..d1b2910b799b 100644 --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml @@ -466,7 +466,6 @@ properties: stmmac-axi-config: type: object - unevaluatedProperties: false description: AXI BUS Mode parameters. @@ -518,6 +517,8 @@ properties: description: rebuild INCRx Burst + additionalProperties: false + required: - compatible - reg From patchwork Mon Mar 13 22:50:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 662768 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 A1DFDC6FD1C for ; Mon, 13 Mar 2023 22:53:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229757AbjCMWxh (ORCPT ); Mon, 13 Mar 2023 18:53:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229612AbjCMWxH (ORCPT ); Mon, 13 Mar 2023 18:53:07 -0400 Received: from post.baikalelectronics.com (post.baikalelectronics.com [213.79.110.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 77A8792726; Mon, 13 Mar 2023 15:52:27 -0700 (PDT) Received: from post.baikalelectronics.com (localhost.localdomain [127.0.0.1]) by post.baikalelectronics.com (Proxmox) with ESMTP id 5CF5CE0EBB; Tue, 14 Mar 2023 01:51:22 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= baikalelectronics.ru; h=cc:cc:content-transfer-encoding :content-type:content-type:date:from:from:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=post; bh=/8CHQKcSQNOd84jUFb0GyleIApZIHIOE6ipgEgcboPQ=; b=ZuW2NnJXGaCa c8rmEbdZS4jhKDKbFuLmgLUJ+xIQ3xyiHEkmBOC7PdC6lZ7b+c5VFWNEbQPmZX/r BJAccZwbsCKjZvg5sCodLLvxDU7/kYeB0NoZnb+fLzdRMC1+gNOzYG+fYnWWmvKc TVssdaQGDKLUn6Eam7qkE2qryHILJKM= Received: from mail.baikal.int (mail.baikal.int [192.168.51.25]) by post.baikalelectronics.com (Proxmox) with ESMTP id 3DF24E0E6A; Tue, 14 Mar 2023 01:51:22 +0300 (MSK) Received: from localhost (10.8.30.10) by mail (192.168.51.25) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 14 Mar 2023 01:51:21 +0300 From: Serge Semin To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Rob Herring , Krzysztof Kozlowski CC: Serge Semin , Serge Semin , Alexey Malahov , Pavel Parkhomenko , Christian Marangi , Richard Cochran , Biao Huang , Yang Yingliang , , , , , Subject: [PATCH net-next 10/16] dt-bindings: net: dwmac: Add AXI-bus properties constraints Date: Tue, 14 Mar 2023 01:50:57 +0300 Message-ID: <20230313225103.30512-11-Sergey.Semin@baikalelectronics.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230313225103.30512-1-Sergey.Semin@baikalelectronics.ru> References: <20230313225103.30512-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 X-Originating-IP: [10.8.30.10] X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Currently none of the AXI-bus non-boolean DT-properties have constraints defined meanwhile they can be specified at least based on the corresponding device configs. Let's do that: + snps,wr_osr_lm/snps,rd_osr_lmt - maximum number of outstanding AXI-bus read/write requests is limited with the IP-core synthesize parameter AXI_MAX_{RD,WR}_REQ. DW MAC/GMAC: <= 16, DW Eth QoS: <= 32, DW xGMAC: <= 64. The least restrictive constraint is defined since the DT-schema is common for all IP-cores. + snps,blen - array of the burst lengths supported by the AXI-bus. Values are limited by the AXI3/4 bus standard, available AXI/System bus CSR flags and the AXI-bus IP-core synthesize config . All DW *MACs support setting the burst length within the set: 4, 8, 16, 32, 64, 128, 256. If some burst length is unsupported a zero value can be specified instead in the array. Signed-off-by: Serge Semin --- Documentation/devicetree/bindings/net/snps,dwmac.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml index d1b2910b799b..f24718a8d184 100644 --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml @@ -484,11 +484,17 @@ properties: $ref: /schemas/types.yaml#/definitions/uint32 description: max write outstanding req. limit + default: 1 + minimum: 1 + maximum: 64 snps,rd_osr_lmt: $ref: /schemas/types.yaml#/definitions/uint32 description: max read outstanding req. limit + default: 1 + minimum: 1 + maximum: 64 snps,kbbe: $ref: /schemas/types.yaml#/definitions/uint32 @@ -501,6 +507,8 @@ properties: this is a vector of supported burst length. minItems: 7 maxItems: 7 + items: + enum: [256, 128, 64, 32, 16, 8, 4, 0] snps,fb: $ref: /schemas/types.yaml#/definitions/flag From patchwork Mon Mar 13 22:50:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 662766 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 9A3E2C61DA4 for ; Mon, 13 Mar 2023 23:00:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229482AbjCMXA0 (ORCPT ); Mon, 13 Mar 2023 19:00:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229957AbjCMXAW (ORCPT ); Mon, 13 Mar 2023 19:00:22 -0400 Received: from post.baikalelectronics.com (post.baikalelectronics.com [213.79.110.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E40658691; Mon, 13 Mar 2023 15:59:48 -0700 (PDT) Received: from post.baikalelectronics.com (localhost.localdomain [127.0.0.1]) by post.baikalelectronics.com (Proxmox) with ESMTP id 231BCE0EBE; Tue, 14 Mar 2023 01:51:26 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= baikalelectronics.ru; h=cc:cc:content-transfer-encoding :content-type:content-type:date:from:from:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=post; bh=7MVrtnm6qrHIhyMF9F8ZCjZqai+ZJoeGYKX8whtHDxE=; b=RzpF8eyD0bFT LpgQVaXR27miDGoRlb2j8Q2Ima/XWvMj0j2Ovxl2X9H9aHQYRms2xMlDqYPDOcL6 /DVYsVbbfKl1LruGW7wf+dkXssg99k8UDCidTJAURYjXXpHNkJgLvSBg/pRK4JFm aI9ZkSDZ5DX4fmfbZsUsSYYYNZiAxqs= Received: from mail.baikal.int (mail.baikal.int [192.168.51.25]) by post.baikalelectronics.com (Proxmox) with ESMTP id 00EF5E0E6A; Tue, 14 Mar 2023 01:51:26 +0300 (MSK) Received: from localhost (10.8.30.10) by mail (192.168.51.25) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 14 Mar 2023 01:51:25 +0300 From: Serge Semin To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Rob Herring , Krzysztof Kozlowski CC: Serge Semin , Serge Semin , Alexey Malahov , Pavel Parkhomenko , Christian Marangi , Richard Cochran , Biao Huang , Yang Yingliang , , , , , , Alexandre Torgue Subject: [PATCH net-next 12/16] dt-bindings: net: dwmac: Add MTL Tx Queue properties constraints Date: Tue, 14 Mar 2023 01:50:59 +0300 Message-ID: <20230313225103.30512-13-Sergey.Semin@baikalelectronics.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230313225103.30512-1-Sergey.Semin@baikalelectronics.ru> References: <20230313225103.30512-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 X-Originating-IP: [10.8.30.10] X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Currently none of the MTL Tx Queues QoS-related DT-properties have been equipped with the proper constraints meanwhile they can be specified at least based on the corresponding CSR field sizes or the DW (x|xG)MAC IP-core synthesize parameter constraints. Let's do that: + snps,tx-queues-to-use - number of Tx queues to utilise is limited with a number of available queues. DW MAC/GMAC: no queues, DW Eth QoS: <= 8, DW xGMAC: <= 16. + snps,weight - Tx Queue/Traffic Class quantum/weight utilised depending on enabled algorithm for the Data Center Bridging feature: DWRR (up to 0x1312D0 bytes to add to credit) or WFQ (up to 0x3FFF - least bandwidth) or WFQ (up to 0x64). DW MAC/GMAC: no queues, DW Eth QoS: <= 0x1312D0, DW xGMAC: <= 0x1312D0. + snps,send_slope - Tx Queue/Traffic Class Send-Slope credit value subtracted from the accumulated credit for the Audio/Video bridging feature (CBS algorithm, bits per cycle scaled up by 1,024). DW MAC/GMAC: no queues, DW Eth QoS: <= 0x2000, DW xGMAC: <= 0x3FFF. + snps,idle_slope - same meaning as snps,send_slope except it's determines the Idle-Slope credit of CBS algorithm. DW MAC/GMAC: no queues, DW Eth QoS: <= 0x2000, DW xGMAC: <= 0x8000. + snps,high_credit/snps,low_credit - maximum and minimum values accumulated in the credit for the Audio/Video bridging feature (CBS algorithm, bits scaled up by 1,024). DW MAC/GMAC: no queues, DW Eth QoS: <= 0x1FFFFFFF, DW xGMAC: <= 0x1FFFFFFF. + snps,priority - Tx Queue/Traffic Class priority (enabled by the PFC-packets) limits determined by the VLAN tag PRI field width (it's 7). DW MAC/GMAC: no queues, DW Eth QoS: 0xff, DW xGMAC: 0xff. Since the constraints vary for different IP-cores and the DT-schema is common for all of them the least restrictive values are chosen. The info above can be used for the IP-core specific DT-schemas if anybody ever is bothered with one to create. Signed-off-by: Serge Semin --- .../bindings/net/snps,dwmac-generic.yaml | 2 +- .../devicetree/bindings/net/snps,dwmac.yaml | 24 ++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/net/snps,dwmac-generic.yaml b/Documentation/devicetree/bindings/net/snps,dwmac-generic.yaml index ae740a1ab213..2974af79511d 100644 --- a/Documentation/devicetree/bindings/net/snps,dwmac-generic.yaml +++ b/Documentation/devicetree/bindings/net/snps,dwmac-generic.yaml @@ -137,7 +137,7 @@ examples: snps,send_slope = <0x1000>; snps,idle_slope = <0x1000>; snps,high_credit = <0x3E800>; - snps,low_credit = <0xFFC18000>; + snps,low_credit = <0x1FC18000>; snps,priority = <0x1>; }; }; diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml index e5662b1498b7..2ebf7995426b 100644 --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml @@ -250,6 +250,10 @@ properties: snps,tx-queues-to-use: $ref: /schemas/types.yaml#/definitions/uint32 description: number of TX queues to be used in the driver + default: 1 + minimum: 1 + maximum: 16 + snps,tx-sched-wrr: type: boolean description: Weighted Round Robin @@ -296,13 +300,16 @@ properties: snps,tx-sched-wfq: false snps,tx-sched-dwrr: false patternProperties: - "^queue[0-9]$": + "^queue([0-9]|1[0-5])$": description: Each subnode represents a queue. type: object properties: snps,weight: $ref: /schemas/types.yaml#/definitions/uint32 description: TX queue weight (if using a DCB weight algorithm) + minimum: 0 + maximum: 0x1312D0 + snps,dcb-algorithm: type: boolean description: TX queue will be working in DCB @@ -315,15 +322,27 @@ properties: snps,send_slope: $ref: /schemas/types.yaml#/definitions/uint32 description: enable Low Power Interface + minimum: 0 + maximum: 0x3FFF + snps,idle_slope: $ref: /schemas/types.yaml#/definitions/uint32 description: unlock on WoL + minimum: 0 + maximum: 0x8000 + snps,high_credit: $ref: /schemas/types.yaml#/definitions/uint32 description: max write outstanding req. limit + minimum: 0 + maximum: 0x1FFFFFFF + snps,low_credit: $ref: /schemas/types.yaml#/definitions/uint32 description: max read outstanding req. limit + minimum: 0 + maximum: 0x1FFFFFFF + snps,priority: $ref: /schemas/types.yaml#/definitions/uint32 description: @@ -331,6 +350,9 @@ properties: When a PFC frame is received with priorities matching the bitmask, the queue is blocked from transmitting for the pause time specified in the PFC frame. + minimum: 0 + maximum: 0xFF + allOf: - if: required: From patchwork Mon Mar 13 22:51:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 662767 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 274DFC7618B for ; Mon, 13 Mar 2023 22:54:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230375AbjCMWyI (ORCPT ); Mon, 13 Mar 2023 18:54:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230371AbjCMWxe (ORCPT ); Mon, 13 Mar 2023 18:53:34 -0400 Received: from post.baikalelectronics.com (post.baikalelectronics.com [213.79.110.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 61FC392F30; Mon, 13 Mar 2023 15:52:54 -0700 (PDT) Received: from post.baikalelectronics.com (localhost.localdomain [127.0.0.1]) by post.baikalelectronics.com (Proxmox) with ESMTP id A5BB5E0EC0; Tue, 14 Mar 2023 01:51:29 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= baikalelectronics.ru; h=cc:cc:content-transfer-encoding :content-type:content-type:date:from:from:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=post; bh=6xrFxVFBCRoCwxV5M3KY75YLEifw9tZ9oXtCfQTCeVs=; b=KMRYLuxUvxwE kwtRfkaJKPlM5KUepPRKyA5TfFU7uP5VUadRQWnfhFfx5HdNeTL2phNG7hF1bIim r8XK0Lf2AslW63hVY3Io0uz2uNSzMYvsArsFflyTdipDptWQgujEkPosznPVTHW3 O/Kk6PLGGD7P4j7yMIf0zAGOhSATCSQ= Received: from mail.baikal.int (mail.baikal.int [192.168.51.25]) by post.baikalelectronics.com (Proxmox) with ESMTP id 87853E0E6A; Tue, 14 Mar 2023 01:51:29 +0300 (MSK) Received: from localhost (10.8.30.10) by mail (192.168.51.25) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 14 Mar 2023 01:51:28 +0300 From: Serge Semin To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Rob Herring , Krzysztof Kozlowski CC: Serge Semin , Serge Semin , Alexey Malahov , Pavel Parkhomenko , Christian Marangi , Richard Cochran , Biao Huang , Yang Yingliang , , , , , Subject: [PATCH net-next 14/16] dt-bindings: net: dwmac: Use flag definition instead of booleans Date: Tue, 14 Mar 2023 01:51:01 +0300 Message-ID: <20230313225103.30512-15-Sergey.Semin@baikalelectronics.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230313225103.30512-1-Sergey.Semin@baikalelectronics.ru> References: <20230313225103.30512-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 X-Originating-IP: [10.8.30.10] X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Currently some of the boolean properties defined in the DT-schema are marked to have the basic boolean type meanwhile the rest referencing the /schemas/types.yaml#/definitions/flag schema. For the sake of unification let's convert the first group to referencing the pre-defined flag schema. Thus bindings will look a bit more coherent and the DT-bindings maintainers will have a better control over the booleans defined in the schema (if ever needed). Signed-off-by: Serge Semin --- .../devicetree/bindings/net/snps,dwmac.yaml | 45 ++++++++++++------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml index 69be39d55403..a863b5860566 100644 --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml @@ -120,11 +120,13 @@ properties: maximum: 12 snps,rx-sched-sp: - type: boolean + $ref: /schemas/types.yaml#/definitions/flag description: Strict priority + snps,rx-sched-wsp: - type: boolean + $ref: /schemas/types.yaml#/definitions/flag description: Weighted Strict priority + allOf: - if: required: @@ -144,11 +146,13 @@ properties: type: object properties: snps,dcb-algorithm: - type: boolean + $ref: /schemas/types.yaml#/definitions/flag description: Queue to be enabled as DCB + snps,avb-algorithm: - type: boolean + $ref: /schemas/types.yaml#/definitions/flag description: Queue to be enabled as AVB + snps,map-to-dma-channel: $ref: /schemas/types.yaml#/definitions/uint32 description: DMA channel id to map @@ -156,20 +160,25 @@ properties: maximum: 15 snps,route-avcp: - type: boolean + $ref: /schemas/types.yaml#/definitions/flag description: AV Untagged Control packets + snps,route-ptp: - type: boolean + $ref: /schemas/types.yaml#/definitions/flag description: PTP Packets + snps,route-dcbcp: - type: boolean + $ref: /schemas/types.yaml#/definitions/flag description: DCB Control Packets + snps,route-up: - type: boolean + $ref: /schemas/types.yaml#/definitions/flag description: Untagged Packets + snps,route-multi-broad: - type: boolean + $ref: /schemas/types.yaml#/definitions/flag description: Multicast & Broadcast Packets + snps,priority: $ref: /schemas/types.yaml#/definitions/uint32 description: Bitmask of the tagged frames priorities assigned to the queue @@ -255,17 +264,21 @@ properties: maximum: 16 snps,tx-sched-wrr: - type: boolean + $ref: /schemas/types.yaml#/definitions/flag description: Weighted Round Robin + snps,tx-sched-wfq: - type: boolean + $ref: /schemas/types.yaml#/definitions/flag description: Weighted Fair Queuing + snps,tx-sched-dwrr: - type: boolean + $ref: /schemas/types.yaml#/definitions/flag description: Deficit Weighted Round Robin + snps,tx-sched-sp: - type: boolean + $ref: /schemas/types.yaml#/definitions/flag description: Strict priority + allOf: - if: required: @@ -311,14 +324,16 @@ properties: maximum: 0x1312D0 snps,dcb-algorithm: - type: boolean + $ref: /schemas/types.yaml#/definitions/flag description: TX queue will be working in DCB + snps,avb-algorithm: - type: boolean + $ref: /schemas/types.yaml#/definitions/flag description: TX queue will be working in AVB. Queue 0 is reserved for legacy traffic and so no AVB is available in this queue. + snps,send_slope: $ref: /schemas/types.yaml#/definitions/uint32 description: