From patchwork Tue Aug 8 16:03:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 132572 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2270914vqr; Tue, 8 Aug 2023 10:16:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFs8dYnvY2WD0gEVNDy+nfCFF5nU23W/FCnhKeT05nZdTEYEzcE9/Y/GW7kiGNL+XamjnwB X-Received: by 2002:a17:902:9006:b0:1bb:a122:4886 with SMTP id a6-20020a170902900600b001bba1224886mr261354plp.64.1691514975257; Tue, 08 Aug 2023 10:16:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691514975; cv=none; d=google.com; s=arc-20160816; b=eml4HGryRQVVngLigCCQXT9Jm2v0pK6ttLreCzV3OwNoXc1AmI2wcbZ2PG1n0lIiHb gqRG4KpRhtq4u8uVMt+TAiaVhIH27ConTufOtoyegSpoKu77P3egBGRizhlkznc6xZ34 69Of7MuTgr60T1BMn1N4LewwE5VKCboiDnlkHtju/gJ4EKpxtcLXyIwBkIy3wwTtvza5 nilGFV2GLLpOL7OTk/XamPg0YlYdYdV5iq5AUrFynb2qcjRMZAleJpOuNKfCQFD+ocAO NS2pMMeStNSrvUwsuELHSci+/fzwLY7c1yerbEW+rdmBAjNHQX6Z4UtZSdKasMDyzUnZ qV8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:to:from:date; bh=m7brkzg8pVtNtQuExCSfX9yFGi7PT6Sx1zdTkgplRp4=; fh=fqW8oMY9ydixFpWZdFhmrmd4m3lvFBw58fIoJyq/l8o=; b=rylsi1NtoZKRtjTIcoVoA1ca0EJHI87EatNpWDsxsjoRlIm97VUWeIYigR8EeFBxEB 4xkzWnT9HEo9F/PG8yGAlHHvN9keEV3ayW0YvgH4Yfapq5lOawThYoxtb3jZwUPcFLo9 eJ1sQ7DRRADLbXfPen42lYLWw/OdJpHIcNMkXgdoYkJC8yy0qvd2DVy4NYkwt+MtmO0r KEY2GL7jcAUF1cNI3JUvVoiVnI3vF+imQa3w6vEOuAOWADMGzeBk3IbZQfUWmU1H7bep zI4Z+2Iaw1Ml+6jHWa3kPoTqIvvGiLQyHkJ78IU6mDY8OhVE0ZR6ykNG6W/0theTdBod 62MA== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lo12-20020a170903434c00b001b8847d973fsi7444656plb.219.2023.08.08.10.16.01; Tue, 08 Aug 2023 10:16:15 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230417AbjHHRMZ (ORCPT + 99 others); Tue, 8 Aug 2023 13:12:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230099AbjHHRL1 (ORCPT ); Tue, 8 Aug 2023 13:11:27 -0400 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE3DB69694; Tue, 8 Aug 2023 09:04:47 -0700 (PDT) Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1qTPB9-0007XY-04; Tue, 08 Aug 2023 16:03:27 +0000 Date: Tue, 8 Aug 2023 17:03:19 +0100 From: Daniel Golle To: Randy Dunlap , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Daniel Golle , linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/8] dt-bindings: mtd: add basic bindings for UBI Message-ID: <094e68da59bbd9efea1469b122f34f5dcf156f0f.1691510312.git.daniel@makrotopia.org> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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: INBOX X-GMAIL-THRID: 1773682007005061728 X-GMAIL-MSGID: 1773682007005061728 Add basic bindings for UBI devices and volumes. Signed-off-by: Daniel Golle --- .../bindings/mtd/partitions/linux,ubi.yaml | 65 +++++++++++++++++++ .../bindings/mtd/partitions/ubi-volume.yaml | 35 ++++++++++ 2 files changed, 100 insertions(+) create mode 100644 Documentation/devicetree/bindings/mtd/partitions/linux,ubi.yaml create mode 100644 Documentation/devicetree/bindings/mtd/partitions/ubi-volume.yaml diff --git a/Documentation/devicetree/bindings/mtd/partitions/linux,ubi.yaml b/Documentation/devicetree/bindings/mtd/partitions/linux,ubi.yaml new file mode 100644 index 0000000000000..79cfa0a3eaa7d --- /dev/null +++ b/Documentation/devicetree/bindings/mtd/partitions/linux,ubi.yaml @@ -0,0 +1,65 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mtd/partitions/linux,ubi.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Unsorted Block Images + +description: | + UBI ("Unsorted Block Images") is a volume management system for raw + flash devices which manages multiple logical volumes on a single + physical flash device and spreads the I/O load (i.e, wear-leveling) + across whole flash chip. + +maintainers: + - Daniel Golle + +allOf: + - $ref: partition.yaml# + +properties: + compatible: + const: linux,ubi + + volumes: + type: object + description: UBI Volumes + + patternProperties: + "^ubi-volume-.*$": + $ref: "/schemas/mtd/partitions/ubi-volume.yaml" + + unevaluatedProperties: false + +required: + - compatible + +unevaluatedProperties: false + +examples: + - | + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x0 0x100000>; + label = "bootloader"; + read-only; + }; + + partition@100000 { + reg = <0x100000 0x1ff00000>; + label = "ubi"; + compatible = "linux,ubi"; + + volumes { + ubi-volume-caldata { + volid = <2>; + volname = "rf"; + }; + }; + }; + }; diff --git a/Documentation/devicetree/bindings/mtd/partitions/ubi-volume.yaml b/Documentation/devicetree/bindings/mtd/partitions/ubi-volume.yaml new file mode 100644 index 0000000000000..c17d0caf07d97 --- /dev/null +++ b/Documentation/devicetree/bindings/mtd/partitions/ubi-volume.yaml @@ -0,0 +1,35 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mtd/partitions/ubi-volume.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: UBI volume + +description: | + This binding describes a single UBI volume. Volumes can be matches either + by their ID or their name, or both. + +maintainers: + - Daniel Golle + +properties: + volid: + $ref: "/schemas/types.yaml#/definitions/uint32" + description: + Match UBI volume ID + + volname: + $ref: "/schemas/types.yaml#/definitions/string" + description: + Match UBI volume ID + +anyOf: + - required: + - volid + + - required: + - volname + +# This is a generic file other binding inherit from and extend +additionalProperties: true