From patchwork Tue Oct 18 15:42:01 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: 616067 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp2710910pvb; Tue, 18 Oct 2022 08:42:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7/MQNYzD6wLVMBW1xDVEdktq+FMSQS1lEeaarN1BVft4WknMhas8S6gNaFG26h6Pi9EJiJ X-Received: by 2002:a63:f07:0:b0:440:5c6e:5833 with SMTP id e7-20020a630f07000000b004405c6e5833mr3190763pgl.375.1666107740182; Tue, 18 Oct 2022 08:42:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666107740; cv=none; d=google.com; s=arc-20160816; b=zpfYkJp9mSOs66nIYOqKzJtUzYxmheFeb5OS91IYjkjz1lyt6QVkUrMQveADPnpL7o nr286sDjogulUIAWVAKv04oo6ehJkJtB8xn6vdmJ9v20XGdUDbxDnotsNne/93Ui7t/x vUSLcNO7SWRbK7WialB138tcTFjB8cfBxzNP2aVkHPaFqEc9G7KKAbNnnZJhxy75pTet x41bvoPp/3QNyi3VneBoNIvaOtoag9KoV1cIa8vn68UCu3o8jqr4drg3MxVxmzDbmzkV NElV+RD+F/Bou19cUMcP9+Sc4ZrZN5VBntS1UxjNZ5vZwZlhvomfQDGobzRc6fMmzk7N rfkA== 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=b56rtWITDRxSLrlOSl1k6NFsHhuMjl+yg3dnUWpYOLI=; b=qNOIq9cGy7y9jTXVkWmUZBjFcWpQiWzNXI4Xc1G/G2xmTmuYatOaPokKvFnhPB8DJJ 2Ac4UvFq6+E5xzFjrMrQg4x76rdLs+e+XR6FRcr91PTJIFOG7DbzhvyMYh2rCt/Z1CkP /wuJViz96t4QJ6qPkavWIXeSCM0raHFiioeY4ArsTvnYK1xNJKl6gWb+bXwaxbqGl6S7 M1lWhsWPYS86FPmejoSlYcSyqatlbjMRfKbyeM6rqBFVa+GoxBhvnm4p2IjcT/rOLg96 O3DwlK4T2AB7co94NE2ThYjHeFHHDlYUaFt5zPT/C/1DtchY7MUK/ZiGqdYhV1GUwWnS kjrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Hsg3mAtj; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id f9-20020a636a09000000b0046b208e7298si14879302pgc.782.2022.10.18.08.42.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 08:42:20 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Hsg3mAtj; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 98E9184F70; Tue, 18 Oct 2022 17:42:11 +0200 (CEST) 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="Hsg3mAtj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E12EB84F63; Tue, 18 Oct 2022 17:42:09 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.8 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 autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) (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 724A284E8B for ; Tue, 18 Oct 2022 17:42:07 +0200 (CEST) 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-ej1-x62e.google.com with SMTP id w18so33207021ejq.11 for ; Tue, 18 Oct 2022 08:42:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=b56rtWITDRxSLrlOSl1k6NFsHhuMjl+yg3dnUWpYOLI=; b=Hsg3mAtjQpvoO0pLzprhW7xgoGOGI9zwrr5XD4snsU4F2F19updt3nOKcLraXbNufg 6bi+WVZzw1OfNhBMm7czC2GVw6NQtKcSmH4HY4zHXL0ZxhAueBJOUTBxD50dEyLL3cp3 4vgWY9G0/R2YvmWhUjhEUohttuigcFXKnhaa014/PoXwR2Kv+oqqYEF8t1s9rvQ++zk0 6uEdLi8wSZnJXHHhkqm68CAEhVaphljOS6vR8l4GOGttnFCyREdcHlUVPDBPpIpFHevw A/SMRbUmPd674Kgf7FSdbZNDrSvOTBHItZwssZwhHj0e2L4byCwUgXx0kCLc+uXBYIgt SU0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=b56rtWITDRxSLrlOSl1k6NFsHhuMjl+yg3dnUWpYOLI=; b=7jctHkr42jlHUP4aDsMtqshVLM6SY61ScD7kmPZnfPDEYXkZYT2w9U99G/36TXCBVx 4U4VP70cIaJ3wINy+3DbcVKsIChdfQQL2fw1NhuRbxG0zz9R8Hs3XwBwvQhSOGRe7Gnx 3+iqlDb7MZNhg7Rt/gK17ICiV/dhgB1fxqLzPnCeAV3nGktUv2LoGiWDr+Sm+Sb/rrzc Q5L5/G0pEBeeHQSFRiL0DVFMz/3k6et0k9xKxgce7B2ywj2DLI6bk3Z9BR9IW4qwOqqy J2DRK+iynIEVSGPVs2hAGvjlb/gnQ0847ru7ggNuF1VpCLsxQnlXymMibmHGFtIj/5pF ileg== X-Gm-Message-State: ACrzQf2kRj1MubH8HQf3nTSFRwa6eoXjb+pPFV1cq9yCdZjt8i2ZsFp/ gD9oPZzsxzWD9oDj6+ltui4= X-Received: by 2002:a17:907:72d2:b0:78d:4c16:a68d with SMTP id du18-20020a17090772d200b0078d4c16a68dmr2949288ejc.401.1666107726858; Tue, 18 Oct 2022 08:42:06 -0700 (PDT) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id c18-20020a170906925200b0078dd2f9357fsm7751636ejx.89.2022.10.18.08.42.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 08:42:06 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Rob Herring , Krzysztof Kozlowski Cc: Srinivas Kandagatla , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Tom Rini , Florian Fainelli , Joel Peshkin , William Zhang , Conor Dooley , devicetree@vger.kernel.org, linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, u-boot@lists.denx.de, bcm-kernel-feedback-list@broadcom.com, linux-kernel@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH V3 1/2] dt-bindings: mtd: partitions: u-boot: allow dynamic subpartitions Date: Tue, 18 Oct 2022 17:42:01 +0200 Message-Id: <20221018154202.4634-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.6 at phobos.denx.de X-Virus-Status: Clean From: Rafał Miłecki U-Boot partition may contain subpartitions. For example Broadcom includes environment data block in the middle of its U-Boot partition. This allows describing Broadcom's U-Boot env data and will allow referencing its NVMEM cell in the future. Reg: 118f3fbe517f4 ("dt-bindings: mtd: partitions: support label/name only partition") Ref: dd638202dfb65 ("dt-bindings: mtd: partitions: add additional example for qcom,smem-part") Signed-off-by: Rafał Miłecki --- V3: Add this patch as pre-requirement for u-boot,env.yaml & brcm,env --- .../devicetree/bindings/mtd/partitions/u-boot.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/mtd/partitions/u-boot.yaml b/Documentation/devicetree/bindings/mtd/partitions/u-boot.yaml index 8a88e7d16524..3c56efe48efd 100644 --- a/Documentation/devicetree/bindings/mtd/partitions/u-boot.yaml +++ b/Documentation/devicetree/bindings/mtd/partitions/u-boot.yaml @@ -27,6 +27,10 @@ properties: Broadcom stores environment variables inside a U-Boot partition. They can be identified by a custom header with magic value. +patternProperties: + "^partition-.*$": + $ref: partition.yaml# + unevaluatedProperties: false examples: @@ -40,6 +44,9 @@ examples: compatible = "brcm,u-boot"; reg = <0x0 0x100000>; label = "u-boot"; + + partition-u-boot-env { + }; }; partition@100000 { From patchwork Tue Oct 18 15:42:02 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: 616068 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp2711044pvb; Tue, 18 Oct 2022 08:42:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7s91BbVT+w4xDMdbshFmi+9LYsB1deWNsAs3urQzmz3dJnvfpbFWTZAqzj9DzNqt84Cr9E X-Received: by 2002:a05:6a00:1707:b0:562:e790:dfc3 with SMTP id h7-20020a056a00170700b00562e790dfc3mr3844255pfc.59.1666107754550; Tue, 18 Oct 2022 08:42:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666107754; cv=none; d=google.com; s=arc-20160816; b=AonWGS4IxLiLaKl44UQNMt3TQu24OMmUUXvx5kPidNypg6OL0DYhY12t8zK/T2aEn0 RRv0B/HeIuwAMnBqUI+NUHaQ0g/cMpICpfIPUeIa/5LSJM2WXQiPOnUEJ/f5kYhxEsLN Aq1M1D8WOXp2EGo19zndmUtIJvCHOs/MOp1Sgm+pW4FkdDprG8cMZPfQw9HW1E/9zcyr 82dAoLx0czVqKRBsRdGexoGU5oqNGKlJtzngS0oRiNFwQvL1OF8SZWxUuqjAxQYzCztj phTSfGiwzFT9KMSGBDgQ1xccjofTzrPRPhhoBkfL5sMwDx3hpqPR4d6P2iUGe3aDK6OM phLg== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=t6V4GGutCgqH9SAAugBYUbePwRzXguzjtNw602xA/gE=; b=PPzeXZMoUf5ukQeGp8YCAxyNkLgigM7NBwwvtOqfwk8L4BPGLiZ5BPJLnFJ7hPmcxJ YnQzO0n0YRYL3zaaJyRRT3+isJhoCDFXSEvrPYJ6VHPZTb3Dvnp/NTXKV7fybJhDDbRe qSBDzDdylziFXO40S6PPmAaYYETR8Li7eRX0tlS2Y1apzUkHbROGrrAAlP9jh6x85QvW 1OIeG6i4c5wQZB7lKqEPIFmLWF0O2j5yA0Pt1RrGO6G6MSLNSltZnEG+ztFwwppLGB8i HGgO3zmDBnXRxKToqLH5V28Dm6Ij6yn+U7G8YEnEyXda1vYdpW7kFNltXAKcRB4txGoE zKbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20210112 header.b=mHm+3pWb; 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=fail (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 ls11-20020a17090b350b00b0020b15fcac76si24772612pjb.4.2022.10.18.08.42.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 08:42:34 -0700 (PDT) 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=fail header.i=@gmail.com header.s=20210112 header.b=mHm+3pWb; 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=fail (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 28F8184F84; Tue, 18 Oct 2022 17:42:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (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=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mHm+3pWb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DAAC984E8B; Tue, 18 Oct 2022 17:42:12 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.8 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 autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) (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 53C6B84E8B for ; Tue, 18 Oct 2022 17:42:10 +0200 (CEST) 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-ej1-x62e.google.com with SMTP id w18so33207441ejq.11 for ; Tue, 18 Oct 2022 08:42:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=t6V4GGutCgqH9SAAugBYUbePwRzXguzjtNw602xA/gE=; b=mHm+3pWbcBXYNzpH81/lPhpNc0B5kdPfe11TzAwKplI3MeDt+vueDt94EyEvU1Sp/9 FG7s+qK49MByuxF/6qySYFNkRnj6YmVQQEE8HHmga3zOcvsVUPoRbh5/mWw2A8h+CosA 443JPbvEAxAPNq/5WHvZnMihOiVz1OULEPw6NGmo6iRZMTZVReFpSbtdIE/2luLroH3l 7acYUGPBANPm+bneNLEmYehFT74EjsE/BD5l0SplQu2yBTl0Otb6yxygQGBfyJww9O47 siGdsYoNyCv6f7moBSe45FPQAvagtdUYy1gQ6hueJSaHwvMavITll5AvKH7uzXQC3EX0 U8aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=t6V4GGutCgqH9SAAugBYUbePwRzXguzjtNw602xA/gE=; b=rU7iQF9+vQgYpSunlKfJW8hg7jUxuirFZE8BFI+u/i18hfOWm36veK2kvK60YQ+ViR 1y44Zwl4CZZFjR6oodj8hZfFoLiiZj+gcJl/0bJQA+nAO9j0evXlI7IHs4CinAHv7pUU gOSDmugpGLmIWPhz6j7RJAvYDOIgIPS0EhKbFCjTh9F8QXUyUt5x4eE6UBvBRv84eZng t9S1Yo2/nBVywk6DpjjIyzGRPF+uoB5yAIdDaDzfre10acMCZt2eL6RN345mO27m+y4p l/joOmiC2zWEYSTe+e429Q2qrQN/JiNAy0zxu+bscZIeVwkwwmvL6bdsXsIygOpUVesZ Ciog== X-Gm-Message-State: ACrzQf13eYgV0Ayj8g+vPe6abCURCB7VHu7PkPO1yQM+6Z1uhUlrhpgb M/EEYy3gRtdm5OnvQbhZtFw= X-Received: by 2002:a17:906:9c82:b0:781:5752:4f2b with SMTP id fj2-20020a1709069c8200b0078157524f2bmr2842003ejc.561.1666107730031; Tue, 18 Oct 2022 08:42:10 -0700 (PDT) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id c18-20020a170906925200b0078dd2f9357fsm7751636ejx.89.2022.10.18.08.42.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 08:42:09 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Rob Herring , Krzysztof Kozlowski Cc: Srinivas Kandagatla , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Tom Rini , Florian Fainelli , Joel Peshkin , William Zhang , Conor Dooley , devicetree@vger.kernel.org, linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, u-boot@lists.denx.de, bcm-kernel-feedback-list@broadcom.com, linux-kernel@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH V3 2/2] dt-bindings: nvmem: u-boot, env: add Broadcom's variant binding Date: Tue, 18 Oct 2022 17:42:02 +0200 Message-Id: <20221018154202.4634-2-zajec5@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221018154202.4634-1-zajec5@gmail.com> References: <20221018154202.4634-1-zajec5@gmail.com> 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.6 at phobos.denx.de X-Virus-Status: Clean From: Rafał Miłecki Broadcom uses U-Boot for a lot of their bcmbca familiy chipsets. U-Boot stores its configuration in an environment data block. Such blocks are usually stored on flash as a separated partition at hardcoded address. Broadcom however decided to: 1. Store env data block inside U-Boot partition 2. Avoid sticking to hardcoded offsets 3. Use custom header with "uEnv" magic and env data length Example (length 0x4000): $ hexdump -n 32 -C -s 0x40000 /dev/mtdblock0 00040000 76 6e 45 75 00 40 00 00 34 89 7a 82 49 4d 41 47 |vnEu.@..4.z.IMAG| 00040010 45 3d 4e 41 4e 44 3a 31 4d 2c 31 30 32 34 4d 00 |E=NAND:1M,1024M.| (0x40000 offset is unit specific and can change) Starting with the commit 118f3fbe517f4 ("dt-bindings: mtd: partitions: support label/name only partition") DT can describe partitions matching them by a name (without specifying actual address). With that feature and this binding change it's possible to: 1. Specify DT node for Broadcom's U-Boot env data subpartition 2. Add nodes for specific environment data variables 3. Reference them as NVMEM cells This binding is unlikely to help Broadcom's U-Boot. U-Boot SPL needs to find environment data early (before it accesses DTB) and it does that by looking for an "uEnv" magic. Dirty way. This binding can however be used by operating systems. It allows describing cleanly U-Boot, its env data and variables. It tells operating system about Broadcom-specific env data so it can parse it. Signed-off-by: Rafał Miłecki --- V2: Work on better commit body & add example V3: Avoid duplicated "mac" label --- .../devicetree/bindings/nvmem/u-boot,env.yaml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml b/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml index e96bca99f2d9..cbc5c69fd405 100644 --- a/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml +++ b/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml @@ -38,6 +38,8 @@ properties: const: u-boot,env-redundant-bool - description: Two redundant blocks with active having higher counter const: u-boot,env-redundant-count + - description: Broadcom's variant with custom header + const: brcm,env reg: maxItems: 1 @@ -73,3 +75,22 @@ examples: }; }; }; + - | + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x0 0x100000>; + compatible = "brcm,u-boot"; + label = "u-boot"; + + partition-u-boot-env { + compatible = "brcm,env"; + + ethaddr { + }; + }; + }; + };