Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1678611pxb; Wed, 10 Feb 2021 14:07:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJyFwOTbORow0cYMB2Mcy0kML31HOXIgYBTUMVp3Q0OtK7YkPCUizz9OAqq5jrw/faUyzwer X-Received: by 2002:a17:906:1712:: with SMTP id c18mr5189470eje.417.1612994853841; Wed, 10 Feb 2021 14:07:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612994853; cv=none; d=google.com; s=arc-20160816; b=Hfp2D6zYq6ySri9OKgetY1tXNFfT7rwuQCrEzxrqIsEftk8lqlYM1KyF5OeTDYaIit oeWmiBq5itMH7kxVC1Z3KTXVRi/uk4yOTT/tFf9YMxwOVjYfl6FPK6LUuQfqUotrAb6I orYw11ymNjuS7VMFTCd8JnL+E1v4EQTRiZXLR2PlR5opresHAqR0rENoeGcuiv/taoo4 RM4vfMaTvdlcxIU3bTqOlNoTAdXptIfVgH+pZgi33y3Z8qmVWXhsI2he45Yt8t8POPYF +RxXNaVv/qt6ebU1StvoGRJAAvJibxdxxTO1VntJOYEmd8Z4g2hjJLHSEvDouRwhx+AM tIqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=mZ2WTM/1seXHt5g5weREm4Jwlr70IYAXZBzZJ/CFqbA=; b=L/R+CqHMdrt7+XePPbH3+WSc4892OAoiUiY/QbKNKZQrcmvbGV/kASjO02fb0iTMjW cdAqocR0uhV3L1swWVMkvHuCdUDJ3LtyswPlcAV1e5KAXciLaH/8mt6dBu+hVcDBIc+l N1fco1TLYEL0SJ42axnVa8p1QVrCSDnUoFS6JcnNJ6hNGtAvEde2iCZhHwEZoU4fa4it h2dpT/sk25CEw3Oe7ErC62laCnBZbWsIN1uhEAIupvAMu4OWLt1WHZF1tzHgXMxp9Hbz 1NyD1uSFi8skiD6rXMZOtEYZAm4XppC+aV+pm51E6+NnDX/CYbca5nGdjYQY/ISHNF8q JwTA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gt12si2112017ejc.222.2021.02.10.14.07.07; Wed, 10 Feb 2021 14:07:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232500AbhBJWGK (ORCPT + 99 others); Wed, 10 Feb 2021 17:06:10 -0500 Received: from mail.baikalelectronics.com ([87.245.175.226]:35454 "EHLO mail.baikalelectronics.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231193AbhBJWGG (ORCPT ); Wed, 10 Feb 2021 17:06:06 -0500 Date: Thu, 11 Feb 2021 01:05:18 +0300 From: Serge Semin To: Rob Herring CC: Serge Semin , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Jakub Kicinski , Johan Hovold , Maxime Ripard , Joao Pinto , Lars Persson , Alexey Malahov , Pavel Parkhomenko , Vyacheslav Mitrofanov , Maxime Coquelin , , , , , Subject: Re: [PATCH v2 07/24] dt-bindings: net: dwmac: Detach Generic DW MAC bindings Message-ID: <20210210220518.nbzm6ux6pui2csbf@mobilestation> References: <20210208135609.7685-1-Sergey.Semin@baikalelectronics.ru> <20210208135609.7685-8-Sergey.Semin@baikalelectronics.ru> <20210209223258.GA328873@robh.at.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20210209223258.GA328873@robh.at.kernel.org> X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 09, 2021 at 04:32:58PM -0600, Rob Herring wrote: > On Mon, Feb 08, 2021 at 04:55:51PM +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. > > > > Signed-off-by: Serge Semin > > > > --- > > > > Changelog v2: > > - Add a note to the snps,dwmac-generic.yaml bindings file description of > > a requirement to create a new DT bindings file for the vendor-specific > > versions of the DW MAC. > > --- > > .../bindings/net/snps,dwmac-generic.yaml | 154 ++++++++++++++++++ > > .../devicetree/bindings/net/snps,dwmac.yaml | 139 +--------------- > > 2 files changed, 155 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..6c3bf5b2f890 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/net/snps,dwmac-generic.yaml > > @@ -0,0 +1,154 @@ > > +# 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 > > + > > +description: > > + The primary purpose of this bindings file is to validate the Generic > > + Synopsys Desginware MAC DT nodes defined in accordance with the select > > + schema. All new vendor-specific versions of the DW *MAC IP-cores must > > + be described in a dedicated DT bindings file. > > + > > +# 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?)?$" > > Use '' instead of "" and you can skip the double \. > > With that, > > Reviewed-by: Rob Herring Got it. Thanks. -Sergey > > > + - items: > > + - pattern: "^snps,dwmac-[0-9]+\\.[0-9]+a?$" > > + - const: snps,dwmac > > + - items: > > + - pattern: "^snps,dwxgmac-[0-9]+\\.[0-9]+a?$" > > + - const: snps,dwxgmac