From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DAAE6C4361B for ; Tue, 15 Dec 2020 17:51:28 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 730802076D for ; Tue, 15 Dec 2020 17:51:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 730802076D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=xHqHjZdlfarL59oo7m0nBmDMz9qPjtQvBKn5xXDzEc8=; b=NLpkk+iP7QZ4SvToumomaPJBe /XR90FRkJO/KyJ3SEeg9mswRWKff18Mzjeuqt8FfAMOfDFkspsjLUEEMU7TJgMtNS2J1ikE4/pOTD MQKvRqpRVBHYTlHrXzSCe3uVZ4kW06y0I3+4b3AZXBDUIONBvpK5XpSuWo1OIlkvtanky7e5zAxJZ DPCC2lxDk3eWozb4iLes6iLH3FuvqXRCmlgDSBFwIgjVFTW+iWvNH3bSqgrVvuEdEqNV1Q6/DgQ1g gib1L6lkyKsVUAcjC12xqMIRFn7Kj5zdyGsDUWsAGEitlYaUpwdnO0AVNMM4XOUwXs3B10xPgusTd PMsSNrr+A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kpESe-00017j-0D; Tue, 15 Dec 2020 17:50:08 +0000 Received: from mail-ot1-f66.google.com ([209.85.210.66]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kpESb-00017B-4M for linux-arm-kernel@lists.infradead.org; Tue, 15 Dec 2020 17:50:06 +0000 Received: by mail-ot1-f66.google.com with SMTP id q25so20211491otn.10 for ; Tue, 15 Dec 2020 09:50:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=TtEN0qeUEFJtej+0NqYqcBgmDeRXe5i3bl1rddfJtGk=; b=M77G1BhNqE0vFALFw7UgAdeDVIbRxHetFHB+KWayKLQI77wJQHiQt1/gbwqViCMaqc Q4LmPiunceUNip8oCd41NyNmq8SP9U61odoXbStYW4MB1EmE72a1JMwwOp9V+771dq/2 XwL6Pql+In1TW+630AznJz0MGVab2ZcvI4UrnbTWKJiCxhLk9bK1lsuF3siY+lE3gLfe VBOwXT44VElnDc+EPwHgcmZ0tqpG47OoL2R5T/FUxLjA1ZoSzwU02m+Q4dl/JV6b2FJ5 webV0xrWj04e6sDdYVxgsw+XbUB9biUukeuIX3eyjLSyzUDFE9tN9kxdsN4p1F7i+cPv E/bQ== X-Gm-Message-State: AOAM530YmhvLa0Ue2NvuxwlCsFutmMi4FlywfyLE3RiJuIOO7eoWUFNE VKVAeb/l9x0NL0Qj37zuoIFi9zXcPQ== X-Google-Smtp-Source: ABdhPJxbVBZx9Mhv6ck1Loj48EH72/hoWr/0eCy25FEC3zL8+XfOfxlxH17fOBKcLvccgg+/2FSO1g== X-Received: by 2002:a9d:6450:: with SMTP id m16mr23406700otl.344.1608054604452; Tue, 15 Dec 2020 09:50:04 -0800 (PST) Received: from xps15 (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.gmail.com with ESMTPSA id 73sm572541otv.26.2020.12.15.09.50.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Dec 2020 09:50:03 -0800 (PST) Received: (nullmailer pid 4102332 invoked by uid 1000); Tue, 15 Dec 2020 17:50:02 -0000 Date: Tue, 15 Dec 2020 11:50:02 -0600 From: Rob Herring To: Serge Semin Subject: Re: [PATCH 07/25] dt-bindings: net: dwmac: Detach Generic DW MAC bindings Message-ID: <20201215175002.GA4074883@robh.at.kernel.org> References: <20201214091616.13545-1-Sergey.Semin@baikalelectronics.ru> <20201214091616.13545-8-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201214091616.13545-8-Sergey.Semin@baikalelectronics.ru> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201215_125005_248629_7C8F6043 X-CRM114-Status: GOOD ( 30.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Alexandre Torgue , Joao Pinto , netdev@vger.kernel.org, Lars Persson , linux-stm32@st-md-mailman.stormreply.com, Johan Hovold , Maxime Ripard , Alexey Malahov , Jose Abreu , Serge Semin , Maxime Coquelin , Jakub Kicinski , Giuseppe Cavallaro , Vyacheslav Mitrofanov , "David S. Miller" , linux-arm-kernel@lists.infradead.org, Pavel Parkhomenko Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Dec 14, 2020 at 12:15:57PM +0300, Serge Semin wrote: > Currently the snps,dwmac.yaml DT bindings file is used for both DT nodes > describing generic DW MAC devices and as DT schema with common properties > to be evaluated against a vendor-specific DW MAC IP-cores. Due to such > dual-purpose design the "compatible" property of the common DW MAC schema > needs to contain the vendor-specific strings to successfully pass the > schema evaluation in case if it's referenced from the vendor-specific DT > bindings. That's a bad design from maintainability point of view, since > adding/removing any DW MAC-based device bindings requires the common > schema modification. In order to fix that let's detach the schema which > provides the generic DW MAC DT nodes evaluation into a dedicated DT > bindings file preserving the common DW MAC properties declaration in the > snps,dwmac.yaml file. By doing so we'll still provide a common properties > evaluation for each vendor-specific MAC bindings which refer to the > common bindings file, while the generic DW MAC DT nodes will be checked > against the new snps,dwmac-generic.yaml DT schema. I'm okay with the change, but it needs a big fat note that snps,dwmac-generic.yaml should not have new users. New users should have an SoC specific compatible. History has shown that even IP versions are not enough to handle all the integration crap vendors do. > > Signed-off-by: Serge Semin > --- > .../bindings/net/snps,dwmac-generic.yaml | 148 ++++++++++++++++++ > .../devicetree/bindings/net/snps,dwmac.yaml | 139 +--------------- > 2 files changed, 149 insertions(+), 138 deletions(-) > create mode 100644 Documentation/devicetree/bindings/net/snps,dwmac-generic.yaml > > diff --git a/Documentation/devicetree/bindings/net/snps,dwmac-generic.yaml b/Documentation/devicetree/bindings/net/snps,dwmac-generic.yaml > new file mode 100644 > index 000000000000..f1b387911390 > --- /dev/null > +++ b/Documentation/devicetree/bindings/net/snps,dwmac-generic.yaml > @@ -0,0 +1,148 @@ > +# SPDX-License-Identifier: GPL-2.0 > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/net/snps,dwmac-generic.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Synopsys DesignWare Generic MAC Device Tree Bindings > + > +maintainers: > + - Alexandre Torgue > + - Giuseppe Cavallaro > + - Jose Abreu > + > +# Select the DT nodes, which have got compatible strings either as just a > +# single string with IP-core name optionally followed by the IP version or > +# two strings: one with IP-core name plus the IP version, another as just > +# the IP-core name. > +select: > + properties: > + compatible: > + oneOf: > + - items: > + - pattern: "^snps,dw(xg)+mac(-[0-9]+\\.[0-9]+a?)?$" > + - items: > + - pattern: "^snps,dwmac-[0-9]+\\.[0-9]+a?$" > + - const: snps,dwmac > + - items: > + - pattern: "^snps,dwxgmac-[0-9]+\\.[0-9]+a?$" > + - const: snps,dwxgmac > + > + required: > + - compatible > + > +allOf: > + - $ref: snps,dwmac.yaml# > + > +properties: > + compatible: > + oneOf: > + - description: Generic Synopsys DW MAC > + oneOf: > + - items: > + - enum: > + - snps,dwmac-3.50a > + - snps,dwmac-3.610 > + - snps,dwmac-3.70a > + - snps,dwmac-3.710 > + - snps,dwmac-4.00 > + - snps,dwmac-4.10a > + - snps,dwmac-4.20a > + - const: snps,dwmac > + - const: snps,dwmac > + - description: Generic Synopsys DW xGMAC > + oneOf: > + - items: > + - enum: > + - snps,dwxgmac-2.10 > + - const: snps,dwxgmac > + - const: snps,dwxgmac > + - description: ST SPEAr SoC Family GMAC > + deprecated: true > + const: st,spear600-gmac > + > + reg: > + maxItems: 1 > + > +unevaluatedProperties: false > + > +examples: > + - | > + gmac0: ethernet@e0800000 { > + compatible = "snps,dwxgmac-2.10", "snps,dwxgmac"; > + reg = <0xe0800000 0x8000>; > + interrupt-parent = <&vic1>; > + interrupts = <24 23 22>; > + interrupt-names = "macirq", "eth_wake_irq", "eth_lpi"; > + mac-address = [000000000000]; /* Filled in by U-Boot */ > + max-frame-size = <3800>; > + phy-mode = "gmii"; > + snps,multicast-filter-bins = <256>; > + snps,perfect-filter-entries = <128>; > + rx-fifo-depth = <16384>; > + tx-fifo-depth = <16384>; > + clocks = <&clock>; > + clock-names = "stmmaceth"; > + snps,axi-config = <&stmmac_axi_setup>; > + snps,mtl-rx-config = <&mtl_rx_setup>; > + snps,mtl-tx-config = <&mtl_tx_setup>; > + mdio0 { > + #address-cells = <1>; > + #size-cells = <0>; > + compatible = "snps,dwmac-mdio"; > + phy1: ethernet-phy@0 { > + reg = <0>; > + }; > + }; > + }; > + - | > + gmac1: ethernet@f8010000 { > + compatible = "snps,dwmac-4.10a", "snps,dwmac"; > + reg = <0xf8010000 0x4000>; > + interrupts = <0 98 4>; > + interrupt-names = "macirq"; > + clock-names = "stmmaceth", "ptp_ref"; > + clocks = <&clock 4>, <&clock 5>; > + phy-mode = "rgmii"; > + snps,txpbl = <8>; > + snps,rxpbl = <2>; > + snps,aal; > + snps,tso; > + > + snps,axi-config { > + snps,wr_osr_lmt = <0xf>; > + snps,rd_osr_lmt = <0xf>; > + snps,blen = <256 128 64 32 0 0 0>; > + }; > + > + snps,mtl-rx-config { > + snps,rx-queues-to-use = <1>; > + snps,rx-sched-sp; > + queue0 { > + snps,dcb-algorithm; > + snps,map-to-dma-channel = <0x0>; > + snps,priority = <0x0>; > + }; > + }; > + > + snps,mtl-tx-config { > + snps,tx-queues-to-use = <2>; > + snps,tx-sched-wrr; > + > + queue0 { > + snps,weight = <0x10>; > + snps,dcb-algorithm; > + snps,priority = <0x0>; > + }; > + > + queue1 { > + snps,avb-algorithm; > + snps,send_slope = <0x1000>; > + snps,idle_slope = <0x1000>; > + snps,high_credit = <0x3E800>; > + 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 74820f491346..72b58f86bc41 100644 > --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml > +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml > @@ -11,31 +11,7 @@ maintainers: > - Giuseppe Cavallaro > - Jose Abreu > > -# Select every compatible, including the deprecated ones. This way, we > -# will be able to report a warning when we have that compatible, since > -# we will validate the node thanks to the select, but won't report it > -# as a valid value in the compatible property description > -select: > - properties: > - compatible: > - contains: > - enum: > - - snps,dwmac > - - snps,dwmac-3.50a > - - snps,dwmac-3.610 > - - snps,dwmac-3.70a > - - snps,dwmac-3.710 > - - snps,dwmac-4.00 > - - snps,dwmac-4.10a > - - snps,dwmac-4.20a > - - snps,dwxgmac > - - snps,dwxgmac-2.10 > - > - # Deprecated > - - st,spear600-gmac > - > - required: > - - compatible > +select: false > > allOf: > - $ref: "ethernet-controller.yaml#" > @@ -62,35 +38,6 @@ allOf: > MAC HW capability register. > > properties: > - > - # We need to include all the compatibles from schemas that will > - # include that schemas, otherwise compatible won't validate for > - # those. > - compatible: > - contains: > - enum: > - - allwinner,sun7i-a20-gmac > - - allwinner,sun8i-a83t-emac > - - allwinner,sun8i-h3-emac > - - allwinner,sun8i-r40-emac > - - allwinner,sun8i-v3s-emac > - - allwinner,sun50i-a64-emac > - - amlogic,meson6-dwmac > - - amlogic,meson8b-dwmac > - - amlogic,meson8m2-dwmac > - - amlogic,meson-gxbb-dwmac > - - amlogic,meson-axg-dwmac > - - snps,dwmac > - - snps,dwmac-3.50a > - - snps,dwmac-3.610 > - - snps,dwmac-3.70a > - - snps,dwmac-3.710 > - - snps,dwmac-4.00 > - - snps,dwmac-4.10a > - - snps,dwmac-4.20a > - - snps,dwxgmac > - - snps,dwxgmac-2.10 > - > reg: > minItems: 1 > maxItems: 2 > @@ -543,88 +490,4 @@ dependencies: > snps,reset-delay-us: ["snps,reset-gpio"] > > additionalProperties: true > - > -examples: > - - | > - gmac0: ethernet@e0800000 { > - compatible = "snps,dwxgmac-2.10", "snps,dwxgmac"; > - reg = <0xe0800000 0x8000>; > - interrupt-parent = <&vic1>; > - interrupts = <24 23 22>; > - interrupt-names = "macirq", "eth_wake_irq", "eth_lpi"; > - mac-address = [000000000000]; /* Filled in by U-Boot */ > - max-frame-size = <3800>; > - phy-mode = "gmii"; > - snps,multicast-filter-bins = <256>; > - snps,perfect-filter-entries = <128>; > - rx-fifo-depth = <16384>; > - tx-fifo-depth = <16384>; > - clocks = <&clock>; > - clock-names = "stmmaceth"; > - snps,axi-config = <&stmmac_axi_setup>; > - snps,mtl-rx-config = <&mtl_rx_setup>; > - snps,mtl-tx-config = <&mtl_tx_setup>; > - mdio0 { > - #address-cells = <1>; > - #size-cells = <0>; > - compatible = "snps,dwmac-mdio"; > - phy1: ethernet-phy@0 { > - reg = <0>; > - }; > - }; > - }; > - - | > - gmac1: ethernet@f8010000 { > - compatible = "snps,dwmac-4.10a", "snps,dwmac"; > - reg = <0xf8010000 0x4000>; > - interrupts = <0 98 4>; > - interrupt-names = "macirq"; > - clock-names = "stmmaceth", "ptp_ref"; > - clocks = <&clock 4>, <&clock 5>; > - phy-mode = "rgmii"; > - snps,txpbl = <8>; > - snps,rxpbl = <2>; > - snps,aal; > - snps,tso; > - > - snps,axi-config { > - snps,wr_osr_lmt = <0xf>; > - snps,rd_osr_lmt = <0xf>; > - snps,blen = <256 128 64 32 0 0 0>; > - }; > - > - snps,mtl-rx-config { > - snps,rx-queues-to-use = <1>; > - snps,rx-sched-sp; > - queue0 { > - snps,dcb-algorithm; > - snps,map-to-dma-channel = <0x0>; > - snps,priority = <0x0>; > - }; > - }; > - > - snps,mtl-tx-config { > - snps,tx-queues-to-use = <2>; > - snps,tx-sched-wrr; > - queue0 { > - snps,weight = <0x10>; > - snps,dcb-algorithm; > - snps,priority = <0x0>; > - }; > - > - queue1 { > - snps,avb-algorithm; > - snps,send_slope = <0x1000>; > - snps,idle_slope = <0x1000>; > - snps,high_credit = <0x3E800>; > - snps,low_credit = <0xFFC18000>; > - snps,priority = <0x1>; > - }; > - }; > - }; > - > -# FIXME: We should set it, but it would report all the generic > -# properties as additional properties. > -# additionalProperties: false > - > ... > -- > 2.29.2 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel