From patchwork Tue Mar 11 12:28:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balamanikandan Gunasundar X-Patchwork-Id: 14011777 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 73923C28B2E for ; Tue, 11 Mar 2025 12:45:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=iG4+EZdpeFybj3UDwpH3cbeF+tuBGlKOCbbhg03mktE=; b=Rpz97av2kQMjS8gLwZVTFkHs4V sGtbQb//q3OTksqLs8NRd3qHIbBb3FmF+kK6S59bqF0fLUSf9vN4HdsmXM1h/g8Sy9tUgaonA292i c8gitPQhWwJ2YOEmGmd+FavmUtIBJM5lYhfguwlTPRCx5E7PZx8quwmaYpoHUYGF2vOZNPfOK6Of+ yPiwWB6ReLY9ATiafc+4eQRiwmnpsNT7Ob9B86uoQ57NBeQZZFOzGeUgp8MpTTBZibMTDtEbs4xiL nnM0UiLdlQj9JMf+pf79QR6FRQuTbS0zfVfQweo7cjQPa4vRmH5Pv8jZPPACqABBqo6kNCXXckY3H XRCONNhQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tryyl-00000005iO8-1aNz; Tue, 11 Mar 2025 12:45:03 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tryjY-00000005e7X-1ktl; Tue, 11 Mar 2025 12:29:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1741696160; x=1773232160; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=e/hZ0vi7ZolpvUO0eVwjRgjeJClTy/KTdz/vQ+UYy1w=; b=zJItyru5XEWMFwfXqlv/t5a/QUvlOWRIWu1C7bDPw8gE50SrDwocKduL Geh0ojW+YNHVShW7ztHAdW4Dck6cZV2Kg3p3MD+ItLExbHoVXUr3Oti0W y/m2tQs9w/FLKXJohQWxQG8tqCIrjKMKbarD2zzAcjQimzMgLqc6JWKlM dNKNix0HZWfFfydrhC+hYbL1StZpCJH3+ejHrbGrM0DDBgtxa7Uie24J+ lVBMJYSC7toXhD/X7MkTJ0r+a1m4MZtyknvU9oIi753TgCRqb53aFRBt3 6ivybTrd0wzStdqqY4g15wmEdtfvUuQ0/jigmbbHr9pIGWjhHDfwKs1jO A==; X-CSE-ConnectionGUID: d0aXCjEFQVuCEk822uv6wQ== X-CSE-MsgGUID: sDIGSaGDQI2izc1UiQfZiQ== X-IronPort-AV: E=Sophos;i="6.14,239,1736838000"; d="scan'208";a="39234194" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 11 Mar 2025 05:29:19 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 11 Mar 2025 05:29:08 -0700 Received: from che-lt-i64410lx.microchip.com (10.10.85.11) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.44 via Frontend Transport; Tue, 11 Mar 2025 05:29:02 -0700 From: Balamanikandan Gunasundar To: , , , , , , , , , CC: , , , , Subject: [PATCH v2 1/3] dt-bindings: mtd: microchip-nand: convert txt to yaml Date: Tue, 11 Mar 2025 17:58:45 +0530 Message-ID: <20250311122847.90081-2-balamanikandan.gunasundar@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250311122847.90081-1-balamanikandan.gunasundar@microchip.com> References: <20250311122847.90081-1-balamanikandan.gunasundar@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250311_052920_519979_B9416149 X-CRM114-Status: GOOD ( 23.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Convert text to yaml for microchip nand controller Signed-off-by: Balamanikandan Gunasundar --- Changes in v2: - Change the filename to match the compatible string - Drop items and oneOf in the compatible property as it is just an enum - Remove the if in the #address-cells and #size-cells - Remove the unwanted comments that refers to .txt files - Fix reg property description - Define the properties in a list and add constraints - Fix DT coding style and droped unused labels .../devicetree/bindings/mtd/atmel-nand.txt | 50 ----- .../mtd/microchip,nand-controller.yaml | 175 ++++++++++++++++++ 2 files changed, 175 insertions(+), 50 deletions(-) create mode 100644 Documentation/devicetree/bindings/mtd/microchip,nand-controller.yaml diff --git a/Documentation/devicetree/bindings/mtd/atmel-nand.txt b/Documentation/devicetree/bindings/mtd/atmel-nand.txt index e36c35b17873..dbbc17a866f2 100644 --- a/Documentation/devicetree/bindings/mtd/atmel-nand.txt +++ b/Documentation/devicetree/bindings/mtd/atmel-nand.txt @@ -1,53 +1,3 @@ -Atmel NAND flash controller bindings - -The NAND flash controller node should be defined under the EBI bus (see -Documentation/devicetree/bindings/memory-controllers/atmel,ebi.txt). -One or several NAND devices can be defined under this NAND controller. -The NAND controller might be connected to an ECC engine. - -* NAND controller bindings: - -Required properties: -- compatible: should be one of the following - "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: empty ranges property to forward EBI ranges definitions. -- #address-cells: should be set to 2. -- #size-cells: should be set to 1. -- atmel,nfc-io: phandle to the NFC IO block. Only required for sama5d3 - controllers. -- atmel,nfc-sram: phandle to the NFC SRAM block. Only required for sama5d3 - controllers. - -Optional properties: -- ecc-engine: phandle to the PMECC block. Only meaningful if the SoC embeds - a PMECC engine. - -* NAND device/chip bindings: - -Required properties: -- reg: describes the CS lines assigned to the NAND device. If the NAND device - exposes multiple CS lines (multi-dies chips), your reg property will - contain X tuples of 3 entries. - 1st entry: the CS line this NAND chip is connected to - 2nd entry: the base offset of the memory region assigned to this - device (always 0) - 3rd entry: the memory region size (always 0x800000) - -Optional properties: -- rb-gpios: the GPIO(s) used to check the Ready/Busy status of the NAND. -- cs-gpios: the GPIO(s) used to control the CS line. -- det-gpios: the GPIO used to detect if a Smartmedia Card is present. -- atmel,rb: an integer identifying the native Ready/Busy pin. Only meaningful - on sama5 SoCs. - -All generic properties are described in the generic yaml files under -Documentation/devicetree/bindings/mtd/. - * ECC engine (PMECC) bindings: Required properties: diff --git a/Documentation/devicetree/bindings/mtd/microchip,nand-controller.yaml b/Documentation/devicetree/bindings/mtd/microchip,nand-controller.yaml new file mode 100644 index 000000000000..bf644ab0cf27 --- /dev/null +++ b/Documentation/devicetree/bindings/mtd/microchip,nand-controller.yaml @@ -0,0 +1,175 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mtd/microchip,nand-controller.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Microchip 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). + One or several NAND devices can be defined under this NAND controller. + The NAND controller might be connected to an ECC engine. + +properties: + compatible: + 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 + + 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 PMECC + engine. + + "#address-cells": + const: 2 + + "#size-cells": + const: 1 + + atmel,nfc-io: + $ref: /schemas/types.yaml#/definitions/phandle + description: phandle to the NFC IO block. Only applicable for atmel,sama5d3-nand-controller + + atmel,nfc-sram: + $ref: /schemas/types.yaml#/definitions/phandle + description: phandle to the NFC SRAM block. Only applicable for atmel,sama5d3-nand-controller + +required: + - compatible + - ranges + - "#address-cells" + - "#size-cells" + +patternProperties: + "^nand@[a-f0-9]$": + type: object + $ref: raw-nand-chip.yaml# + description: + NAND chip bindings. + + additionalProperties: false + + properties: + reg: + items: + - items: + - description: describes the CS lines assigned to the NAND device. + - description: the base offset of the memory region assigned to this device (always 0) + - description: 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. + $ref: /schemas/types.yaml#/definitions/uint32 + + nand-ecc-step-size: + const: 512 + + nand-ecc-strength: + enum: [2, 4, 8] + + nand-ecc-mode: + enum: [soft, hw] + + nand-bus-width: + const: 8 + + nand-on-flash-bbt: true + + partitions: + $ref: /schemas/mtd/partitions/partitions.yaml + + label: + description: Name or Label of the device + + allOf: + - if: + properties: + compatible: + contains: + const: atmel,sama5d3-nand-controller + then: + properties: + "atmel,rb": + description: an integer identifying the native Ready/Busy pin. + +unevaluatedProperties: false + +examples: + - | + nfc_io: nfc-io@70000000 { + compatible = "atmel,sama5d3-nfc-io", "syscon"; + reg = <0x70000000 0x8000000>; + }; + + nfc_sram: sram@200000 { + compatible = "mmio-sram"; + no-memory-wc; + reg = <0x200000 0x2400>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x200000 0x2400>; + }; + + pmecc: ecc-engine@ffffc070 { + compatible = "atmel,at91sam9g45-pmecc"; + reg = <0xffffc070 0x490>, + <0xffffc500 0x100>; + }; + + ebi@10000000 { + compatible = "atmel,sama5d3-ebi"; + #address-cells = <2>; + #size-cells = <1>; + atmel,smc = <&hsmc>; + reg = <0x10000000 0x10000000 + 0x40000000 0x30000000>; + ranges = <0x0 0x0 0x10000000 0x10000000 + 0x1 0x0 0x40000000 0x10000000 + 0x2 0x0 0x50000000 0x10000000 + 0x3 0x0 0x60000000 0x10000000>; + clocks = <&mck>; + + nand_controller: nand-controller { + compatible = "atmel,sama5d3-nand-controller"; + atmel,nfc-sram = <&nfc_sram>; + atmel,nfc-io = <&nfc_io>; + ecc-engine = <&pmecc>; + #address-cells = <2>; + #size-cells = <1>; + ranges; + + nand@3 { + reg = <0x3 0x0 0x800000>; + atmel,rb = <0>; + /* + * Put generic NAND/MTD properties and + * subnodes here. + */ + }; + }; + };