From mboxrd@z Thu Jan 1 00:00:00 1970 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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 620AAC433EF for ; Wed, 9 Mar 2022 15:40:54 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1B82283982; Wed, 9 Mar 2022 16:40:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id A064C83839; Wed, 9 Mar 2022 16:40:49 +0100 (CET) Received: from mail-ot1-f41.google.com (mail-ot1-f41.google.com [209.85.210.41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7F2E48142E for ; Wed, 9 Mar 2022 16:40:45 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=robherring2@gmail.com Received: by mail-ot1-f41.google.com with SMTP id s35-20020a0568302aa300b005b2463a41faso1994253otu.10 for ; Wed, 09 Mar 2022 07:40:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=8+eCR37KVwGF95t89hLUFTDz+ycvmadBjeALw7ulW5A=; b=6s855CpwiRuCizJDap96Fct5U7uUTJ6gssTf2pjZcNVEuD6cOMOC6gdzXIqRHUqIIe HOPm1O/inXi8/dU+cWBneViTT/0xkP0Qe+T0ABkEd+5CphJ0aBRV9fvHcZZQQWf9SJX+ ENhTmzTxvL9OziZ30O2E9Vv7exLc45KEwj/p703WMYCGfHTkCX4YjgQ1Sb+oCyeOj1YB 3nQ0SOxa7pxs9LYsGjgZxoEI8PgodcOXOQ+sr8WyhV8xadcyyAdIcrDL1oliBJDzNBsG 1eIji6RsnU3JEYASAponcFGW0xph4Jmgdp0FLNSr0Dz+V1eHnxtXWfXz42BFABn0hcbj 6GDw== X-Gm-Message-State: AOAM531DrhGqD3Mrg71iGYKsll9rGJpzHTQIlyHs/3tUxCrws9Vimemi b8A4g8IUtxwVBTwfihg6Bw== X-Google-Smtp-Source: ABdhPJxg9vJ1cq92V9hMC80Uz8lMvWf5o0iCwZzyfJ8FsXTT0jeVNLvW3K+TWWBLFoFKk9J+PdCzGQ== X-Received: by 2002:a9d:7005:0:b0:5af:4489:208 with SMTP id k5-20020a9d7005000000b005af44890208mr162237otj.306.1646840443990; Wed, 09 Mar 2022 07:40:43 -0800 (PST) Received: from rob (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id n62-20020acabd41000000b002d97bda3870sm1080781oif.53.2022.03.09.07.40.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Mar 2022 07:40:43 -0800 (PST) Received: (nullmailer pid 3205945 invoked by uid 1000); Wed, 09 Mar 2022 15:40:41 -0000 Date: Wed, 9 Mar 2022 08:40:41 -0700 From: Rob Herring To: Michal Simek Cc: =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= , Tom Rini , Simon Glass , Srinivas Kandagatla , Krzysztof Kozlowski , Ricardo Salveti , Jorge Ramirez-Ortiz , Sean Anderson , devicetree@vger.kernel.org, u-boot@lists.denx.de, linux-kernel@vger.kernel.org, =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= Subject: Re: [PATCH V3] dt-bindings: nvmem: add U-Boot environment variables binding Message-ID: <20220309154041.GA3202199@robh.at.kernel.org> References: <20220228131250.16943-1-zajec5@gmail.com> <578e243d-2273-add3-898c-959888c2a155@xilinx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <578e243d-2273-add3-898c-959888c2a155@xilinx.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean On Wed, Mar 09, 2022 at 02:42:43PM +0100, Michal Simek wrote: > > > On 2/28/22 14:12, Rafał Miłecki wrote: > > From: Rafał Miłecki > > > > U-Boot uses environment variables for storing device setup data. It > > usually needs to be accessed by a bootloader, kernel and often > > user-space. > > > > This binding allows describing environment data located in a raw flash > > partition. It's treated as NVMEM device and can be reused later for > > other storage devices. > > > > Using DT should be cleaner than hardcoding & duplicating such info in > > multiple places. Bootloader & kernel can share DTS and user-space can > > try reading it too or just have correct data exposed by a kernel. > > > > A custom "compatible" string allows system to automatically load > > relevant NVMEM driver but phandle can be also used for reading raw > > location. > > > > Signed-off-by: Rafał Miłecki > > --- > > V2: Update descriptions to don't make this binding MTD (flash partition) > > specific. Mention multiple possible storage ways. > > V3: Drop > > allOf: > > - $ref: nvmem.yaml# > > as we don't use anything rom the nvmem.yaml. Thanks Rob. > > --- > > .../devicetree/bindings/nvmem/u-boot,env.yaml | 62 +++++++++++++++++++ > > MAINTAINERS | 5 ++ > > 2 files changed, 67 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/nvmem/u-boot,env.yaml > > > > diff --git a/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml b/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml > > new file mode 100644 > > index 000000000000..e70b2a60cb9a > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml > > @@ -0,0 +1,62 @@ > > +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/nvmem/u-boot,env.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: U-Boot environment variables > > + > > +description: | > > + U-Boot uses environment variables to store device parameters and > > + configuration. They may be used for booting process, setup or keeping end user > > + info. > > + > > + Data is stored using U-Boot specific formats (variant specific header and NUL > > + separated key-value pairs). > > + > > + Environment data can be stored on various storage entities, e.g.: > > + 1. Raw flash partition > > + 2. UBI volume > > + > > + This binding allows marking storage device (as containing env data) and > > + specifying used format. > > + > > + Right now only flash partition case is covered but it may be extended to e.g. > > + UBI volumes in the future. > > + > > +maintainers: > > + - Rafał Miłecki > > + > > +properties: > > + compatible: > > + oneOf: > > + - description: A standalone env data block > > + const: u-boot,env > > + - description: Two redundant blocks with active one flagged > > + const: u-boot,env-redundant-bool > > + - description: Two redundant blocks with active having higher counter > > + const: u-boot,env-redundant-count > > + > > + reg: > > + maxItems: 1 > > + > > +additionalProperties: false > > + > > +examples: > > + - | > > + partitions { > > + compatible = "fixed-partitions"; > > + #address-cells = <1>; > > + #size-cells = <1>; > > + > > + partition@0 { > > + reg = <0x0 0x40000>; > > + label = "u-boot"; > > + read-only; > > + }; > > + > > + env: partition@40000 { > > + compatible = "u-boot,env"; > > + reg = <0x40000 0x10000>; > > + }; > > + }; > > diff --git a/MAINTAINERS b/MAINTAINERS > > index db8052bc1d26..24fc181a7e6c 100644 > > --- a/MAINTAINERS > > +++ b/MAINTAINERS > > @@ -19958,6 +19958,11 @@ W: http://linuxtv.org > > T: git git://linuxtv.org/media_tree.git > > F: drivers/media/pci/tw686x/ > > +U-BOOT ENVIRONMENT VARIABLES > > +M: Rafał Miłecki > > +S: Maintained > > +F: Documentation/devicetree/bindings/nvmem/u-boot,env.yaml > > + > > UACCE ACCELERATOR FRAMEWORK > > M: Zhangfei Gao > > M: Zhou Wang > > I think that parsing these partitions is quite sw intensive process and I > can't still see the value to have compatible string here. It's always good to know what a node represents. > I would prefer to have just any link from u-boot node to partition instead. That's a separate issue and having 'compatible' in no way disallows that. Rob