Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2314071pxb; Mon, 20 Sep 2021 18:32:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUyTUcQdaLdMZHU49CaxNE1VGhES2gQ7SDjwkurBiSUdivCv2HyvDUPk/Kax6ZQH1WRKTv X-Received: by 2002:a5d:94c4:: with SMTP id y4mr9049270ior.131.1632187938539; Mon, 20 Sep 2021 18:32:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632187938; cv=none; d=google.com; s=arc-20160816; b=eBm0WB3ErMCZbe/jxkYOl/Yu7kTwP70UMSZA+yPM7Pz+xKUtqh27l/uVNDjxhcu6gY sVaA0TmCnwdAj7HDMLc5rCv1AtwTNx84bNEcNH7YbZyv/vsk/CwLQlhgLnq4TnPI74hU WPvyd/8kjcE4g6T9vwi5R6+HfMRPCejpbWWWTDy0nBM1u6dO8HwieElNoO7HYW7t/pWS ygxsPUGOn3B0vAzthv7bUbn4gGm4aMWUIeUIVZwAr8lBkAjmj8qjX1kVJUU8PlwdLhKM uW63So8yDsByhtYP6408ZDFKwLmdgpuHP/jZbN7M5NwOgw4SXUh1oLJaYM/DomRsg6HJ ukuA== 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:dkim-signature; bh=zHBcy62XBnwwIXR6J0uJZFxZPjvGorUc2wPW3wjD7m8=; b=eHQJH8z1rtq2qYMNs3sX2QFfn14dg45soZwvPMjoUA5mgV9N+jt141LO3lzYg0iKUD FMV9nh3PywcdhRE2oJbABynEF06YvOySycoX19Uq8hagXMbZgZL9kvOCJcsKwUH8vwC8 WtUMbUH7iPS+lrJBZbbRvbiEsvtO/VJ1ushrlO6Mq+CF9s4z4iKppi50utkR3aYEbsCV T99dbbZ/V/lnLRWe9R8orIxxmCf/2sHJUQx6hTH+GUML7TFh8Q+AZ7jHzj6xKftFJTS5 Br18coKHE8Z7OC7EoH4CgmxRzz1zN2L+oYM6Y9pInErjcA13Ts4rvWMPwvXrgVO5Bbl8 Pjfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=DO5x9hFY; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n14si13881831ili.128.2021.09.20.18.32.07; Mon, 20 Sep 2021 18:32:18 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=DO5x9hFY; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231671AbhITPKP (ORCPT + 99 others); Mon, 20 Sep 2021 11:10:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235441AbhITPKM (ORCPT ); Mon, 20 Sep 2021 11:10:12 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0AA8C061574; Mon, 20 Sep 2021 08:08:43 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id g1so69621591lfj.12; Mon, 20 Sep 2021 08:08:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=zHBcy62XBnwwIXR6J0uJZFxZPjvGorUc2wPW3wjD7m8=; b=DO5x9hFYScnYzeAJQV+nm5mz3uSaWz+2uG8C6WGB09WCtCoEtj3VeVAULgoR7t4icc l3cAnhjyZdjYexiF6AvgsxL6aSGoR1Wts5KS4UY/gRg1kopMBSHCt7rDFC9rX4WUHPff vaJU04Zppn4ym8YDhHWpDIg1fxhHC9YxeujQoTRdw/vdOQT8nPYClU8JnTwfDn8+dB19 opjDk1x8kg0LrnI4u+QQMWt5FvDPc9dY0yChZyohWP+NvdToQlnnLmKmxtIuxcCUmz67 G7gynfWVZ1fyhZaCHLUza5XppEO/j6S03WiRZ2kbo6/B6rsm1rxYtBTu/HTTFZNROLzS LdqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=zHBcy62XBnwwIXR6J0uJZFxZPjvGorUc2wPW3wjD7m8=; b=BX1OScuPbMDeB5glkl8FbNNgYdKk8HBpImWR+e2NlJN+mQmxC+3t6ftv4NGfzODBGX A915W3Fr0FOpRgLeGDX9ls3mtOxDXYMvwmapy5TMPAoUCsfkg9PbfTNQ9T6gMY2UV79u 4bYWCyiwIQ4GRl0iRDI71zh+BkNegyYkhwecom7a4+0p0Hi6fEAzJwMcvnCH0KfIfYIf Db7lB4ZTIsaXAnbF3mFplvLJ3bTUoZvpREVspYNHEbS3MFC+Nfd7Z4K6fbKWq7egmQNC C3NPs7UrTHVHkikpTL3fWfVFT4ooD6Q+fexYaS58l0jq/RSQ3P/cAPWmAFXKBQZRhjXR kNrw== X-Gm-Message-State: AOAM531f+yNA2zHm/4LJs/xnLSB0wJzKv/2tcG7X7nVTsAdXOHdUoTPx xEWymCW5OVZPQcHDipeteKdQ+I359DPUrQ== X-Received: by 2002:a2e:8e8f:: with SMTP id z15mr22868490ljk.121.1632150414239; Mon, 20 Sep 2021 08:06:54 -0700 (PDT) Received: from mobilestation ([95.79.127.110]) by smtp.gmail.com with ESMTPSA id v26sm1319921ljv.77.2021.09.20.08.06.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Sep 2021 08:06:53 -0700 (PDT) Date: Mon, 20 Sep 2021 18:06:51 +0300 From: Serge Semin To: Apurva Nandan Cc: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Mark Brown , linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, michael@walle.cc Subject: Re: [PATCH v2 1/2] dt-bindings: mtd: spi-nand: Convert to DT schema format Message-ID: <20210920150651.vvdhennblwhdi3jw@mobilestation> References: <20210920142713.129295-1-a-nandan@ti.com> <20210920142713.129295-2-a-nandan@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210920142713.129295-2-a-nandan@ti.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Apurva On Mon, Sep 20, 2021 at 07:57:12PM +0530, Apurva Nandan wrote: > Convert spi-nand.txt binding to YAML format with an added example. > > Signed-off-by: Apurva Nandan > --- > .../devicetree/bindings/mtd/spi-nand.txt | 5 -- > .../devicetree/bindings/mtd/spi-nand.yaml | 62 +++++++++++++++++++ > 2 files changed, 62 insertions(+), 5 deletions(-) > delete mode 100644 Documentation/devicetree/bindings/mtd/spi-nand.txt > create mode 100644 Documentation/devicetree/bindings/mtd/spi-nand.yaml Thanks for the bindings conversion patch. There are several comments below. But before addressing them it would be better to also get a response from Rob. > > diff --git a/Documentation/devicetree/bindings/mtd/spi-nand.txt b/Documentation/devicetree/bindings/mtd/spi-nand.txt > deleted file mode 100644 > index 8b51f3b6d55c..000000000000 > --- a/Documentation/devicetree/bindings/mtd/spi-nand.txt > +++ /dev/null > @@ -1,5 +0,0 @@ > -SPI NAND flash > - > -Required properties: > -- compatible: should be "spi-nand" > -- reg: should encode the chip-select line used to access the NAND chip > diff --git a/Documentation/devicetree/bindings/mtd/spi-nand.yaml b/Documentation/devicetree/bindings/mtd/spi-nand.yaml > new file mode 100644 > index 000000000000..601beba8d971 > --- /dev/null > +++ b/Documentation/devicetree/bindings/mtd/spi-nand.yaml > @@ -0,0 +1,62 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/mtd/spi-nand.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: SPI NAND flash > + > +maintainers: > + - Apurva Nandan > + > +allOf: > + - $ref: "mtd.yaml#" > + > +properties: > + compatible: > + const: spi-nand > + > + reg: > + maxItems: 1 > + > + spi-max-frequency: true > + spi-rx-bus-width: true > + spi-tx-bus-width: true > + rx-sample-delay-ns: true Since it's an SPI-client device there are more than these properties could be set for it. See the SPI-controller bindings schema: Documentation/devicetree/bindings/spi/spi-controller.yaml So there is two possible ways to make it more generic: 1) Detach the spi-client part from the spi-controller.yaml bindings into a dedicated DT-schema file and refer to that new scheme from here. 2) Forget about these controller-specific properties and let the parental SPI-controller bindings parsing them. Of course there must be at least one of the next properties declared for it to work: {unevaluatedProperties, additionalProperties}. It's up to Rob to decided which approach is better though... > + > + '#address-cells': true > + '#size-cells': true Aren't they always equal to 1? > + > +additionalProperties: > + type: object I'd suggest to elaborate the way the partition sub-nodes looks like, for instance, the node names, supported compatible names, labels, etc. -Sergey > + > +examples: > + - | > + spi { > + #address-cells = <1>; > + #size-cells = <0>; > + > + flash@6 { > + #address-cells = <1>; > + #size-cells = <1>; > + compatible = "spi-nand"; > + reg = <0x6>; > + spi-max-frequency = <42000000>; > + > + partitions { > + compatible = "fixed-partitions"; > + #address-cells = <1>; > + #size-cells = <1>; > + > + partition@0 { > + label = "boot"; > + reg = <0 0x200000>; > + }; > + > + partition@200000 { > + label = "rootfs"; > + reg = <0x200000 0xce0000>; > + }; > + }; > + }; > + }; > -- > 2.25.1 >