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 3BAB4C433EF for ; Fri, 25 Feb 2022 16:42:54 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6B100836AC; Fri, 25 Feb 2022 17:42:51 +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 7F32A83764; Fri, 25 Feb 2022 17:42:49 +0100 (CET) Received: from mail-oo1-f42.google.com (mail-oo1-f42.google.com [209.85.161.42]) (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 54A4D8303C for ; Fri, 25 Feb 2022 17:42: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-oo1-f42.google.com with SMTP id i10-20020a4aab0a000000b002fccf890d5fso6923339oon.5 for ; Fri, 25 Feb 2022 08:42: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=ZSX/mmN9jmdskm3j4TwmWh8AlFLR/YvOjRrOST7+5es=; b=fISmVUcZ9YOqEosSi0keA5NgJPgxf80tdMZILvV7skRzmiilibm262P8eoQhnaIMNM VEKM5UW49qnJrZBgtalai7h4mc48doE1zk4d2IM5r4DNScWxk+94k4PJU3eG+WIgdnXg HzJBg5v+kk7nz4jviPdtRHk0HhueqPWsHMg+sXYbjvSx8X1kh1VYmULYgCAj87GmlKs5 n2SOEYByglW6/WVHOFof6eIOpxbS5yzgzUym40X7Ry6t4r4yR1bgTIqxTIDE9qKmChDL EcM/zmVdiV0nHNW0XNZTC7w4oYBIECAhIg2PlV4lvG9f0+m26Du4AYU6SrItEF+tNpA7 y3HQ== X-Gm-Message-State: AOAM532P21DSGF3xIDxCMSzcyT+yUvWOsBHiHfMufJ0BrfX8skdH/ojM gzWPy2LW6Tz5+dIyzbmd3A== X-Google-Smtp-Source: ABdhPJwwhEUJZdpe4mMbjxVuFAy+Hz/bbfJEL+S3kPYGCL3TRqpYJkBhIs9KD2NMfnnHOVVa22Kv5Q== X-Received: by 2002:a4a:3b04:0:b0:31b:7524:ce2d with SMTP id s4-20020a4a3b04000000b0031b7524ce2dmr3049766oos.54.1645807363590; Fri, 25 Feb 2022 08:42:43 -0800 (PST) Received: from robh.at.kernel.org (66-90-148-213.dyn.grandenetworks.net. [66.90.148.213]) by smtp.gmail.com with ESMTPSA id e12-20020a056870c0cc00b000d6bf3c0613sm1376697oad.43.2022.02.25.08.42.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 08:42:42 -0800 (PST) Received: (nullmailer pid 1063115 invoked by uid 1000); Fri, 25 Feb 2022 16:42:41 -0000 Date: Fri, 25 Feb 2022 10:42:41 -0600 From: Rob Herring To: =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= Cc: Tom Rini , Srinivas Kandagatla , Krzysztof Kozlowski , Ricardo Salveti , Michal Simek , 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 V2] dt-bindings: nvmem: add U-Boot environment variables binding Message-ID: References: <20220217130235.7450-1-zajec5@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220217130235.7450-1-zajec5@gmail.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 Thu, Feb 17, 2022 at 02:02:35PM +0100, 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. How much of this is already in use vs. proposed? I know I've seen something, but that may have been a u-boot env string in 'label' and that's it. > 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. > --- > .../devicetree/bindings/nvmem/u-boot,env.yaml | 66 +++++++++++++++++++ > MAINTAINERS | 5 ++ > 2 files changed, 71 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..a53e34152c97 > --- /dev/null > +++ b/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml > @@ -0,0 +1,66 @@ > +# 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 > + > +allOf: > + - $ref: nvmem.yaml# What exactly is used from nvmem.yaml? Based on the example, nothing. > + > +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 Aren't these 2 discoverable based on a flag or count property? > + > + reg: > + maxItems: 1 > + > +unevaluatedProperties: 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>; > + label = "u-boot-env"; > + }; > + }; > diff --git a/MAINTAINERS b/MAINTAINERS > index 66aa3a589f6a..55c56ce82856 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -19905,6 +19905,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 > -- > 2.34.1 > >