From patchwork Mon Nov 14 09:02:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 1597 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2043022wru; Mon, 14 Nov 2022 01:04:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf7kuAyDaj6/E0fGGHEiLyVp6VYKNTkHd+2Wt28eqjmznfeJyegwibMETnDOCGgWm3aJn6sk X-Received: by 2002:aa7:c512:0:b0:45c:935b:ae15 with SMTP id o18-20020aa7c512000000b0045c935bae15mr10030229edq.357.1668416683744; Mon, 14 Nov 2022 01:04:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668416683; cv=none; d=google.com; s=arc-20160816; b=oHyF/tWJiOeik++LUrqfRZJapWuw4jPq2Zk2b6oBEN2h31sUV9KCxD4iAVpcxZQVPB 70ORh8stjZvCT/ve1mcM3MFofB2JT2pFKafVLQoX3TnjH19WcZi8mudmwftk49Peo4ve hxk8agE4GPnkG6trmtKkwF5UXCdBpk7e9+V9sqe2rPEpnUZW3/qzTKUWXh4J79Sl71cc SyFuif6z95PLpxieNz5M9NOIPi2Xa1Gh21Wzw8FJZkXYIaKp+Fqoavcp8AdEMc0gOk8v /h0jYr98Q27PsN2QDAcFbsclCkWBJZa46ANv8bvohpOb8w4KYVyvRNYABU0ZVGtI7HKD ncZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=m1B6Mnm8XzXPNHtjMpbkW+lAQQ7J9tuEFW6OZfbcDe8=; b=0ft2Q8j+7fMwE92S6C5N9ufCm5HbaG1xsxY7VjnjZA7o8MCJK/HQRHkDpn18tSXy8r Xzpf8C9jYpxX38QC8Lzg/pvx9ArRddRimiDSD0She3i8TvZ8+9kpi7w/kCsRt1RaZtAF yKxny5acDFG5z5Ia83GGqygTX4kSABkQJSV0JlRWWbc7C4YGBOun9XXM/o9gN6BskY2A tZgMyPGaasfNKXaOO0s4Vfqkme8m9Kb3be7o5Ku1Pz/xAy1iFyvlA6k2StPRAH08PqOd uNWtjIOpA181Td4ZayDqFkcBmkKenQ7Cq9NY1rsovNYOl8k7EK6KDuuuW1WXa8k+4ES1 64XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=cGj9Pm2o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d22-20020a50fe96000000b00459b51c2b25si8018451edt.438.2022.11.14.01.04.20; Mon, 14 Nov 2022 01:04:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=cGj9Pm2o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236747AbiKNJDo (ORCPT + 99 others); Mon, 14 Nov 2022 04:03:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236704AbiKNJDb (ORCPT ); Mon, 14 Nov 2022 04:03:31 -0500 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCC3F1DA4D; Mon, 14 Nov 2022 01:03:19 -0800 (PST) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id CFD85FF811; Mon, 14 Nov 2022 09:03:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1668416598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m1B6Mnm8XzXPNHtjMpbkW+lAQQ7J9tuEFW6OZfbcDe8=; b=cGj9Pm2oK64KKCV9hrbhd66Urst+VNXwdu9gKbIJhVOvTs4z2Etfqa8/bW6W+E1mi5xQiY JXucPMqWVqh+mWW0bTC0RW7zeLWkOTGnTv6g1j7ntX+pwu4LCjp0Sf7TherxP1z8iF912G UDHoQAIlXMgcKreYop/uD5goUrWy7X0/a8vq3S72qHNKtxveZEINIFMby7OfTJ8RLecYEt trURNMgFuenuBDEgbQB1oO80zv5vbi0sUq0KI0SJE0ffCNRmF7Ol2CLNUOHCU+dAwKQOsp Rz5ZskUaTInrkhm1nrfeOx9KVYav3RHNK3H8yTXTXKQqyyPBGL68Vkrv3FtC0Q== From: Miquel Raynal To: Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org Cc: Richard Weinberger , Vignesh Raghavendra , Tudor Ambarus , Pratyush Yadav , Michael Walle , , Thomas Petazzoni , , Miquel Raynal Subject: [PATCH v3 00/17] Improve MTD bindings Date: Mon, 14 Nov 2022 10:02:58 +0100 Message-Id: <20221114090315.848208-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749461692604072268?= X-GMAIL-MSGID: =?utf-8?q?1749461692604072268?= Hello, During a yaml conversion review, Krzysztof opened the discussion about the links and references made between the different files in the mtd bindings. I figured out some minimal changes might be needed to properly reference everything correctly and ensure we constrain as much as possible the existing bindings. That is what I tried to do here. The idea is: * partition.yaml defines one MTD partition * parsers/*.yaml define partition parsers (mainly compatibles) * mtd.yaml contains the generic definition of any mtd device (nand, spi-nand, spi-nor, nor, sram, etc), in particular, it defines the various partition formats (legacy and current) and references partition.yaml as well as a list of all the possible parsers within a "partitions" node. * nand-chip.yaml, jedec,spi-nor, mtd-physmap.yaml all describe real instances of mtd device, each of them with a different underlying technology, they reference mtd.yaml * nand-controller.yaml has subnodes which reference nand-chip.yaml. * Specific NAND controller bindings reference nand-controller.yaml. I've tested each and every patch with the following command and it worked fine: $ make dt_binding_check -j10 DT_CHECKER_FLAG=-m DT_SCHEMA_FILES=mtd/ Cheers, Miquèl Changes since v2: * Added Rob's R-by on almost all the patches but "dt-bindings: mtd: nvmem-cells: Fix example" * Changed the commit message of the patch mentioned above to mention that 'ranges' is not declared anywhere besides being a potentially valid property, hence dropping it from the example just to avoid failing the test, knowing that at some point someone could reintroduce it by defining it in one of the core yaml files. Miquel Raynal (17): dt-bindings: mtd: Clarify all partition subnodes dt-bindings: mtd: Remove useless file about partitions dt-bindings: mtd: nand-chip: Reference mtd.yaml dt-bindings: mtd: nand: Drop common properties already defined in generic files dt-bindings: mtd: nand: Standardize the child node name dt-bindings: mtd: ingenic: Mark partitions in the controller node as deprecated dt-bindings: mtd: onenand: Mention the expected node name dt-bindings: mtd: sunxi-nand: Add an example to validate the bindings dt-bindings: mtd: spi-nor: Drop common properties dt-bindings: mtd: physmap: Reuse the generic definitions dt-bindings: mtd: partitions: Constrain the list of parsers dt-bindings: mtd: partitions: Change qcom,smem-part partition type dt-bindings: mtd: nvmem-cells: Drop range property from example dt-bindings: mtd: nvmem-cells: Inherit from MTD partitions dt-bindings: mtd: Argue in favor of keeping additionalProperties set to true dt-bindings: mtd: Drop object types when referencing other files dt-bindings: mtd: Standardize the style in the examples .../mtd/allwinner,sun4i-a10-nand.yaml | 34 +++-- .../bindings/mtd/arasan,nand-controller.yaml | 5 +- .../bindings/mtd/arm,pl353-nand-r2p1.yaml | 30 ++--- .../devicetree/bindings/mtd/atmel-nand.txt | 6 +- .../bindings/mtd/brcm,brcmnand.yaml | 80 ++++++------ .../devicetree/bindings/mtd/denali,nand.yaml | 2 +- .../devicetree/bindings/mtd/ingenic,nand.yaml | 116 ++++++++--------- .../bindings/mtd/intel,lgm-ebunand.yaml | 48 +++---- .../bindings/mtd/jedec,spi-nor.yaml | 14 --- .../devicetree/bindings/mtd/lpc32xx-mlc.txt | 2 +- .../devicetree/bindings/mtd/lpc32xx-slc.txt | 2 +- .../bindings/mtd/microchip,mchp48l640.yaml | 14 +-- .../devicetree/bindings/mtd/mtd-physmap.yaml | 7 +- .../devicetree/bindings/mtd/mtd.yaml | 24 +++- .../devicetree/bindings/mtd/mtk-nand.txt | 2 +- .../devicetree/bindings/mtd/nand-chip.yaml | 4 + .../bindings/mtd/nand-controller.yaml | 2 +- .../devicetree/bindings/mtd/partition.txt | 33 ----- .../partitions/arm,arm-firmware-suite.yaml | 2 + .../partitions/brcm,bcm4908-partitions.yaml | 2 + .../brcm,bcm947xx-cfe-partitions.yaml | 2 + .../mtd/partitions/linksys,ns-partitions.yaml | 2 + .../bindings/mtd/partitions/nvmem-cells.yaml | 4 +- .../bindings/mtd/partitions/partition.yaml | 1 + .../bindings/mtd/partitions/partitions.yaml | 41 ++++++ .../mtd/partitions/qcom,smem-part.yaml | 32 ++--- .../bindings/mtd/partitions/redboot-fis.yaml | 6 + .../devicetree/bindings/mtd/qcom,nandc.yaml | 117 +++++++++--------- .../bindings/mtd/st,stm32-fmc2-nand.yaml | 47 +++---- .../bindings/mtd/ti,am654-hbmc.yaml | 36 +++--- .../bindings/mtd/ti,gpmc-onenand.yaml | 3 + drivers/mtd/parsers/Kconfig | 2 +- 32 files changed, 380 insertions(+), 342 deletions(-) delete mode 100644 Documentation/devicetree/bindings/mtd/partition.txt create mode 100644 Documentation/devicetree/bindings/mtd/partitions/partitions.yaml