Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp619627pxm; Thu, 3 Mar 2022 00:50:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJyujQ4uT6gRtAu0a4Y/B8ZOzeo8JLbalvRK6WOnusiIUcqXZ4xsO5sCuqi8a1jyTBnQBmq8 X-Received: by 2002:a17:90a:d494:b0:1be:ea62:3763 with SMTP id s20-20020a17090ad49400b001beea623763mr4132115pju.136.1646297411871; Thu, 03 Mar 2022 00:50:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646297411; cv=none; d=google.com; s=arc-20160816; b=BbFWn/T9rxR3A5f56oVMalCMq3E/MUG5JsoD5WT4a712x9VpbbHQ23MzaFN1JaU2EF MHasKFUXqI7EN3SsELjvl8IgSP8q6pJ6ZWkqUjnTRytXAxQ6l0zDPSkIIDNzz9+un8cs 9asy1REE5lryWFV55SOwct4Fgv+sxK9+9ITtP2iLIjpIxLXUaISFQUNYl5Q+/y5ptaLs yw9/Y425IrQ6bJEHBKO7g+aObZQKKOdgnh+Jnp3ykkCfQnxrD4r7JryUdy/QsXPnHcVW 4o+iSVCpqvzsWopBaCz1q7+V3X9UmS85SzcQ7HmtZjUai3T8fcKdXVgctUmalHrjkr4/ UTeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id :dkim-signature; bh=DBFYMKAkX/+X4ffNw6h4ygU2WXIfLsougJ0b6s/z1mE=; b=XsBEwb1+P1VWxRuGfw64tIOwtUklJc1wDp/RsRlttd9OfgYkLC57gydAAe9gOqDdFH 1G3Y+JUrecF/oC42UyVDLATT426kN62X4baA3lGncoenLBYMuyq+lxJajJwTksezz4NP c/7wUxAwSJvomIhdlF7Shg6vJ/0blmEHGoEOt7p0t8QW6efHPYIbGKbAs6U/+OdjxQ37 srcqaEZeKk/WpnC9SQkLg9Z5mIxBM0xjHDQhNpLKh5z0AvtCW2xRrJL5ZfemHu9bPbT8 wPwBreRZYNFaKzqcHw3Aue/YH36pRqtZzyc305uaZI1fwNmx0Y5KrayDG2FwKTrp4bLL Lzxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KOqgA6AA; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j207-20020a6280d8000000b004e16ae51118si1424374pfd.174.2022.03.03.00.49.57; Thu, 03 Mar 2022 00:50:11 -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=@gmail.com header.s=20210112 header.b=KOqgA6AA; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231475AbiCCIdf (ORCPT + 99 others); Thu, 3 Mar 2022 03:33:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231530AbiCCIdd (ORCPT ); Thu, 3 Mar 2022 03:33:33 -0500 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DACB549F9D; Thu, 3 Mar 2022 00:32:45 -0800 (PST) Received: by mail-lj1-x236.google.com with SMTP id v22so5745083ljh.7; Thu, 03 Mar 2022 00:32:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:to:cc:references :from:in-reply-to:content-transfer-encoding; bh=DBFYMKAkX/+X4ffNw6h4ygU2WXIfLsougJ0b6s/z1mE=; b=KOqgA6AAztWzmSbNCZkD/x3REvvm47jEcpi9jyZM0WjbKW2i30ZuSlf1mEVyp8lSKz uQYoClbXREjv1XpMOBXcijZ1/1CbNG3FYG20o1l9VO/RDfClRs8K1B71GEp3pU/tHbcS KwZf+hBLO6Oia/I1W7I+wtGm8drUmgkWLwv8K5giTXC0JqRxJL0WWHo/4/Wd4j7VRS45 +1EBbTrtlSn+zQo4a5eIgS2/KG78dCedkA2ZtCFnbrRoh/+slt/zB3h+XML9y7hLkPeH ad1OkqRnAtnW18AjWUPre2fFSeivjXB6t03OW9DA8MUI3nksERPKIVVY1a6sMokYxrvc O6eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :to:cc:references:from:in-reply-to:content-transfer-encoding; bh=DBFYMKAkX/+X4ffNw6h4ygU2WXIfLsougJ0b6s/z1mE=; b=rmrRcs8RH043FDznZx60oG3LnYKJKlSI4hF+7OSGjiputaz0V4fLyh0CYLV4b84IoJ /c/HG/JcV3QDU/pGHFNX/j5Gk10XXUu79E2NhVcqhwsqgSjKL+bdSS1iN6TX39g6JlxV +wktDXUQL4EFxNGmKLmdhlUXe3ZzGqgOVTjGiIVggAcEqVnlgj2hJrWZqD3WrbOFfzrN xvbXczlS1zGT1kklyqsQ4iqE9V88n2JiZybwYJR7CvhKf3obBns214NVI+FgtYvVefab SgMBAy/0tqDkUvr5c1tS5dDkhSSfJZpzbvj4Jc6ivsYcBzwBmP3oJ+71bocFDZ+jqZMV M7Kg== X-Gm-Message-State: AOAM531j5ICfoOmzVpqKzOK3uVEntaM5+171nv7F87/tEPMKTmZBf28P d7cGJFH/sZYKhTY2QktZlAk= X-Received: by 2002:a2e:b5cb:0:b0:246:4e4e:45f4 with SMTP id g11-20020a2eb5cb000000b002464e4e45f4mr22877087ljn.407.1646296363738; Thu, 03 Mar 2022 00:32:43 -0800 (PST) Received: from [192.168.26.149] (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.googlemail.com with ESMTPSA id n8-20020a2e7208000000b00233697d2d9bsm331541ljc.12.2022.03.03.00.32.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Mar 2022 00:32:43 -0800 (PST) Message-ID: Date: Thu, 3 Mar 2022 09:32:41 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:96.0) Gecko/20100101 Thunderbird/96.0 Subject: Re: [PATCH] dt-bindings: mtd: partitions: add UBI binding To: Rob Herring Cc: Krzysztof Kozlowski , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Tom Rini , Ricardo Salveti , Michal Simek , Jorge Ramirez-Ortiz , Sean Anderson , u-boot@lists.denx.de, =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= References: <20220217102448.27586-1-zajec5@gmail.com> From: =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 On 2.03.2022 22:59, Rob Herring wrote: > On Thu, Feb 17, 2022 at 11:24:48AM +0100, Rafał Miłecki wrote: >> From: Rafał Miłecki >> >> UBI is often used on embedded devices to store UBI volumes with device >> configuration / calibration data. Such volumes may need to be documented >> and referenced for proper boot & setup. >> >> Some examples: >> 1. U-Boot environment variables >> 2. Device calibration data >> 3. Default setup (e.g. initial password) >> >> Signed-off-by: Rafał Miłecki >> --- >> .../bindings/mtd/partitions/ubi.yaml | 67 +++++++++++++++++++ >> 1 file changed, 67 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/mtd/partitions/ubi.yaml >> >> diff --git a/Documentation/devicetree/bindings/mtd/partitions/ubi.yaml b/Documentation/devicetree/bindings/mtd/partitions/ubi.yaml >> new file mode 100644 >> index 000000000000..cd081f06d4cb >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/mtd/partitions/ubi.yaml >> @@ -0,0 +1,67 @@ >> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/mtd/partitions/ubi.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: UBI (Unsorted Block Images) device >> + >> +description: | >> + UBI is a layer providing logical volumes (consisting of logical blocks) on top >> + of raw flash devices. It deals with low-level flash issues (bit-flips, bad >> + physical eraseblocks, wearing) providing a reliable data storage. >> + >> + UBI device is built and stored in a single flash partition. >> + >> + Some (usually embedded) devices use UBI volumes of specific names or indexes >> + to store setup / configuration data. This binding allows describing such >> + volumes so they can be identified and referenced by consumers. >> + >> +maintainers: >> + - Rafał Miłecki >> + >> +allOf: >> + - $ref: partition.yaml# >> + >> +properties: >> + compatible: >> + const: ubi >> + >> +patternProperties: >> + "^volume-[0-9a-f]+$": >> + type: object >> + description: UBI volume >> + properties: >> + volume-name: >> + $ref: /schemas/types.yaml#/definitions/string >> + volume-id: >> + $ref: /schemas/types.yaml#/definitions/uint32 >> + anyOf: >> + - required: >> + - volume-name >> + - required: >> + - volume-id >> + >> +unevaluatedProperties: false >> + >> +examples: >> + - | >> + partitions { >> + compatible = "fixed-partitions"; >> + #address-cells = <1>; >> + #size-cells = <1>; >> + >> + partition@0 { >> + compatible = "ubi"; >> + reg = <0x0000000 0x1000000>; >> + label = "filesystem"; >> + >> + env: volume-0 { >> + volume-name = "u-boot-env"; > > Why not do 'compatible = "u-boot,env";' to align with normal partitions? I mean to reserve "compatible" for describing UBI volume content. If I manage to get [PATCH V3] dt-bindings: nvmem: add U-Boot environment variables binding https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20220228131250.16943-1-zajec5@gmail.com/ accepted, it'll allow me to later work on something like: env: volume-0 { compatible = "u-boot,env"; volume-name = "u-boot-env"; }; (I believe) I'll need (in the final shape) two properties: 1. One for describing UBI volume ("compatible") 2. One for identifying UBI volume ("volume-name" / "volume-id") It's similar design to the "compatible" vs. "reg" in IO hw blocks. > Or 'label'? I could replace "volume-name" with "label" but someone once told me that: > 'label' is supposed to correspond to a sticker on a port or something > human identifiable ;) https://patchwork.ozlabs.org/comment/2812214/ So I don't want to abuse "label" here. > We have enough ways to identify things, I don't think we need another. > >> + }; >> + >> + calibration: volume-1 { > > Are 0 and 1 meaningful or just made up indexing? Made up indexing. I need unique nodenames but @[0-9a-f] doesn't appply here. >> + volume-id = <99>; >> + }; >> + }; >> + }; >> -- >> 2.34.1