From patchwork Tue Dec 19 17:40:21 2023 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: 13498667 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B9781C46CA2 for ; Tue, 19 Dec 2023 17:41:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=rMi6mR/Rf+XziwqBwIl2ZR/GUcBRO5SpI1lFjkOo2zU=; b=zCv8heVJYev2qD DywHzc/iMDtdYTzio3hhNi3zKqjO2uBZJCgoWG9zI2C3q5O3QMT/N4tP9NdLi0M4tQE/tT7pMpahc GWyp/U8jHC4ON0GWQtMFloE7iD/HfufxZebJJjHS3M+mre0Q7HIS6X3aiXLeh/VvCYlk9LrvTElOI flrWFpodrBxNlwagN3/V4Y5l9UMfqPT4ckMBPi8wHgP2ed72oKtr8RWeBGZGeGacXXwiHz8r6prj4 bQpYgAt+JF4X7/fCAT2qVUapGrhX3iNBWrb2PxlzvFUd9oojEvmGLYol7uE51HpPqYq9VaCo6JmMO Xd979teaIMkZx2jAH+8Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFe5D-00EyoU-2X; Tue, 19 Dec 2023 17:40:43 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFe5A-00Eymo-1V; Tue, 19 Dec 2023 17:40:42 +0000 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a22f59c6ae6so597531566b.1; Tue, 19 Dec 2023 09:40:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703007638; x=1703612438; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=WUAvVSVhxfpG8xQnwKnlglz0LVM7Vn2JPxTl2XGCxyQ=; b=I216Z++XMHfhMfpGtFH9kbl9H5sT0FhrmV6YH5rv+ow4P99BEChoKztz7gsNGR4L37 UyC1DDdPQbTXPT6MHWjq+BAy8MbR/fjYJGPN3uM9L1wktxa1B2nHBMh9DouSPSSto941 qxVIBCS/EJRdDMoSkQeBmUuy8kdwitED4ZMe2FTL+BG8JZocj4L9tuhrtnkQIgnnm74e Cv0zDHBa6Lmk8abwNKNBc584p7eDQOQ1mutD2xERQX2ejVnSmNkohxwhZcQzE224sGTQ Apy40zR2/RPWPVuNWONv1kRYyvTkqX8xjDuI0kY8bnvwJis/NCdz0uMofEoW/mlA2nvs kKEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703007638; x=1703612438; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WUAvVSVhxfpG8xQnwKnlglz0LVM7Vn2JPxTl2XGCxyQ=; b=PsCK79wiU6FRxXQjR+qrcSDrJt+PNQeDEdKwp2xtPElFcks9TszJLRHIo9Nc9eLclJ w0Ig13dDvoVjum1p2Zru6FgAJnkF2I5NTkG+ET2k2fKIesCy5hkQ0yfrike740xyshJs Re6hJKtvOINDFaMgf+zL2cc1nlKJRJM57qaguSm014QRPa4LbHkDVTxToIsy00qxGvoc LNdGXcUT9ChqQc0/T25LWRrRWIBOg1L4wleG6CWeSafK3ONEEWIquwKRfuw06mX31u3j 3il1Bi1OtXn3sWOZFI9wdLkm7UpQ6qgHyt3mRA1b3+4QokVatyjXPgCNlzT6/BUm0nQ7 2QNg== X-Gm-Message-State: AOJu0Yz6D4Zku//63tP+8XspNIEZImIwF7EiCXV4vVDp06bJtt/SrJkL llu9c0iTH9th8smiBmhtrDS3AglzX8Y= X-Google-Smtp-Source: AGHT+IGj03k4tKfPpLbPbo44mQ331d1Cth9MTNhfOJCUqRXauznoIRp+BrTJhH+JppWzVsGZ3iN7Rw== X-Received: by 2002:a17:907:764c:b0:a26:8ab0:43b8 with SMTP id kj12-20020a170907764c00b00a268ab043b8mr48795ejc.41.1703007638248; Tue, 19 Dec 2023 09:40:38 -0800 (PST) Received: from localhost.lan (031011218106.poznan.vectranet.pl. [31.11.218.106]) by smtp.gmail.com with ESMTPSA id tx27-20020a1709078e9b00b00a1c85124b08sm15834840ejc.94.2023.12.19.09.40.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:40:37 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Srinivas Kandagatla , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Greg Kroah-Hartman , Michael Walle , Miquel Raynal , linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, u-boot@lists.denx.de, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH V2 1/5] dt-bindings: nvmem: layouts: add U-Boot environment variables layout Date: Tue, 19 Dec 2023 18:40:21 +0100 Message-Id: <20231219174025.15228-1-zajec5@gmail.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_094040_500974_4A0321AE X-CRM114-Status: GOOD ( 17.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Rafał Miłecki U-Boot env data is a way of storing firmware variables. It's a format that can be used of top of various storage devices. Its binding should be an NVMEM layout instead of a standalone device. This patch adds layout binding which allows using it on top of MTD NVMEM device as well as any other. At the same time it deprecates the old combined binding. Signed-off-by: Rafał Miłecki --- V2: Add "-layout" suffix to compatibles to avoid conflict .../nvmem/layouts/u-boot,env-layout.yaml | 55 +++++++++++++++++++ .../devicetree/bindings/nvmem/u-boot,env.yaml | 6 ++ 2 files changed, 61 insertions(+) create mode 100644 Documentation/devicetree/bindings/nvmem/layouts/u-boot,env-layout.yaml diff --git a/Documentation/devicetree/bindings/nvmem/layouts/u-boot,env-layout.yaml b/Documentation/devicetree/bindings/nvmem/layouts/u-boot,env-layout.yaml new file mode 100644 index 000000000000..3b4d8f2a44e1 --- /dev/null +++ b/Documentation/devicetree/bindings/nvmem/layouts/u-boot,env-layout.yaml @@ -0,0 +1,55 @@ +# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/nvmem/layouts/u-boot,env-layout.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NVMEM layout of U-Boot environment variables + +maintainers: + - Rafał Miłecki + +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). + +properties: + compatible: + oneOf: + - description: A standalone env data block + const: u-boot,env-layout + - description: Two redundant blocks with active one flagged + const: u-boot,env-redundant-bool-layout + - description: Two redundant blocks with active having higher counter + const: u-boot,env-redundant-count-layout + - description: Broadcom's variant with custom header + const: brcm,env-layout + +additionalProperties: false + +examples: + - | + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x0 0x40000>; + label = "u-boot"; + read-only; + }; + + partition@40000 { + reg = <0x40000 0x10000>; + label = "u-boot-env"; + + nvmem-layout { + compatible = "u-boot,env-layout"; + }; + }; + }; diff --git a/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml b/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml index 9c36afc7084b..6c2a3ca5f051 100644 --- a/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml +++ b/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml @@ -26,9 +26,15 @@ description: | Variables can be defined as NVMEM device subnodes. + Introduction of NVMEM layouts exposed a limitation of this binding design. + Description of NVMEM data content should be separated from NVMEM devices. + Since the introduction of U-Boot env data layout this binding is deprecated. + maintainers: - Rafał Miłecki +deprecated: true + properties: compatible: oneOf: