From patchwork Thu Feb 17 13:02:35 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: 543380 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp354653imn; Thu, 17 Feb 2022 05:02:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJwWuLAeFlyyXbnqRJJwh2NhZiHuzeG/03pVvwr+mEmTqcVetvMHhgtvh7wdKWfHAkq/sJ/Z X-Received: by 2002:a17:906:ce23:b0:6cf:7203:ded6 with SMTP id sd3-20020a170906ce2300b006cf7203ded6mr2209250ejb.170.1645102974705; Thu, 17 Feb 2022 05:02:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645102974; cv=none; d=google.com; s=arc-20160816; b=LolC/Xbv6YuTf1UNH/9061M2dRBRXbsmh2eoYRSN6xEM3y3dDR1WN6vR3Ag0dxmYFH yBfmPTSveuK2nzJ4qtn4KqrBUulE5tIrLoBYnO/P2Qo92d+jgdBwXnqHEqT/3u8BCSIe dS46NwDSoG79U2HROnJhbaCQZrfIzV4k/Fa3QeyPvTPYGsYKVMfO1JpJz5tBTRId5C2n AQOOB1CKKVVq2/+vJm2skXzXR0AysGp7q7md41KnEQE4NDxPAOt1d26MXPmtHCeOcoHL l/2B2cQSwPP+0cg3GsUDgo8l+WlxwU45ktbYFZYePZAJBMNupVwUhBCOKRGQmGSV6n9G OF7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=e+QX15fh6AjTvjCx86bn1wO86yEMC2bkhF0fAWHNnUg=; b=eLSSYjI/2UqzEFV9JSQZnkZcb1Aq2zxxLeapkAdf8HcAy4ws6GLKub2Lj47ZIeWt8y tjRwcwvLtqjkgFylFuNa0TNKAQpVgQS5uHrr2GkryBRslWEinPQIKkp+PhH6SOc7gGPH 3sOYOFVB+srkWznJMk5801tYJWBG8Y8MvFup7Xu/Y3X1vLB/gcoM2VkeLeYwQlpcWaxB BnI5EQgM6yO/ChUOHH6Bf7NlhbHDt1iw3WgeuMgaYWz9m6ii1R8luw99jIpijLADRNno uGOc915kfDYD+9Mq2vlX8SHrWjUk2lhgXdoQZ452WKuuA36wpvgBfwHXM/TukBS/DlAH /oRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lut67Pon; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 27si1591732ejm.859.2022.02.17.05.02.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Feb 2022 05:02:54 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lut67Pon; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9A99583B86; Thu, 17 Feb 2022 14:02:50 +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="lut67Pon"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F3D8683B7A; Thu, 17 Feb 2022 14:02:48 +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-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) (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 2A53C83B85 for ; Thu, 17 Feb 2022 14:02:45 +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-lj1-x232.google.com with SMTP id s21so113419ljp.2 for ; Thu, 17 Feb 2022 05:02:45 -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=e+QX15fh6AjTvjCx86bn1wO86yEMC2bkhF0fAWHNnUg=; b=lut67Ponvp8shZTDWUe5Oj4AJ9ez1NfZDkmOcaExj54tgf/XNA2xehOZT6z8qFQ5Qn Uh1MpB93m8zYjKvlxYvtkKzZcU3r4syprwi4hXVnU9V4VB7b+AVu2PXJOrI0rVt/35u4 xyw77JW2xXZDx1V8SiSXFMAK7lqk3zlw3Jb02TSWIMaeaSwNBx7WgQlPTN29ZQHeMkhU CgwQGnvQ6KU1hclxRNAxrRVW7xLwxQzGjk3yZqBZ6RYPdBBhLSyOiZuLzeAfb3/hnIZR jVC4UPKZ/uwf8nyIY6d7jtzWyTRPCeXx9n4+AZ0qfZTC6gi8ZOnNzQyd7B7ET0Df8riz zu4A== 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=e+QX15fh6AjTvjCx86bn1wO86yEMC2bkhF0fAWHNnUg=; b=qIs6fqb/2OqrxZxxu4aW5Y+LGDvv8mG8dV9QUNVQshyAYWw5utY5sanbAA2IbQhhWi i4v5lzIQj/B5KW5LcafgtyKg6QavQWjK1K4o3jgxF0j7j7dSyM4PgcOpH/wGns4blAjM aFH2IAtvni7NXVtQKYQjzJ+NIFmxbEge/SvIzrrcXN0F0E0CI+NIY255ml/7Wh4eGmI7 Sni4xLSSxtK2VAOc051cmNhd/24GMvVpjIA+oXy9eaq/M4kWT/IeVh51EcPjREP8cMxx SIZpYBBU59VE4OT8mM12pUNZfuhYk3Xms7CjWzoQ9BRoYwixLkIzTdMk5ky6f5GQLRIE tXRQ== X-Gm-Message-State: AOAM531M7SWAzP9t+ET1v/sWg1bOMkcLfsegOLT/8vw+Unmg7dU7sLQl sjuVMi7LlyV+5THY+YtoXac= X-Received: by 2002:a05:651c:1797:b0:23a:18d7:1d39 with SMTP id bn23-20020a05651c179700b0023a18d71d39mr2134034ljb.470.1645102964126; Thu, 17 Feb 2022 05:02:44 -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 w8sm653052ljd.27.2022.02.17.05.02.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Feb 2022 05:02:43 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Rob Herring , Tom Rini Cc: 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: [PATCH V2] dt-bindings: nvmem: add U-Boot environment variables binding Date: Thu, 17 Feb 2022 14:02:35 +0100 Message-Id: <20220217130235.7450-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. 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. --- .../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# + +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 { + 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