Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp734752pxm; Fri, 25 Feb 2022 18:42:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJxq8kMeBEngypKCnfCCQOXAHJCtmlszJ/T8BuKarTAQV6uZEQ2j+Uen5wmL3qj8Q/n0XEwt X-Received: by 2002:a17:902:be0c:b0:14f:d9b3:92a9 with SMTP id r12-20020a170902be0c00b0014fd9b392a9mr10089411pls.53.1645843330086; Fri, 25 Feb 2022 18:42:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645843330; cv=none; d=google.com; s=arc-20160816; b=yvuDMe3Hvi+TkgMk1hRl/MXMB6bXOcbjwmO4qB1Ry8gy3n06QCo5CjvmpgI8WvB1gL 5V/ErHjRda8WrZvPpaiFSdwbcBq8uSIOwObW8q6VOSO5Mmg5l3x5ekqbu1bICbXKlocF YX4/j2lj+G8/D4QnfUN3v/9wicQC3JRpltfB0xYU96VGF8Xr4tmNMHDgBiZ89MwDFt8k 8030sXDebXA1my9vdEyIOgr/g8PVLmN8SHanAIokTqduue8HjO+eXy/ANa5Wm4q4OHKq Pjl5SKnjlSxkwzYPsXfLv/WqDsBFXbdrLqbDiL6iT+o2ZYcqBE3/MdBoFFEO3ZVnX84P KfRA== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ZSX/mmN9jmdskm3j4TwmWh8AlFLR/YvOjRrOST7+5es=; b=i6Up2mi6yPQsj06sCkLxWTwnhqnROw20JOr9rI4Pzh7IayOBtpyM/2B6ccO7u4R19Z Z+Z642rv/KR57BrywLyouxvpqcS5cVNDGl+GppM9yxmgNJ2XWpag/LZAtXlNrordc0m0 oDJ6OlSMc2ITTxAEn5aUq5gJfZCMGc18+BKEoEZhyWD+xhQe1z31XoDo/kwHqKb7TEyJ 0pphE3/jYrXhS5XJqQ6UwBio7pkIB9q+gU9RfrDCmiYlyscFQvgFcd4Bd1pd1tC++qOd f5NEl/n9VfIGjV8wWb+1G9CwjEOcOifsY+H+z8DbqRz5KED9FKbbkTJZZcVurg9NERRn pnxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u1-20020a170902714100b0014fcd391b5bsi3236835plm.257.2022.02.25.18.42.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 18:42:10 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 150612294AB; Fri, 25 Feb 2022 18:06:23 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242746AbiBYQnR (ORCPT + 99 others); Fri, 25 Feb 2022 11:43:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235766AbiBYQnR (ORCPT ); Fri, 25 Feb 2022 11:43:17 -0500 Received: from mail-oo1-f45.google.com (mail-oo1-f45.google.com [209.85.161.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3D1F16F944; Fri, 25 Feb 2022 08:42:44 -0800 (PST) Received: by mail-oo1-f45.google.com with SMTP id p206-20020a4a2fd7000000b0031bfec11983so6826276oop.13; Fri, 25 Feb 2022 08:42:44 -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=NrAtjAfwNjD1bNdaxweE9S9dh9S+qanqxxOm33njdiQKIO79SNQjIhAbiWbZG+S057 DFUjBgkSsvD3TRT46rfzXmJOREkPIYPfqC5JWLFCnSWWL6OBDs03fJEps1PX/MN9ML83 7BqFk+AQNtO08cZ1PlMUe3R4LlqIu/dDkGYAb6BnMxhi7K7KXWEn6uWzKHnCpzVNGevm rUYWTmI6DhyWy2NPZymwJCJZ9r1mkpAFwF0uRKkV95bwM5h4hioxAAesYojmvhwjVs5A E5mwIM0ZGWUdTAL1pBt77O7jrWXMTETcUi6DaCuIp6B/VVNSRtFC5Cix1kS3xelxkhvq 3xhg== X-Gm-Message-State: AOAM531AuNCyvbZqv0FrKiFnD1hltKV6U0Hn5M29j2NAlDCf33nRZgEX qYU3eM1prRbNgP1mLGhagmZhk1sBYw== 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 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 > >