From patchwork Thu Dec 21 17:34:16 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: 1879317 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=uErW5Ldb; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=m6M2Q2uS; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SwyHj5Zsnz1yr5 for ; Fri, 22 Dec 2023 04:35:12 +1100 (AEDT) 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=grsKtFi6c9rLhIVk/zRWYOBWnGaQcB3LX/Ht/50qWNI=; b=uErW5LdbRtulLQ vzeNbjIHzPCbjsu93eGlG9ca+TGZkk2Jdz8Dkox9aarmdPtTrgWb6tyRh/yUSp9ouNN2ILfWdyPY8 T9aOY5Ctx4aQREcGfGioC1UgH3rjth8XPwvlkweHqTwaXSpd5SMhcTZdVF604zjBr09JupIGVqprI SRYExzjrYaFTmAw2DbnZCIInzgzfJNUJcPlarUIDc5S5i5D2FBOvUvkSaCq4Ucp+VT2inWHbzIWVR xwETn1r4x2WB34ZrAWF1D1landgPFqeuYXIY63NGhShx8onk0RPmtizRRu9q89TtVgA9T9gN0cblC i+t9PMniD1YzUXTfpUBw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rGMwO-003g2E-2q; Thu, 21 Dec 2023 17:34:36 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rGMwL-003fzJ-24; Thu, 21 Dec 2023 17:34:35 +0000 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a2339262835so118136066b.3; Thu, 21 Dec 2023 09:34:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703180070; x=1703784870; 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=m6M2Q2uSKNNGKU9yn05ky6pD9L7oQo8MRW4tmFhL5Lya6zG1Q1BkKUycsVhx8aTLEw zO3PEGc/pxK/CjiFkoItFj6lb/IoLFUVyTRJc7oXVUIkxD2NJQIjnJiB4xyZfe6iDdI1 W1clnhb6KNMdnfPtddQ3WDpsEVFcWn2N8rGWVtmdnzvIbX851fnAF3DIDOjpZdgxpMdm ypuw0YU5nD0QES0z8NY47BtN7XZFF4WZ8ZoiShjyFeX1bakM3Dc4CmUF4ctKAkxKtNj1 xqvojMoLuiAowOl/ZZVgON7k/BRzCHXu6WUxpGDPjd6S25386YNvMPxx7fML/+Fh6PJG dLzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703180070; x=1703784870; 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=V+o4LDTqOU9bsmwdPOMoXhfTAGhO4VWuzl8bxdnnpC35mA98Ryp0RoxvjcurGOVdAe dtdtw6ot59bShcJxvLJfymwnPuC0aQ/pgmJAEmfCeX9nGJ+aY+ELEyoncjztDo4HTVXv JLnGW69Aqb8b981AEQh/5847RwjLGCwW6dA+9FrLV2Ux8loy5kK1E4Hj163y77wZVLV3 A1EckyrQRywK9mYXb7Wzol8e2uAegb98rHhrUax/N6JEiX8pyBNOhPR3TZuCPeT8XRX7 cV5pvrjqM3JjpuGvyHKEV7ZLf2lZCz4oXy49DDhzy+bBvHAZQCPNw1XMcqiAkJVBBaG+ hTKQ== X-Gm-Message-State: AOJu0Yw0Nix+Jwf1dpA5FtUjkWtjuErNzjlF8d0psVieH+RWuM6PZIoS Hdq6GA9aKckPp7tN/jpUbR8= X-Google-Smtp-Source: AGHT+IFhvgdzoX/pSzYG9L+mNveigbIiVGhQYxcEzlqMYOH+0jGOj+DcvcKDRwemDM4HbX3utBRWiA== X-Received: by 2002:a17:906:1db:b0:a26:8c3a:5133 with SMTP id 27-20020a17090601db00b00a268c3a5133mr61852ejj.99.1703180069801; Thu, 21 Dec 2023 09:34:29 -0800 (PST) Received: from localhost.lan (031011218106.poznan.vectranet.pl. [31.11.218.106]) by smtp.gmail.com with ESMTPSA id z25-20020a1709060ad900b00a23499f1d7dsm1176118ejf.209.2023.12.21.09.34.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 09:34:29 -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 V3 1/6] dt-bindings: nvmem: layouts: add U-Boot environment variables layout Date: Thu, 21 Dec 2023 18:34:16 +0100 Message-Id: <20231221173421.13737-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-20231221_093433_690751_0975DF0D X-CRM114-Status: GOOD ( 16.71 ) X-Spam-Score: 0.1 (/) X-Spam-Report: =?unknown-8bit?q?Spam_detection_software=2C_running_on_the_sy?= =?unknown-8bit?q?stem_=22bombadil=2Einfradead=2Eorg=22=2C?= =?unknown-8bit?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_ori?= =?unknown-8bit?q?ginal?= =?unknown-8bit?q?_message_has_been_attached_to_this_so_you_can_view_it_or_la?= =?unknown-8bit?q?bel?= =?unknown-8bit?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?unknown-8bit?q?_the_administrator_of_that_system_for_details=2E?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_preview=3A__From=3A_Rafa=C5=82_Mi=C5=82ecki_U-Boot?= =?unknown-8bit?q?_env_data_is_a_way_of_storing?= =?unknown-8bit?q?_firmware_variables=2E_It=27s_a_format_that_can_be_used_of_?= =?unknown-8bit?q?top_of_various_storage?= =?unknown-8bit?q?_devices=2E_Its_binding_should_be_an_NVMEM_layout_instead_o?= =?unknown-8bit?q?f_a_standalone_device=2E?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_analysis_details=3A___=280=2E1_points=2C_5=2E0_req?= =?unknown-8bit?q?uired=29?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_pts_rule_name______________description?= =?unknown-8bit?q?_----_----------------------_------------------------------?= =?unknown-8bit?q?--------------------?= =?unknown-8bit?q?_-0=2E0_RCVD=5FIN=5FDNSWL=5FNONE_____RBL=3A_Sender_listed_a?= =?unknown-8bit?q?t_https=3A//www=2Ednswl=2Eorg/=2C?= =?unknown-8bit?q?_no_trust?= =?unknown-8bit?b?IFsyYTAwOjE0NTA6NDg2NDoyMDowOjA6MDo2MzIgbGlzdGVkIGluXQ==?= =?unknown-8bit?b?IFtsaXN0LmRuc3dsLm9yZ10=?= =?unknown-8bit?q?_-0=2E0_SPF=5FPASS_______________SPF=3A_sender_matches_SPF_?= =?unknown-8bit?q?record?= =?unknown-8bit?q?_0=2E0_SPF=5FHELO=5FNONE__________SPF=3A_HELO_does_not_publ?= =?unknown-8bit?q?ish_an_SPF_Record?= =?unknown-8bit?q?_0=2E0_FREEMAIL=5FFROM__________Sender_email_is_commonly_ab?= =?unknown-8bit?q?used_enduser_mail?= =?unknown-8bit?q?_provider?= =?unknown-8bit?q?_=5Bzajec5=5Bat=5Dgmail=2Ecom=5D?= =?unknown-8bit?q?_0=2E2_FREEMAIL=5FENVFROM=5FEND=5FDIGIT_Envelope-from_freem?= =?unknown-8bit?q?ail_username_ends?= =?unknown-8bit?q?_in_digit?= =?unknown-8bit?q?_=5Bzajec5=5Bat=5Dgmail=2Ecom=5D?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FAU__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_author=27s_domain?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID_____________Message_has_at_least_one_v?= =?unknown-8bit?q?alid_DKIM_or_DK_signature?= =?unknown-8bit?q?_0=2E1_DKIM=5FSIGNED____________Message_has_a_DKIM_or_DK_si?= =?unknown-8bit?q?gnature=2C_not_necessarily?= =?unknown-8bit?q?_valid?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FEF__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_envelope-from_domain?= X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.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: