Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1638136lqt; Wed, 20 Mar 2024 09:35:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWMnEib1yTbU885V7ARtjm/TXVDHWDoc3bK0RhtCAKyY3UiNK/L210OjFNPlEXebyEfJ5FIVQeFJEol7Dbkgn1U9D4+Ahj6q1GCiNgvNQ== X-Google-Smtp-Source: AGHT+IE5uw2AROyJxvOD3RHJcXTbgtlu8p30sB6NLTik0hZ0RuiSs3Q1XD9c7tW80cW4gAw925sP X-Received: by 2002:a05:6358:724b:b0:17a:ec6c:4234 with SMTP id i11-20020a056358724b00b0017aec6c4234mr2849407rwa.10.1710952547476; Wed, 20 Mar 2024 09:35:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710952547; cv=pass; d=google.com; s=arc-20160816; b=HQ/eFudakuS4GNWGewz7AsKIFTdYvBJCgWjNmXy4r7/GCG2s2OVvCNNywEWgPesu3Y 3PM3XNYCfAKaoDkRbaX8LBytdBnW4JBoihQI/hdZKZ9GP1+78ao+4erJNc10D39gIBN4 3wiayCF0oeRJ+jYqSF9rp/AqLtMgr9RCDVyhZ1kymkElgyEtZ+PVfvhToXyFT8Sx75aj aRNLWJmOjbNgHEX/ZuB7ZLV1naodkkJaxjqW11oMMyNTMpjR8HkDc5yGDG4RhKOPGS4Y xaczCoXEWKLHd93+5Bmfb+WCBVEwRjU9TeG5DlA+W10QuOBA9mI2g/JJf9/SU9KdnnOo SJUg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=kUy55V+72LAFV5re1VZA+XdCnpWz/M3w13XSc+1rQVo=; fh=xBPW+7dTHDfNImxxVVIxo1yaifSBLSd8Q+9mIr4OWiU=; b=LZLMPKwRr7ctP6KqyWr6psDDZAWuh89UpspRtjh43LII7Fxzsb0s8Mo0m29TesxVtE CVK01Gj08vnrSFziyl4MACzsCqcnhQYX3onUXdMAvYZQvpCdi7pqZ+edEAhcCpGGJtnm JzqTqi88RI90T1XUJIs+1Vzg9vZ1njtQz3LHjJsoPj5Y+0fxbqtLOm7u4pbtjhp+Oe+1 tv+GFEV9kEpZeazMyXjcp2RaSArD4vNRKcc462W4XzKMpYFB1p0HtPMlbgnK+G5yMcDx TrMCg0mPPXem8es093Vt8jfFzDBB/O+x5yYN1SyOLCJlUB26vfJEe0pRKymQ2VlVBgF/ /Hww==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P3Q641IL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-109173-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109173-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id r3-20020a632b03000000b005dc85a7eb1dsi12501080pgr.299.2024.03.20.09.35.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 09:35:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-109173-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P3Q641IL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-109173-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109173-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2090E283118 for ; Wed, 20 Mar 2024 16:35:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 36EE315C3; Wed, 20 Mar 2024 16:35:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="P3Q641IL" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 223FAEDC; Wed, 20 Mar 2024 16:35:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710952539; cv=none; b=ieXapqpnWdSL3L0AuKkT3NbdRiKeA8+0NkDqpzfgtD1TGL5dDlF3FigeKyC3SBjDBZs8EvYducuPhR5m3pbxG8TgTTgWboDaVzgAPHgjwVG4kRHJ5V2SVMe71CYEWcCY52KJGaLbA0SavuflRkKrUkewykFCpbm2mtHSc8cBllo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710952539; c=relaxed/simple; bh=XXysw+Fp50tmDvgt52SH9gz9silSVStNGQhh5AqQXC4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=X3dc9WSJbEypPMsqSpRlDtl/GM0T1aG+H4NW/IwREpIQcBlARRj/sTMyzfx20P4KVPpJC/RY5Gnd+Dtky1J8nYdCvCr/pyzRwTeMT+BbHDNASeJkhXnV3PAj8MYXLmO47SsMUDO1jqOgfUw7FrChCHr4PuHptvZE9ORlh4fH7Vs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=P3Q641IL; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E190DC433F1; Wed, 20 Mar 2024 16:35:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710952538; bh=XXysw+Fp50tmDvgt52SH9gz9silSVStNGQhh5AqQXC4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=P3Q641ILZ0No81xX3jZUcFVi2vSrDDqy73xLyc1DCJv8XVFZoxDQVYAvUBfFLzoEa qDkncCb/4CouGt8j9uXafZWnwzc4dBg/xC7IKmXFOUyBK7YQp6WUxko+WX3qOK7vrA K5W9LJSFT5DgE+CGt4cB++/1nmew5/L+znkLT1clGllGiTvdVQWEPLngqN4/J6fafv GP7BZymDBz825X6b5+QrOdBNZ/lMPp2CnwiCerKQvN6Lq/gR+77S5Appm/rgtwvDXv gg9hPKerTHSeWg17roDqwlZlyt+7BuZ6dGqnBzMHBjAkqfm5wM8/NY4tpdQVSQIDrJ OqRObsj3u+rjQ== Date: Wed, 20 Mar 2024 16:35:33 +0000 From: Conor Dooley To: Balamanikandan Gunasundar Cc: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] dt-bindings: mtd: atmel-nand: convert txt to yaml Message-ID: <20240320-quicksand-attentive-14610103237b@spud> References: <20240320-linux-next-nand-yaml-v1-0-2d2495363e88@microchip.com> <20240320-linux-next-nand-yaml-v1-1-2d2495363e88@microchip.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="c4iHnKnVlwr9DxCN" Content-Disposition: inline In-Reply-To: <20240320-linux-next-nand-yaml-v1-1-2d2495363e88@microchip.com> --c4iHnKnVlwr9DxCN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 20, 2024 at 11:22:07AM +0530, Balamanikandan Gunasundar wrote: > Convert text to yaml for atmel nand controller >=20 > Signed-off-by: Balamanikandan Gunasundar > --- > .../devicetree/bindings/mtd/atmel-nand.txt | 50 ------- > .../devicetree/bindings/mtd/atmel-nand.yaml | 166 +++++++++++++++= ++++++ > MAINTAINERS | 2 +- > 3 files changed, 167 insertions(+), 51 deletions(-) > diff --git a/Documentation/devicetree/bindings/mtd/atmel-nand.yaml b/Docu= mentation/devicetree/bindings/mtd/atmel-nand.yaml > new file mode 100644 > index 000000000000..a5482d292293 > --- /dev/null > +++ b/Documentation/devicetree/bindings/mtd/atmel-nand.yaml Filename matching a compatible please. > @@ -0,0 +1,166 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/mtd/atmel-nand.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Atmel NAND flash controller > + > +maintainers: > + - Balamanikandan Gunasundar > + > +description: | > + The NAND flash controller node should be defined under the EBI bus (see > + Documentation/devicetree/bindings/memory-controllers/atmel,ebi.txt|yam= l). text|yaml? > + One or several NAND devices can be defined under this NAND controller. > + The NAND controller might be connected to an ECC engine. > + > +properties: > + compatible: > + oneOf: > + - items: > + - enum: This is just an enum, drop the items and oneof. > + - atmel,at91rm9200-nand-controller > + - atmel,at91sam9260-nand-controller > + - atmel,at91sam9261-nand-controller > + - atmel,at91sam9g45-nand-controller > + - atmel,sama5d3-nand-controller > + - microchip,sam9x60-nand-controller > + > + ranges: > + description: empty ranges property to forward EBI ranges definitions. > + > + ecc-engine: > + description: > + phandle to the PMECC block. Only meaningful if the SoC embeds a PM= ECC > + engine. > + > +allOf: > + - if: > + properties: > + compatible: > + contains: > + enum: > + - atmel,at91rm9200-nand-controller > + - atmel,at91sam9260-nand-controller > + - atmel,at91sam9261-nand-controller > + - atmel,at91sam9g45-nand-controller > + - atmel,sama5d3-nand-controller > + - microchip,sam9x60-nand-controller > + then: > + properties: > + "#address-cells": > + const: 2 > + > + "#size-cells": > + const: 1 Why is this in an if? Isn't this all of the devices in the binding? > + > + - if: > + properties: > + compatible: > + contains: > + const: atmel,sama5d3-nand-controller > + then: > + properties: > + atmel,nfc-io: > + $ref: /schemas/types.yaml#/definitions/phandle > + description: phandle to the NFC IO block. > + > + atmel,nfc-sram: > + $ref: /schemas/types.yaml#/definitions/phandle > + description: phandle to the NFC SRAM block Please define the properties at the top level and use if statements to constrain them. > + > +required: > + - compatible > + - ranges > + - "#address-cells" > + - "#size-cells" > + > +patternProperties: > + "^nand@[a-f0-9]$": > + type: object > + $ref: nand-chip.yaml# > + description: > + NAND chip bindings. All generic properties described in > + Documentation/devicetree/bindings/mtd/{common,nand}.txt also apply= to > + the NAND device node, and NAND partitions should be defined under = the > + NAND node as described in > + Documentation/devicetree/bindings/mtd/partition.txt. These files do not exist. > + properties: > + reg: > + minItems: 1 > + description: > + describes the CS lines assigned to the NAND device. If the NAN= D device > + exposes multiple CS lines (multi-dies chips), your reg propert= y will > + contain X tuples of 3 entries. The "if" here is not accurate. Your binding mandates there being 3 entries. > + reg =3D <0x3 0x0 0x800000>; > + 1st entry - the CS line this NAND chip is connected to > + 2nd entry - the base offset of the memory region assigned to t= his > + device (always 0) > + 3rd entry - the memory region size (always 0x800000) > + > + rb-gpios: > + description: > + the GPIO(s) used to check the Ready/Busy status of the NAND. > + > + cs-gpios: > + description: > + the GPIO(s) used to control the CS line. > + > + det-gpios: > + description: > + the GPIO used to detect if a Smartmedia Card is present. > + > + "atmel,rb": > + description: > + an integer identifying the native Ready/Busy pin. Only meaning= ful > + on sama5 SoCs. Then please constrain it to sama5 SoCs only :) > + $ref: /schemas/types.yaml#/definitions/uint32 > + > +unevaluatedProperties: false > + > +examples: > + - | > + nfc_io: nfc-io@70000000 { > + compatible =3D "atmel,sama5d3-nfc-io", "syscon"; > + reg =3D <0x70000000 0x8000000>; > + }; What's this got to do with the binding? > + pmecc: ecc-engine@ffffc070 { > + compatible =3D "atmel,at91sam9g45-pmecc"; > + reg =3D <0xffffc070 0x490>, > + <0xffffc500 0x100>; > + }; > + > + ebi: ebi@10000000 { Drop the unused label. Same applies here, read the coding style about how to write dts nodes please. Thanks, Conor. > + compatible =3D "atmel,sama5d3-ebi"; > + #address-cells =3D <2>; > + #size-cells =3D <1>; > + atmel,smc =3D <&hsmc>; > + reg =3D <0x10000000 0x10000000 > + 0x40000000 0x30000000>; > + ranges =3D <0x0 0x0 0x10000000 0x10000000 > + 0x1 0x0 0x40000000 0x10000000 > + 0x2 0x0 0x50000000 0x10000000 > + 0x3 0x0 0x60000000 0x10000000>; > + clocks =3D <&mck>; > + > + nandflash_controller: nandflash-controller { > + compatible =3D "atmel,sama5d3-nand-controller"; > + ecc-engine =3D <&pmecc>; > + #address-cells =3D <2>; > + #size-cells =3D <1>; > + ranges; > + > + nand@3 { > + reg =3D <0x3 0x0 0x800000>; > + atmel,rb =3D <0>; > + > + /* > + * Put generic NAND/MTD properties and > + * subnodes here. > + */ > + }; > + }; > + }; > diff --git a/MAINTAINERS b/MAINTAINERS > index b6582bd3eb2c..3f2a6756223f 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -14503,7 +14503,7 @@ MICROCHIP NAND DRIVER > M: Balamanikandan Gunasundar > L: linux-mtd@lists.infradead.org > S: Supported > -F: Documentation/devicetree/bindings/mtd/atmel-nand.txt > +F: Documentation/devicetree/bindings/mtd/atmel-*.yaml > F: drivers/mtd/nand/raw/atmel/* > =20 > MICROCHIP OTPC DRIVER >=20 > --=20 > 2.25.1 >=20 --c4iHnKnVlwr9DxCN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZfsQVQAKCRB4tDGHoIJi 0koTAP4tmQxWlMJxtREutkSakIUYmZspbFGKbQ8eJnAwETV95AD/Y/aeQTbfPVFf J+/ZBy5T6kUykFIsMfA9+lz5Yea25gM= =yzG5 -----END PGP SIGNATURE----- --c4iHnKnVlwr9DxCN--