From patchwork Tue Feb 15 13:49:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 1593093 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=dgiSfuFN; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JyjCS1PWYz9s1l for ; Wed, 16 Feb 2022 00:50:28 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 390FE83039; Tue, 15 Feb 2022 14:50:15 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dgiSfuFN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 986DB83039; Tue, 15 Feb 2022 14:50:12 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: 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,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) (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 19AA7838F0 for ; Tue, 15 Feb 2022 14:50:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=zajec5@gmail.com Received: by mail-lf1-x12a.google.com with SMTP id f37so10697188lfv.8 for ; Tue, 15 Feb 2022 05:50:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2kZ/IBmjcS9tZCWpYljYHJzrq23MizmdNHzM2IiJLCU=; b=dgiSfuFN3ASYDMIZDgYLeoYeom9SjwBzyCFOQNOKznbr/a4ilWWlYJYZYbu/j4ZdEe G1rkw84c8Lz0VwSIZiYYpnCSFNR+N/1CyGVc8OGOqMCTapaX0ede15R+iV45SSe5gnxH MwkmeyEYhU2+XfNYO7kJlX2Avdc0fy3rysVaJzVMyLOVxKb6ThaebceWU+664+w6jZgB M+AfffjDjZu58IICKKFto68ZZQ8ucymtzIHEB5kvSYWMtrEeLzxFFbxmsFsWIDF/y5i8 /XHChzYnDC9Z+t+WrAdPi4lLh4uQhdODOu6vZ9qBjRBBj2EQZE/0H1HicgLvUv9LYtma QUDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2kZ/IBmjcS9tZCWpYljYHJzrq23MizmdNHzM2IiJLCU=; b=O3t9jibscsHx/nYTBeMDo9SdoRIz+rCBtWnoVlxvaf5gP+FEXonUioZjNrM9bzZOKT KCO/te3zsdTCcfX+sPfjg2JA5HutPuj39fwS8cotvak32MgFnohsyZJGNS387X1e1BbJ AiZw8tW6aYM1uTV3gE5W9jHNqpNlZj9H/YpW2Zb96yBpzT1S0Hobx+JFJgqMkEG4GEGy Fw3N8gCrRx0YIkhtYmuYWC7b5M8p+hy+pPGVy0N7hNfmhJkYpRTs+H1AkvLASVXnjBEH tgyPFh3lIqLgu+3F8L7Duzniem6HYzfOyzEKmLWKatT3Wl+BG7E7tbMP6h3HpWACjHAt T0uQ== X-Gm-Message-State: AOAM533pxyBmdAf819sfgdYH8ZGiecm3ZRxzTtYauOEt4s/XuAUPAoGq 3nCfKfgMYBTUCcNc81VxlmA= X-Google-Smtp-Source: ABdhPJzfACnGR5sOoGxWkg4794pAqyMrui1kHLYW8QkYqC9NtPLDvAa5aNmATPCzPoQn+F0pwnGR2w== X-Received: by 2002:a05:6512:eaa:: with SMTP id bi42mr3254062lfb.93.1644933006217; Tue, 15 Feb 2022 05:50:06 -0800 (PST) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id o17sm4511757lfu.180.2022.02.15.05.50.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 05:50:05 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Rob Herring , Tom Rini Cc: Srinivas Kandagatla , Krzysztof Kozlowski , Ricardo Salveti , Michal Simek , Jorge Ramirez-Ortiz , devicetree@vger.kernel.org, u-boot@lists.denx.de, linux-kernel@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1p?= =?utf-8?b?xYJlY2tp?= Subject: [PATCH] dt-bindings: nvmem: add U-Boot environment variables binding Date: Tue, 15 Feb 2022 14:49:25 +0100 Message-Id: <20220215134925.32691-1-zajec5@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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 From: Rafał Miłecki U-Boot uses environment variables for storing device setup data on flash. That data usually needs to be accessed by a bootloader, kernel and often user-space. This binding allows describing environment data location and its format clearly. In some/many cases it should be cleaner than hardcoding & duplicating that 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. Signed-off-by: Rafał Miłecki --- .../devicetree/bindings/nvmem/u-boot,env.yaml | 58 +++++++++++++++++++ MAINTAINERS | 5 ++ 2 files changed, 63 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..a2b3a9b88eb8 --- /dev/null +++ b/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml @@ -0,0 +1,58 @@ +# 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 on flash in a U-Boot specific format (header and NUL separated + key-value pairs). + + This binding allows specifying data location and used format. + +maintainers: + - Rafał Miłecki + +allOf: + - $ref: nvmem.yaml# + +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 + +unevaluatedProperties: false + +examples: + - | + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + compatible = "u-boot,env"; + label = "u-boot-env"; + reg = <0x40000 0x10000>; + }; + }; diff --git a/MAINTAINERS b/MAINTAINERS index d20344ab7900..2f07f1d2290a 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