Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3062551pxb; Tue, 21 Sep 2021 13:42:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4gOYw9nBPcv6OLT9YMZ5uj7zUfDs75sqYD7MKd3Uf5GZyvr27iruBzU0q6uyaw4pY+iBq X-Received: by 2002:a17:907:1b1b:: with SMTP id mp27mr36143181ejc.538.1632256929223; Tue, 21 Sep 2021 13:42:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632256929; cv=none; d=google.com; s=arc-20160816; b=vgjI/em8R5vfeZQaPfTRYrOZLsK3Uhc23rG1Hr3vLu7t/BX97Y0rdG/I3WrMhjn/kt tfMfL9LS77Cpf7zGefNwTzz7evNmbc1o96WqHrV+NdphFWVuHUGAe66PPh7WEAhubvwA HiE+nTRvlyi2pgAL5wsQ+5V8RLbHn78P/IIN4HUer4mW3bfWzoloYb+JhRPnuRptHnMi MfZxR0FKlv4u1bnw/jzYd44bsK8k2RXxXKeqbh1j3C6XCt4HclI5xlKkBwteVTDHNN+I hngQc4EOiY0m6y5DIgwxRpAAzeruceyTYJqCQt78MI0oCJm8oAZ8FYdS1dtNjr9Fizf3 ictw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=n9oI9Qelz4pq0ivqXok55nqbBXkpVobkDiWBt03hCDQ=; b=f4ZslzESbTOJnGmrRRzcrbYg/GKi+4HNCxFzzKp69zaqDhnNX/7JhSnIXI6qVeTnlT ZLkUWjIrMImvQ3YxYxUuWeMLQZfQgVi77HWFJ98+4f16GofYGL+TjILJ+rvdfbHxWUQJ fmYTPo37vOP2H95y4GYVVhCFDnPvNB/uJ3oFVJ2E5t0M+EW5ZrJ/dPf10lcYQ+T+HrhG zioBWaqKbkQPFv5SVevCKGiZJYB60bxx7eQcaI/iChwwg6/OigHLs4vxVABixmIUCnfY MrTp2ey4SZu0nST+OxU7Gic5ui1dARmYKM0s5RXHh2xZo40sKQUTvXFbHLO1hhRdLPsL 0Tkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BhMOi9IH; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d13si4365ejz.741.2021.09.21.13.41.44; Tue, 21 Sep 2021 13:42:09 -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=@kernel.org header.s=k20201202 header.b=BhMOi9IH; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234348AbhIUTRq (ORCPT + 99 others); Tue, 21 Sep 2021 15:17:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:37912 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229912AbhIUTRp (ORCPT ); Tue, 21 Sep 2021 15:17:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 288CD61264; Tue, 21 Sep 2021 19:16:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632251777; bh=y7t65FuUj5M7zHUNcxaXF8xZfHxxqS+Py2uO/oFuGbM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=BhMOi9IH4aXuRUEQvYaIyBPtIwepzEo1TnBdbKhE1sb1ceupjaKCfRTQS/jHX88Co ih+iBXBmdLdkNx1t5uxAaXBnbQxlJmxO7wk/0TP8jhVr9vunmbtFb4gV2C5y5lQhaK jDeUi8PCnXV6T1NhweJ2hnnGGbStXvmMHHvnq2Hm8ojn9MXWofIddPddcMaZuOPEcF mvKOttk8GncAltKNYv8BM9MiDUw7HMLf93nONzOd2l30mYZfKKaTnOXYu6g8RHb2ds 18jw1q8+CAIdprMKqONGjgF9chmpPzSzpJ8CVPgvvqgYIJjEgE+2SQybS2WYnGUsku VYnMuRJxfmIpw== Received: by mail-ed1-f54.google.com with SMTP id v5so531836edc.2; Tue, 21 Sep 2021 12:16:17 -0700 (PDT) X-Gm-Message-State: AOAM531/8/noNY4DIIgl4Fbyvppw0yptEl/CdYj66kIbGb1qKGBGfQrY mjcpd1oIdK6+OMf0A62djPBXa7j3f76MjR3XMQ== X-Received: by 2002:a50:e004:: with SMTP id e4mr37623631edl.164.1632251775461; Tue, 21 Sep 2021 12:16:15 -0700 (PDT) MIME-Version: 1.0 References: <20210920142713.129295-1-a-nandan@ti.com> <20210920142713.129295-2-a-nandan@ti.com> <20210920150651.vvdhennblwhdi3jw@mobilestation> <3c03fcdd-b015-8fda-eadc-e1b6d24ba88d@ti.com> In-Reply-To: <3c03fcdd-b015-8fda-eadc-e1b6d24ba88d@ti.com> From: Rob Herring Date: Tue, 21 Sep 2021 14:16:02 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 1/2] dt-bindings: mtd: spi-nand: Convert to DT schema format To: Apurva Nandan Cc: Serge Semin , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Mark Brown , MTD Maling List , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , linux-spi , Michael Walle Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 21, 2021 at 8:43 AM Apurva Nandan wrote: > > Hi Rob, > > On 21/09/21 2:46 am, Rob Herring wrote: > > On Mon, Sep 20, 2021 at 06:06:51PM +0300, Serge Semin wrote: > >> 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. > > Yes, as mentioned there's patches doing this. But the above is fine. > > There's some value in defining here which properties are valid. > Yeah right > >> 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? > > No SPI nand devices >4GB? > Yeah, we have SPI NANDs >4GB, and "'#address-cells': true" allows those > sizes. > > > >>> + > >>> +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. > > That should probably all be in mtd.yaml. The question here is whether > > partitions are always under a 'partitions' node. Maybe this is new > > enough that only the new way has to be supported. Though if mtd.yaml > > supported both forms, allowing both all the time is okay IMO. > > > > Rob > > I had added the "partition" node properties in the v1 patch, but as per > the reviews I removed it. > I think we can prefer having them in mtd.yaml if needed, in a separate > patch series. > Do you prefer the mtd.yaml changes as a part of this series or as a > separate patch? > > Other than that, I don't find any need for a v3 patch re-roll, do you agree? Yeah, I suppose not. Reviewed-by: Rob Herring And actually, it's Miquel that should apply these 2 rather than Mark. Rob