From patchwork Wed Mar 20 05:52:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balamanikandan Gunasundar X-Patchwork-Id: 13597317 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 C2DC9C6FD1F for ; Wed, 20 Mar 2024 05:53:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:CC:To:In-Reply-To:References:Message-ID :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7m1MVfSHmmy/YCKh60ZJbx/BMQruCAWh1DTAeVUt5EE=; b=J+2DCNA3r84QRZ 92W6qF5Rn9xrw6gPjTD11k+3BFlNCsX8Af6F80QCeQIKDpq+n3LxO69EoTYDBgrSUPLlI9BK6QsWD ZxHIaJhdMCetKxpBfhms39yCmS1qm7s8Tom9dCyJmaA0ZXei8IOz5ARGY97hjqNHx+Vn96Ns3XBf9 Q2cUsZNbW8z68OZ2I5B0qSaPK315pAP3TVFNfsMc5a2o1GpfqxuYG9g6mqIez9ZMWjOWDi1+GWJDU emSZT3AombY7nmYMaydeypLs9gtw3rv1loCgKpGykaYhH15AUlFJ7myXaD28pkAw/EpoYxWBadHSq TlqE0Gv004MIfayYCmgw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rmosy-0000000FZ1j-1MxU; Wed, 20 Mar 2024 05:53:12 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rmost-0000000FZ0E-1qmx; Wed, 20 Mar 2024 05:53:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1710913987; x=1742449987; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=COAVE7vXC85Z8Tas67uNZMjiwz4RRVQgdV0b0DGVTYU=; b=pPaeJj1SKfJLCkdMMPmjOtIpOWFUI9BGw9+vR7DgHwmFW4K4vlk1YJHi ChC6qW69wX1/81n2WgjIJmvZTXybyfieehUgXbpMRP3FpZI7MKcsHJmA0 xGGckOvjsSF0gCOHOjUdxgQBhJVdyHt2Hdj8WLlVDQaTPFefZcHthtre7 29vFhVGoEiXSEsuDjDcF40uAghWUB3ep0Wp9kDLvfgm5iYFHAYxoG0HcR h4widzTfwIhV66A4oTaIkeGoIuwPDE2Gpx3QvmvV8iuhiQit53h80xS7G xV+501HgfpHeXu28+x649fhP26UXgiGILmpngenusOJu5uOP2+xZTFFuN g==; X-CSE-ConnectionGUID: JdC9FX/zRcy0DPyWmaJLzA== X-CSE-MsgGUID: LzlreK2PRgukWJ3FeGft+A== X-IronPort-AV: E=Sophos;i="6.07,139,1708412400"; d="scan'208";a="17851047" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 19 Mar 2024 22:53:06 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 19 Mar 2024 22:52:56 -0700 Received: from che-lt-i64410lx.microchip.com (10.10.85.11) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Tue, 19 Mar 2024 22:52:49 -0700 From: Balamanikandan Gunasundar Date: Wed, 20 Mar 2024 11:22:07 +0530 Subject: [PATCH 1/3] dt-bindings: mtd: atmel-nand: convert txt to yaml MIME-Version: 1.0 Message-ID: <20240320-linux-next-nand-yaml-v1-1-2d2495363e88@microchip.com> References: <20240320-linux-next-nand-yaml-v1-0-2d2495363e88@microchip.com> In-Reply-To: <20240320-linux-next-nand-yaml-v1-0-2d2495363e88@microchip.com> To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea CC: , , , , Balamanikandan Gunasundar X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240319_225307_858066_C34D63A2 X-CRM114-Status: GOOD ( 22.62 ) 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 atmel nand controller 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.txt b/Documentation/devicetree/bindings/mtd/atmel-nand.txt index 4598930851d9..e332515c499a 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/atmel-nand.yaml b/Documentation/devicetree/bindings/mtd/atmel-nand.yaml new file mode 100644 index 000000000000..a5482d292293 --- /dev/null +++ b/Documentation/devicetree/bindings/mtd/atmel-nand.yaml @@ -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|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: + - 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. + +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 + + - 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 + +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. + + properties: + reg: + minItems: 1 + description: + 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. + reg = <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 this + 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 meaningful + on sama5 SoCs. + $ref: /schemas/types.yaml#/definitions/uint32 + +unevaluatedProperties: false + +examples: + - | + nfc_io: nfc-io@70000000 { + compatible = "atmel,sama5d3-nfc-io", "syscon"; + reg = <0x70000000 0x8000000>; + }; + + pmecc: ecc-engine@ffffc070 { + compatible = "atmel,at91sam9g45-pmecc"; + reg = <0xffffc070 0x490>, + <0xffffc500 0x100>; + }; + + ebi: 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>; + + nandflash_controller: nandflash-controller { + compatible = "atmel,sama5d3-nand-controller"; + 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. + */ + }; + }; + }; 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/* MICROCHIP OTPC DRIVER From patchwork Wed Mar 20 05:52:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balamanikandan Gunasundar X-Patchwork-Id: 13597318 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 2C970C54E67 for ; Wed, 20 Mar 2024 05:53:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:CC:To:In-Reply-To:References:Message-ID :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HrEmcR+CP0v96iBD15XFpZw+vkbrajxB7Njz1et2+Gs=; b=a9r1JU6PnVTLfh 5DvymNuPtHIo+chDWd0oU1ox6MJBdEbauMTQWbfKHZSEwzIKg3IhZ4BO3t+4UC/LdWoJd7n8X3n/n bTLkrdUAa9oFJr0F7z+KWiA4Y7KBWbov66GVBPqDEDMhphZB9Kl/7LJrzRQNLZJdKFVv5zqBBJ0MM K9MgmxH/AtfZ+Th8YjiLHGLqZcBynPbUMq+wgoLKZIQZ0/KQFlKhdE0Ynst0MpEaw/oTEyqJ2ROav 8S+CMgMd+L9Z7AyR9C3X6iQU+Gm0XWP8o6Idj02j+AAuZpXDJiuC9ibvFKWYnjlCB9XATtgDJ49pn uEtmDDiltYGHKqH3VJ+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rmotF-0000000FZB1-0oMx; Wed, 20 Mar 2024 05:53:29 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rmot3-0000000FZ3q-3SPr; Wed, 20 Mar 2024 05:53:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1710913998; x=1742449998; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=++8vvQ5hirZaSfFCqLhFu4Spw6Ti2cR5DDvaSvz/peI=; b=E6SqaW6vOFWRC4WndKnUzgy38nWUmqCQbxxzUlomoxLbVYOD6rkBFvKK BgBka8eggDDWsja3Q5M2uVPWK6ocLvEgSnpdi91BfTT/DIK3rz9BthzCJ qWDvcRch5t2YyO5nfvsx5wnm++0KFKWc+YKyx+DG3Ux9N/jCPPzNegIFz MkAosqFs82M/vW3Mb/0T3JH48O6gltfsERrupuESiGGHW94232z4mak44 rqA2eIp852jla3ZNwrF+c0fESwKYYI7tl/NsHWLymdGjBzybdhiruRaaB dzlHUSCv5Ibq5e5CaOPUlke5i/3+haU22eLZ5C+8DQcb5sVeN92UQV6sC A==; X-CSE-ConnectionGUID: pwKNWpSMQSid8NZ/wklJJA== X-CSE-MsgGUID: UF2ibNYSTCWylwLOawa1NQ== X-IronPort-AV: E=Sophos;i="6.07,139,1708412400"; d="scan'208";a="17887323" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 19 Mar 2024 22:53:15 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 19 Mar 2024 22:53:05 -0700 Received: from che-lt-i64410lx.microchip.com (10.10.85.11) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Tue, 19 Mar 2024 22:52:57 -0700 From: Balamanikandan Gunasundar Date: Wed, 20 Mar 2024 11:22:08 +0530 Subject: [PATCH 2/3] dt-bindings: mtd: atmel-nand: add atmel pmecc MIME-Version: 1.0 Message-ID: <20240320-linux-next-nand-yaml-v1-2-2d2495363e88@microchip.com> References: <20240320-linux-next-nand-yaml-v1-0-2d2495363e88@microchip.com> In-Reply-To: <20240320-linux-next-nand-yaml-v1-0-2d2495363e88@microchip.com> To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea CC: , , , , Balamanikandan Gunasundar X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240319_225318_082809_CBF29440 X-CRM114-Status: GOOD ( 16.48 ) 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 Add bindings for programmable multibit error correction code controller (PMECC). Signed-off-by: Balamanikandan Gunasundar --- .../devicetree/bindings/mtd/atmel-nand.txt | 70 ---------------------- .../devicetree/bindings/mtd/atmel-pmecc.yaml | 58 ++++++++++++++++++ 2 files changed, 58 insertions(+), 70 deletions(-) diff --git a/Documentation/devicetree/bindings/mtd/atmel-nand.txt b/Documentation/devicetree/bindings/mtd/atmel-nand.txt index e332515c499a..1934614a9298 100644 --- a/Documentation/devicetree/bindings/mtd/atmel-nand.txt +++ b/Documentation/devicetree/bindings/mtd/atmel-nand.txt @@ -1,73 +1,3 @@ -* ECC engine (PMECC) bindings: - -Required properties: -- compatible: should be one of the following - "atmel,at91sam9g45-pmecc" - "atmel,sama5d4-pmecc" - "atmel,sama5d2-pmecc" - "microchip,sam9x60-pmecc" - "microchip,sam9x7-pmecc", "atmel,at91sam9g45-pmecc" -- reg: should contain 2 register ranges. The first one is pointing to the PMECC - block, and the second one to the PMECC_ERRLOC block. - -* SAMA5 NFC I/O bindings: - -SAMA5 SoCs embed an advanced NAND controller logic to automate READ/WRITE page -operations. This interface to this logic is placed in a separate I/O range and -should thus have its own DT node. - -- compatible: should be "atmel,sama5d3-nfc-io", "syscon". -- reg: should contain the I/O range used to interact with the NFC logic. - -Example: - - nfc_io: nfc-io@70000000 { - compatible = "atmel,sama5d3-nfc-io", "syscon"; - reg = <0x70000000 0x8000000>; - }; - - pmecc: ecc-engine@ffffc070 { - compatible = "atmel,at91sam9g45-pmecc"; - reg = <0xffffc070 0x490>, - <0xffffc500 0x100>; - }; - - ebi: 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. - */ - }; - }; - }; - ------------------------------------------------------------------------ - Deprecated bindings (should not be used in new device trees): Required properties: diff --git a/Documentation/devicetree/bindings/mtd/atmel-pmecc.yaml b/Documentation/devicetree/bindings/mtd/atmel-pmecc.yaml new file mode 100644 index 000000000000..872401e9dda3 --- /dev/null +++ b/Documentation/devicetree/bindings/mtd/atmel-pmecc.yaml @@ -0,0 +1,58 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mtd/atmel-pmecc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Microchip pmecc controller + +maintainers: + - Balamanikandan Gunasundar + +description: | + Bindings for microchip Programmable Multibit Error Correction Code + Controller (PMECC). pmecc is a programmable BCH encoder/decoder. This + block is passed as the value to the "ecc-engine" property of microchip + nand flash controller node. + +properties: + compatible: + oneOf: + - enum: + - atmel,at91sam9g45-pmecc + - atmel,sama5d2-pmecc + - atmel,sama5d4-pmecc + - microchip,sam9x60-pmecc + - microchip,sam9x7-pmecc + - items: + - const: microchip,sam9x60-pmecc + - const: atmel,at91sam9g45-pmecc + + reg: + description: + The first should point to the PMECC block. The second should point to the + PMECC_ERRLOC block. + +allOf: + - if: + properties: + compatible: + contains: + const: microchip,sam9x7-pmecc + then: + properties: + clocks: + description: + The clock source for pmecc controller + maxItems: 1 + +unevaluatedProperties: false + +examples: + - | + pmecc: ecc-engine@ffffc070 { + compatible = "microchip,sam9x7-pmecc"; + reg = <0xffffe000 0x300>, + <0xffffe600 0x100>; + clocks = <&pmc 2 48>; + }; From patchwork Wed Mar 20 05:52:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balamanikandan Gunasundar X-Patchwork-Id: 13597319 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 083CBC54E58 for ; Wed, 20 Mar 2024 05:54:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:CC:To:In-Reply-To:References:Message-ID :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=88sWH/7uNtFFEF8hoLDJGAPJoG/D3AlA9bAAFZJOEJY=; b=VDY+lI6MZctgLX p2sP7GQa5epjmSLihh+02v8NGmcpI3aDlW9d+y7xGtAJx5lQrmzQreOmjJe42o9VN9ejS+eYgDzVr lgZ2YjBg0mhzTZnGeA84e+WiDnMRqhfPd4dYqfThOOpUXPvfOExnvUi0olIBdaZgvhO14HHKYA4tw vG12OJUQhe/LuTPdZdgu6RO+/4QbMcZJmZxfd4Z1OEjfUSyLZYcEovE4+parS4cU58YU4SEklqtX0 7Z+a55dO/N88ZY/Tfq3/I+fMDY+sprnwpsF+/YMPppovp7vCZsUgBJ9yd6iaSU5XFOhvydK1vYCXI YWgl1fkSkySnBEF/1t4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rmotf-0000000FZUw-1Lrp; Wed, 20 Mar 2024 05:53:55 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rmot6-0000000FZ3q-0paZ; Wed, 20 Mar 2024 05:53:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1710914000; x=1742450000; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=s8Lr1M8RUL7PqBz81PGymM1Ltwj2a+he6G8+75T/hPo=; b=sWy/ZTtbRT/7LwB7lUe3Wuigpx4+1Abj4YljB5kd2RtQZ9rAdpF9mpTf mzwPjBjugUY1UvhpmWHpKsW4G4sSLYzydvNFubPtENx3DudK3ir+NcejT vsm2bjZVBFC4pZquvA3rNUYIC0tXYbj5p48B5rUxriQgStiEf6e2f8aMt f73l6aPZUXOMvpshWOtZ53/vGkSdOjo26B4IxAWZqzVsajuztHJ+IL5oJ Ezvsu7RvCfN21CT8XTErejTPKNiWfthwYosn+1o/mcFiXnQXtfNmCawIa DOCsx1rBk89s//+8IXSmeb88PrkADL3RP/8bWPMBvg0fPGk4Tda+QRndh Q==; X-CSE-ConnectionGUID: pwKNWpSMQSid8NZ/wklJJA== X-CSE-MsgGUID: cccJKGy2TKiNMJWaOEdObQ== X-IronPort-AV: E=Sophos;i="6.07,139,1708412400"; d="scan'208";a="17887329" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 19 Mar 2024 22:53:16 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 19 Mar 2024 22:53:11 -0700 Received: from che-lt-i64410lx.microchip.com (10.10.85.11) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Tue, 19 Mar 2024 22:53:05 -0700 From: Balamanikandan Gunasundar Date: Wed, 20 Mar 2024 11:22:09 +0530 Subject: [PATCH 3/3] dt-bindings: mtd: atmel-nand: add deprecated bindings MIME-Version: 1.0 Message-ID: <20240320-linux-next-nand-yaml-v1-3-2d2495363e88@microchip.com> References: <20240320-linux-next-nand-yaml-v1-0-2d2495363e88@microchip.com> In-Reply-To: <20240320-linux-next-nand-yaml-v1-0-2d2495363e88@microchip.com> To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea CC: , , , , Balamanikandan Gunasundar X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240319_225320_569320_7156EECF X-CRM114-Status: GOOD ( 24.46 ) 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 Add nand bindings for legacy nand controllers. These bindings are not used with the new device trees. This is still maintained to support legacy dt bindings. Signed-off-by: Balamanikandan Gunasundar --- .../bindings/mtd/atmel-nand-deprecated.yaml | 156 +++++++++++++++++++++ .../devicetree/bindings/mtd/atmel-nand.txt | 116 --------------- 2 files changed, 156 insertions(+), 116 deletions(-) diff --git a/Documentation/devicetree/bindings/mtd/atmel-nand-deprecated.yaml b/Documentation/devicetree/bindings/mtd/atmel-nand-deprecated.yaml new file mode 100644 index 000000000000..c8922ab0f1d5 --- /dev/null +++ b/Documentation/devicetree/bindings/mtd/atmel-nand-deprecated.yaml @@ -0,0 +1,156 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mtd/atmel-nand-deprecated.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Atmel NAND flash controller deprecated bindings + +maintainers: + - Balamanikandan Gunasundar + +description: | + This should not be used in the new device trees. + +properties: + compatible: + enum: + - atmel,at91rm9200-nand + - atmel,sama5d2-nand + - atmel,sama5d4-nand + + reg: + description: + should specify localbus address and size used for the chip, and + hardware ECC controller if available. If the hardware ECC is PMECC, + it should contain address and size for PMECC and PMECC Error Location + controller. The PMECC lookup table address and size in ROM is + optional. If not specified, driver will build it in runtime. + + atmel,nand-addr-offset: + description: + offset for the address latch. + $ref: /schemas/types.yaml#/definitions/uint32 + + atmel,nand-cmd-offset: + description: + offset for the command latch. + $ref: /schemas/types.yaml#/definitions/uint32 + + "#address-cells": + description: + Must be present if the device has sub-nodes representing partitions + + "#size-cells": + description: + Must be present if the device has sub-nodes representing partitions. + + gpios: + description: + specifies the gpio pins to control the NAND device. detect is an + optional gpio and may be set to 0 if not present. + + atmel,nand-has-dma: + description: + support dma transfer for nand read/write. + $ref: /schemas/types.yaml#/definitions/flag + + atmel,has-pmecc: + description: + enable Programmable Multibit ECC hardware, capable of BCH encoding + and decoding, on devices where it is present. + $ref: /schemas/types.yaml#/definitions/flag + + nand-on-flash-bbt: + description: + enable on flash bbt option if not present false + $ref: /schemas/types.yaml#/definitions/flag + + nand-ecc-mode: + description: + operation mode of the NAND ecc mode, soft by default. Supported + enum: + [none, soft, hw, hw_syndrome, hw_oob_first, soft_bch] + $ref: /schemas/types.yaml#/definitions/string + + atmel,pmecc-cap: + description: + error correct capability for Programmable Multibit ECC Controller. If + the compatible string is "atmel,sama5d2-nand", 32 is also valid. + enum: + [2, 4, 8, 12, 24] + $ref: /schemas/types.yaml#/definitions/uint32 + + atmel,pmecc-sector-size: + description: + sector size for ECC computation. + enum: + [512, 1024] + $ref: /schemas/types.yaml#/definitions/uint32 + + atmel,pmecc-lookup-table-offset: + description: + includes two offsets of lookup table in ROM for different sector + size. First one is for sector size 512, the next is for sector size + 1024. If not specified, driver will build the table in runtime. + $ref: /schemas/types.yaml#/definitions/uint32-array + + nand-bus-width: + description: + nand bus width + enum: + [8, 16] + $ref: /schemas/types.yaml#/definitions/uint32 + +required: + - compatible + - reg + - atmel,nand-addr-offset + - atmel,nand-cmd-offset + - "#address-cells" + - "#size-cells" + - gpios + +unevaluatedProperties: false + +examples: + - | + nand0: nand@40000000,0 { + compatible = "atmel,at91rm9200-nand"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0x40000000 0x10000000 + 0xffffe800 0x200>; + atmel,nand-addr-offset = <21>; /* ale */ + atmel,nand-cmd-offset = <22>; /* cle */ + nand-on-flash-bbt; + nand-ecc-mode = "soft"; + gpios = <&pioC 13 0 /* rdy */ + &pioC 14 0 /* nce */ + 0 /* cd */ + >; + }; + - | + /* for PMECC supported chips */ + nand1@40000000 { + compatible = "atmel,at91rm9200-nand"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0x40000000 0x10000000 /* bus addr & size */ + 0xffffe000 0x00000600 /* PMECC addr & size */ + 0xffffe600 0x00000200 /* PMECC ERRLOC addr & size */ + 0x00100000 0x00100000>; /* ROM addr & size */ + + atmel,nand-addr-offset = <21>; /* ale */ + atmel,nand-cmd-offset = <22>; /* cle */ + nand-on-flash-bbt; + nand-ecc-mode = "hw"; + atmel,has-pmecc; /* enable PMECC */ + atmel,pmecc-cap = <2>; + atmel,pmecc-sector-size = <512>; + atmel,pmecc-lookup-table-offset = <0x8000 0x10000>; + gpios = <&pioD 5 0 /* rdy */ + &pioD 4 0 /* nce */ + 0 /* cd */ + >; + }; diff --git a/Documentation/devicetree/bindings/mtd/atmel-nand.txt b/Documentation/devicetree/bindings/mtd/atmel-nand.txt deleted file mode 100644 index 1934614a9298..000000000000 --- a/Documentation/devicetree/bindings/mtd/atmel-nand.txt +++ /dev/null @@ -1,116 +0,0 @@ -Deprecated bindings (should not be used in new device trees): - -Required properties: -- compatible: The possible values are: - "atmel,at91rm9200-nand" - "atmel,sama5d2-nand" - "atmel,sama5d4-nand" -- reg : should specify localbus address and size used for the chip, - and hardware ECC controller if available. - If the hardware ECC is PMECC, it should contain address and size for - PMECC and PMECC Error Location controller. - The PMECC lookup table address and size in ROM is optional. If not - specified, driver will build it in runtime. -- atmel,nand-addr-offset : offset for the address latch. -- atmel,nand-cmd-offset : offset for the command latch. -- #address-cells, #size-cells : Must be present if the device has sub-nodes - representing partitions. - -- gpios : specifies the gpio pins to control the NAND device. detect is an - optional gpio and may be set to 0 if not present. - -Optional properties: -- atmel,nand-has-dma : boolean to support dma transfer for nand read/write. -- nand-ecc-mode : String, operation mode of the NAND ecc mode, soft by default. - Supported values are: "none", "soft", "hw", "hw_syndrome", "hw_oob_first", - "soft_bch". -- atmel,has-pmecc : boolean to enable Programmable Multibit ECC hardware, - capable of BCH encoding and decoding, on devices where it is present. -- atmel,pmecc-cap : error correct capability for Programmable Multibit ECC - Controller. Supported values are: 2, 4, 8, 12, 24. If the compatible string - is "atmel,sama5d2-nand", 32 is also valid. -- atmel,pmecc-sector-size : sector size for ECC computation. Supported values - are: 512, 1024. -- atmel,pmecc-lookup-table-offset : includes two offsets of lookup table in ROM - for different sector size. First one is for sector size 512, the next is for - sector size 1024. If not specified, driver will build the table in runtime. -- nand-bus-width : 8 or 16 bus width if not present 8 -- nand-on-flash-bbt: boolean to enable on flash bbt option if not present false - -Nand Flash Controller(NFC) is an optional sub-node -Required properties: -- compatible : "atmel,sama5d3-nfc". -- reg : should specify the address and size used for NFC command registers, - NFC registers and NFC SRAM. NFC SRAM address and size can be absent - if don't want to use it. -- clocks: phandle to the peripheral clock -Optional properties: -- atmel,write-by-sram: boolean to enable NFC write by SRAM. - -Examples: -nand0: nand@40000000,0 { - compatible = "atmel,at91rm9200-nand"; - #address-cells = <1>; - #size-cells = <1>; - reg = <0x40000000 0x10000000 - 0xffffe800 0x200 - >; - atmel,nand-addr-offset = <21>; /* ale */ - atmel,nand-cmd-offset = <22>; /* cle */ - nand-on-flash-bbt; - nand-ecc-mode = "soft"; - gpios = <&pioC 13 0 /* rdy */ - &pioC 14 0 /* nce */ - 0 /* cd */ - >; - partition@0 { - ... - }; -}; - -/* for PMECC supported chips */ -nand0: nand@40000000 { - compatible = "atmel,at91rm9200-nand"; - #address-cells = <1>; - #size-cells = <1>; - reg = < 0x40000000 0x10000000 /* bus addr & size */ - 0xffffe000 0x00000600 /* PMECC addr & size */ - 0xffffe600 0x00000200 /* PMECC ERRLOC addr & size */ - 0x00100000 0x00100000 /* ROM addr & size */ - >; - atmel,nand-addr-offset = <21>; /* ale */ - atmel,nand-cmd-offset = <22>; /* cle */ - nand-on-flash-bbt; - nand-ecc-mode = "hw"; - atmel,has-pmecc; /* enable PMECC */ - atmel,pmecc-cap = <2>; - atmel,pmecc-sector-size = <512>; - atmel,pmecc-lookup-table-offset = <0x8000 0x10000>; - gpios = <&pioD 5 0 /* rdy */ - &pioD 4 0 /* nce */ - 0 /* cd */ - >; - partition@0 { - ... - }; -}; - -/* for NFC supported chips */ -nand0: nand@40000000 { - compatible = "atmel,at91rm9200-nand"; - #address-cells = <1>; - #size-cells = <1>; - ranges; - ... - nfc@70000000 { - compatible = "atmel,sama5d3-nfc"; - #address-cells = <1>; - #size-cells = <1>; - clocks = <&hsmc_clk> - reg = < - 0x70000000 0x10000000 /* NFC Command Registers */ - 0xffffc000 0x00000070 /* NFC HSMC regs */ - 0x00200000 0x00100000 /* NFC SRAM banks */ - >; - }; -};