From patchwork Tue Jul 18 16:06:50 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: 122125 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1875104vqt; Tue, 18 Jul 2023 09:46:09 -0700 (PDT) X-Google-Smtp-Source: APBJJlFyNgDWBtmCV3wZPBo8RDkmn8QjStFDq818MIpJiNL0MJAfqNarRnNySphfuS6aD+3NSpLK X-Received: by 2002:a17:906:10dd:b0:991:e458:d14 with SMTP id v29-20020a17090610dd00b00991e4580d14mr264241ejv.34.1689698768412; Tue, 18 Jul 2023 09:46:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689698768; cv=none; d=google.com; s=arc-20160816; b=KtFJ3+JXV3Gb5ig+g6TnAJVqRx3e9UAOhBEkyTodxI5RxiJUocL1JvLyGvaB7S7en/ UouRINna1RByKLkZhv3D8ZKap69x8Ilxj4kHEmKNIO+9RTSWA5jOFTMmdvwEOr+K+a3h zkj+j5qK0ClK5qPmD+SqZewQGEVRbCG1gz6A7Qa+HUktjPfTv+vJ8n3EJm0QD67ilYBq g3m4ZVJGn8hqYKBhKXhkkQ2qMYqhOs4qQjKCtehGZ5MfzZeR+x++SwoqIIxpmmDF/yYB HOWa3ZCNknKlZOxXEdYeD9tAY7ozvXyR9DeCZeV/xXldO3PBp5BsC6RE82leN0Wfmnyu QB6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=YeCwq3NAvGKoLBdtM+ZqWilWIkfGP+nzxQkw03W43jw=; fh=OZJ2vvkAwIY9Q1saTUUx8Lfoen0uPZhUU3e521tswQ8=; b=BS8ERfEt7A99whVdW9tChZpjwIpR/TsMzZ/fFwFKwG37zIaqeDAujCT36ksvpNYmuX rYJ3aeO4uWEtibR5/Dch5IOLFKgrVKakFN2lYikrNUe8y3IuAhGGJgGo+BNVzx0alUJ+ Hxf+2jwMcoJN7lNiiPsaNPF7Us1H2FYleoEPxEm3YWopN0/8imM7ouuWf1OXxzcCEVIr A2LZfYKj0Yw5BXVSobpGw9thWxBofqyA2qeuXeTy0u3FsY+dL+/uoekr72Cu98uftG8L whjzr2E80s3ZRzlM1QjXiRVptyFgbTbLYXQfu7dnfyr1wL2zOCeKr8JJUW44+FWcHv1Z jlgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=py923FTw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gz6-20020a170906f2c600b00991df467bafsi1434493ejb.617.2023.07.18.09.45.43; Tue, 18 Jul 2023 09:46:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=py923FTw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231812AbjGRQHH (ORCPT + 99 others); Tue, 18 Jul 2023 12:07:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232781AbjGRQHD (ORCPT ); Tue, 18 Jul 2023 12:07:03 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A7E0FD; Tue, 18 Jul 2023 09:07:00 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4f95bf5c493so9567078e87.3; Tue, 18 Jul 2023 09:07:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689696419; x=1692288419; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=YeCwq3NAvGKoLBdtM+ZqWilWIkfGP+nzxQkw03W43jw=; b=py923FTwOMCDnC8JmqUXd3moipT/chxFwEuQOS01u03mcDZH+qM63VBPcE6kTHeR+e Zbw6ldttWJTYJnoRJWtbN76grxXk9zv8FoV3CTN498ENNbKkdzg1485yC300ux/X0m0h m3ChdyXUdR4UJeV7O/ZwT2sTeyNjvi02FIFhp8ipq2hyJPaKU9Ryx9OoBkXJ6trsCGwP 57kOg+608pEaaCZ6o4E1yBJYaLmUvuscPCnkwQs+SEPWZAfhr6UxUa1qVGKm4IblM9ol ttJyO6vUDGl8ZPoveKyRKqEhf2+LGMohTbBrECAiHfwLqrzyzzQeiaB73PzlyXeIrhrN OGMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689696419; x=1692288419; 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=YeCwq3NAvGKoLBdtM+ZqWilWIkfGP+nzxQkw03W43jw=; b=QIGJnGL6NVFj38Im9HMvkLFY0EGe/NEWUZexKyCzBTRuecgy9YJIITdIbg+siV275o fQD4qct/WU4eq05mRWHtxFFeG7IKq5AM9HsYMFJlIznkgBW3lRttijrTMu5fKPD+8OWb RWVoVJ5yx94B2c4p/HQJzGJBwgWyHIL4kI+ELE4q2hI+g5o01R9uRQ40LDA4RHO6K5oE RJn8GKY7vYTedIVbeCeXBIpVV0sKN9l2smx9uecI85jjtVFMS5Hv6W2ysACcUGLxbW/N adQQytqW6jRAhIakqsgIbvnK1dP24dQ3zOcFDR6k9LdYCFnVzsz3/s/gOzAtV6yD1Imp 4D2A== X-Gm-Message-State: ABy/qLbeEJZk0yKKyGg4+ra8WZVGtWz16ha4/tPeM5WlWjzsLyffvFom FSD7wN2esy/T9wIbX1AsTyg= X-Received: by 2002:a05:6512:1ca:b0:4f8:70f8:d424 with SMTP id f10-20020a05651201ca00b004f870f8d424mr10354189lfp.65.1689696418378; Tue, 18 Jul 2023 09:06:58 -0700 (PDT) Received: from localhost.lan (031011218106.poznan.vectranet.pl. [31.11.218.106]) by smtp.gmail.com with ESMTPSA id t14-20020ac24c0e000000b004f86aef886asm502295lfq.54.2023.07.18.09.06.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jul 2023 09:06:58 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Srinivas Kandagatla , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Michael Walle , Christian Marangi , devicetree@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 1/3] dt-bindings: nvmem: convert U-Boot env to NVMEM layout Date: Tue, 18 Jul 2023 18:06:50 +0200 Message-Id: <20230718160652.26756-1-zajec5@gmail.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 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,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771777575874682790 X-GMAIL-MSGID: 1771777575874682790 From: Rafał Miłecki Use "nvmem-layout" and drop unused "mac" label while at it. Signed-off-by: Rafał Miłecki --- .../bindings/nvmem/layouts/nvmem-layout.yaml | 1 + .../nvmem/{ => layouts}/u-boot,env.yaml | 17 +++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) rename Documentation/devicetree/bindings/nvmem/{ => layouts}/u-boot,env.yaml (87%) diff --git a/Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml b/Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml index 3b40f7880774..382507060651 100644 --- a/Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml +++ b/Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml @@ -21,6 +21,7 @@ oneOf: - $ref: fixed-layout.yaml - $ref: kontron,sl28-vpd.yaml - $ref: onie,tlv-layout.yaml + - $ref: u-boot,env.yaml properties: compatible: true diff --git a/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml b/Documentation/devicetree/bindings/nvmem/layouts/u-boot,env.yaml similarity index 87% rename from Documentation/devicetree/bindings/nvmem/u-boot,env.yaml rename to Documentation/devicetree/bindings/nvmem/layouts/u-boot,env.yaml index 36d97fb87865..ebe3b71ba155 100644 --- a/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml +++ b/Documentation/devicetree/bindings/nvmem/layouts/u-boot,env.yaml @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause %YAML 1.2 --- -$id: http://devicetree.org/schemas/nvmem/u-boot,env.yaml# +$id: http://devicetree.org/schemas/nvmem/layouts/u-boot,env.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: U-Boot environment variables @@ -72,11 +72,14 @@ examples: }; env: partition@40000 { - compatible = "u-boot,env"; reg = <0x40000 0x10000>; - mac: ethaddr { - #nvmem-cell-cells = <1>; + nvmem-layout { + compatible = "u-boot,env"; + + ethaddr { + #nvmem-cell-cells = <1>; + }; }; }; }; @@ -92,9 +95,11 @@ examples: label = "u-boot"; partition-u-boot-env { - compatible = "brcm,env"; + nvmem-layout { + compatible = "brcm,env"; - ethaddr { + ethaddr { + }; }; }; }; From patchwork Tue Jul 18 16:06:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 122122 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1873108vqt; Tue, 18 Jul 2023 09:42:23 -0700 (PDT) X-Google-Smtp-Source: APBJJlEQASe0FbXtrokt/3yn+slvPpQ2VDloPLH5t/8rYdlTffntzf3erH6zMASgoekDpB2X9bCH X-Received: by 2002:a05:6402:51d3:b0:51e:5e3d:cb92 with SMTP id r19-20020a05640251d300b0051e5e3dcb92mr578858edd.16.1689698543032; Tue, 18 Jul 2023 09:42:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689698543; cv=none; d=google.com; s=arc-20160816; b=pCuXh45d8ZKcBqBL8jVcvNkR3TYKOgiALN+6M+UL4bBDf0/mWvWZaWQ1CHGaUIA3tk a075SNDLiC9mbn9H6EcIMDBNrxh5uian2wyIBdZJ7Qd/iE2CRlLfUeU2ocpQdmnWnmHR OFapaadGq9XTvQurrG89yFSL+4e1kFaSAvfRPzAMCWahX0/QmkWW28g9aCbc7M8yHBdp OmaAmQHod6bxXsyfoBFk4DVuVKVeSIoYQg6SrBPvczB+Iz1veEbNAqz2baYKNKz8qtwP gEM5DP2Pf08Ljw7v1CSpLZwGg+mzZuWWbrSJS0jls7jhNbmIwDGgquoKpljK7sfy50ja zhog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5WRSmD7p8kvsp7xa4uhAT4iCZu90Kz42k/8LjgP9Kbk=; fh=YJ+E8oC2l56SkJR2CSlpkfDbCXm6Qpe1291kalgAgPw=; b=tcZHcL8jeeF6nqNgNcVew9js/Gymw6gy0kItFtSAsMh21vVWmA1P0Gg/qB1glUi95D mqPEB6ckaqzaW122OC+x3spBrYEN0+kpq6Yf14Onq9LQWW+FGo/aQHD4HqiGnIP5qf8Z FL8xfx38soJwt3ZseQ7Hd7Znknwq7k9/vwCd5PSHFHdKyYPfXXAKwxw0uQL1dISfWpfw TJ3bNSRDODg8OKy625RXpEyF7KVOXjzXW8OYXJFHgGJx4g8IHUfykgxxVDUvq49Km/Pt VkV7dIl31v4p31jphgixA1WzrlRzx6YfaXRve0Mj1RiinMQqJF8EwpZow7Ncn3tbnScn MkEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=MQUxkW5q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c3-20020aa7c983000000b0051e0fc86b39si1550391edt.329.2023.07.18.09.41.59; Tue, 18 Jul 2023 09:42:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=MQUxkW5q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230362AbjGRQHJ (ORCPT + 99 others); Tue, 18 Jul 2023 12:07:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231179AbjGRQHG (ORCPT ); Tue, 18 Jul 2023 12:07:06 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A982F1; Tue, 18 Jul 2023 09:07:04 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-4fd32e611e0so5217118e87.0; Tue, 18 Jul 2023 09:07:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689696422; x=1692288422; 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=5WRSmD7p8kvsp7xa4uhAT4iCZu90Kz42k/8LjgP9Kbk=; b=MQUxkW5qHcrfmo1oCPvFyde/h/ABI8+EysvW9hs1WZ2Lu0PPMp9ZXeW73kiWnupMBb CSxXmS0Mi2P2x1BrSsYvpDd7rTT/KuCy7VtjPhLgoupzK++Gq28fAiblgYA7022di4FF V1+Uucnha7RyIyTJhk0dNSbc+j+et6sBqdkPCyLHhWNK7UabQcnVYLId75Kln+cD0CrD vOIux3FIwac61j4RJIwrI2YR6b84DEGLcSJ+jsOP2a9XLFFwl8yc6our8w46Kh7ppngL p64YTfukK5o+M7J1or/l0oteaim6X+uHA4oTBRS6yCFOORVY/TZIQ475JWPij1gmoB/i CFaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689696422; x=1692288422; 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=5WRSmD7p8kvsp7xa4uhAT4iCZu90Kz42k/8LjgP9Kbk=; b=djOZqA70jFz56hnZe8SN1yqTS9z2j96xsBpY6eCAjH/W5OCMhDvjKG+ZFTKyaRtrS6 Rfrcalw8shb+yZJdQgDmo1omN8gbD/EqIqbAImz2G1L+IJ7BomVTXxI/ByevCscblNyc 6B/YfRvG72Q4FrVpmcjXgCJHcR3hUd02e1Dgkmu58KX7MNHWGyuLC7u/ayvjUB4hiP2J zeUOuYj1qlX3qtuiZrm1Y5oS2KJGPw7jB4gOOu5PtkbGf03UrZRnRsDRPjQbNikjimWf mCb73mQTWIbHmZvVxbEC6aeWPpEWHNcx+6EYpgOGpF8ec8gtrkj98eLKWGh/F6Nb7cK1 EuOA== X-Gm-Message-State: ABy/qLZv7Uj24vKtEf813VBBVBFBkjXObf/3f8UAYQbThfRLmNNuZIOX 9o6PMgLB8Xa0QM0PuFjVF80= X-Received: by 2002:a05:6512:3d2a:b0:4fb:7d09:ec75 with SMTP id d42-20020a0565123d2a00b004fb7d09ec75mr5949884lfv.4.1689696422069; Tue, 18 Jul 2023 09:07:02 -0700 (PDT) Received: from localhost.lan (031011218106.poznan.vectranet.pl. [31.11.218.106]) by smtp.gmail.com with ESMTPSA id t14-20020ac24c0e000000b004f86aef886asm502295lfq.54.2023.07.18.09.07.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jul 2023 09:07:01 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Srinivas Kandagatla , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Michael Walle , Christian Marangi , devicetree@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] nvmem: core: export nvmem device size Date: Tue, 18 Jul 2023 18:06:51 +0200 Message-Id: <20230718160652.26756-2-zajec5@gmail.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230718160652.26756-1-zajec5@gmail.com> References: <20230718160652.26756-1-zajec5@gmail.com> MIME-Version: 1.0 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,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771777339022048718 X-GMAIL-MSGID: 1771777339022048718 From: Michael Walle Export the size of the nvmem device. NVMEM layout drivers might need it and might not have access to the device which is registering the NVMEM device. Signed-off-by: Michael Walle --- drivers/nvmem/core.c | 13 +++++++++++++ include/linux/nvmem-consumer.h | 6 ++++++ 2 files changed, 19 insertions(+) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index a0c9153cda28..57ccd4422e01 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -2224,6 +2224,19 @@ const char *nvmem_dev_name(struct nvmem_device *nvmem) } EXPORT_SYMBOL_GPL(nvmem_dev_name); +/** + * nvmem_device_size() - Get the size of a given nvmem device. + * + * @nvmem: nvmem device. + * + * Return: size of the nvmem device. + */ +size_t nvmem_device_size(struct nvmem_device *nvmem) +{ + return nvmem->size; +} +EXPORT_SYMBOL_GPL(nvmem_device_size); + static int __init nvmem_init(void) { return bus_register(&nvmem_bus_type); diff --git a/include/linux/nvmem-consumer.h b/include/linux/nvmem-consumer.h index fa030d93b768..3270ad81e140 100644 --- a/include/linux/nvmem-consumer.h +++ b/include/linux/nvmem-consumer.h @@ -77,6 +77,7 @@ ssize_t nvmem_device_cell_read(struct nvmem_device *nvmem, struct nvmem_cell_info *info, void *buf); int nvmem_device_cell_write(struct nvmem_device *nvmem, struct nvmem_cell_info *info, void *buf); +size_t nvmem_device_size(struct nvmem_device *nvmem); const char *nvmem_dev_name(struct nvmem_device *nvmem); @@ -206,6 +207,11 @@ static inline int nvmem_device_write(struct nvmem_device *nvmem, return -EOPNOTSUPP; } +static inline size_t nvmem_device_size(struct nvmem_device *nvmem) +{ + return 0; +} + static inline const char *nvmem_dev_name(struct nvmem_device *nvmem) { return NULL; From patchwork Tue Jul 18 16:06:52 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: 122123 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1874332vqt; Tue, 18 Jul 2023 09:44:48 -0700 (PDT) X-Google-Smtp-Source: APBJJlGg3RSx4m5X2vCfwLtZE34/zgvKdpe2EmoFUlwFMO6nK3Ub0yPT7+nddMOMBYT3TlHe4sry X-Received: by 2002:a05:6402:28d:b0:51e:57e7:3f0c with SMTP id l13-20020a056402028d00b0051e57e73f0cmr473030edv.13.1689698687887; Tue, 18 Jul 2023 09:44:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689698687; cv=none; d=google.com; s=arc-20160816; b=fyHF45CFqTWV2zw6U5wa+rP2yNTxAtHQpIAMJEZ3IW7wS1DC+fLXlNf0hH1JSz7okD MZtLGUNIjhsApR15W4VHKX+Hwx3ZSrciqTcMFaJlUL0wnjo/YmLAPCKrXjhag2GHBm5z UM2HQRmeMUKzdN9ZahuuhW7qyaSSeApnDIOBSSINFXZl9pdiRZ7aJI8y3nhAaq3nBkYi IJujS5m9i+ah4MLk3Espu+6QAh9gkxmtQLFkkoWCgbK5jS1TlrameIBHyvOiLREhRybS 63PAfV7z1Nqy6WzF7TSfnRlTMt7Da9M5bg9SJXNpxpD//Bc203HAw0rlLniLergGxh40 O13w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PYO3tGH2MBohSxIGrRwDWvJzs2Un0ySfOiS4DZ0h6R8=; fh=OZJ2vvkAwIY9Q1saTUUx8Lfoen0uPZhUU3e521tswQ8=; b=lB3pk/KoZ7zTOl8yFVBQDWo7uQk36dyBA9fhjyifSgnad/HXE5zjEQTCZIWc1D/S4/ l6z3Ft9aWlP7CqQRs0NUBWPIO5m2NcxRERbV5a/Qwc+pAyiuS1K59upK0Pfqv74tJIzK XtGKH+pI4ZZOUtb5chy//oNogTj5H3Gd6rzDK56Zr81yP3b2W9tR+mU2N7LVBL34HZvN 8lNSR6gb9RcG4mSWvvCgpAbtIC0X2sSh+ofJayd2dWyzpEtV4qcBdtABndI2NvGVFxkp jQRv2933pdSWN8JZ5idXv7lw7TRIAvf8lUT/ua/RHHnQo4KnucWbIDdVJRqFTuruP5G5 +PSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=GT99Yn5X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x24-20020aa7cd98000000b0051df10548a0si1493955edv.600.2023.07.18.09.44.21; Tue, 18 Jul 2023 09:44:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=GT99Yn5X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230346AbjGRQHU (ORCPT + 99 others); Tue, 18 Jul 2023 12:07:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231764AbjGRQHR (ORCPT ); Tue, 18 Jul 2023 12:07:17 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37F10A4; Tue, 18 Jul 2023 09:07:07 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4fcd615d7d6so9007084e87.3; Tue, 18 Jul 2023 09:07:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689696425; x=1692288425; 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=PYO3tGH2MBohSxIGrRwDWvJzs2Un0ySfOiS4DZ0h6R8=; b=GT99Yn5XNGnVERhtU/ltZKp8nqyrPcRtnYkCGPugt5FhzQoaa/0GvD0HqIXaM6JOFF IgRU0uYYHMoYzyeaI89rmAciAXqlpRzEYVfQXhtqyDKvXFs1vhZUxT+7BHs1Paa1GSzJ zEOFtgxvUPTWPetEU8L11PxGwIlTniwuNrCHEdKGU2U4kfvWj5q8AIkqRaUu6mqVWrmS rwGZYRmyp7hdXKaoT6NrlyhZOWFOcUMaTYTpjYSW9BIx6izB6Bi/TSYAk92hdEB7kS8K DF4E8CKO23kQ3RBN9hVGRi8+/ZGM4D0kbgQCLGDOOuF8+fpoYG3bGn5NCjyG8oADPKAt rpPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689696425; x=1692288425; 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=PYO3tGH2MBohSxIGrRwDWvJzs2Un0ySfOiS4DZ0h6R8=; b=N4d38F13ivB6w8Iv1f7x+RxI5CnkZkF41K4hUpM4qg7/oTDrYplL8QR/cFhl0bvCX6 TxbN6y6faeIyKwmMY56uBRLp/tz00KdQ2qHtxxHbdji6sHM/6zWeiJU5PraH7iDeDuJ4 6qYIwlFDQbRS8pnQC+0+6PmifQToLTJe7rhkjUGXHFFMCTbD1q3t0Z1XEusoy2Kf2iO+ 1H76h0NbXgUPaOIzrx45pK4IAIpuGjlymQdPO7VNs6iaW9sqBwYM7ivaC2piNT624kzO Efd44mwGtZY/kOeFuLpB37/WinIDCN4GShBGO02HCW5E2crJKBzX54fDwu8wXzMrkVbj jPsQ== X-Gm-Message-State: ABy/qLb7XSpY5ZBZaz4Xc/E0w0pHIL3nltxqdFhZX9GPlPfLUQZ79i/9 yVpjh1+qB0yAs5YvkAFEkHs= X-Received: by 2002:a05:6512:473:b0:4fb:cb10:64d0 with SMTP id x19-20020a056512047300b004fbcb1064d0mr15639048lfd.29.1689696425315; Tue, 18 Jul 2023 09:07:05 -0700 (PDT) Received: from localhost.lan (031011218106.poznan.vectranet.pl. [31.11.218.106]) by smtp.gmail.com with ESMTPSA id t14-20020ac24c0e000000b004f86aef886asm502295lfq.54.2023.07.18.09.07.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jul 2023 09:07:05 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Srinivas Kandagatla , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Michael Walle , Christian Marangi , devicetree@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH WIP 3/3] nvmem: u-boot-env: convert to NVMEM layout Date: Tue, 18 Jul 2023 18:06:52 +0200 Message-Id: <20230718160652.26756-3-zajec5@gmail.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230718160652.26756-1-zajec5@gmail.com> References: <20230718160652.26756-1-zajec5@gmail.com> MIME-Version: 1.0 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,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771777491351109738 X-GMAIL-MSGID: 1771777491351109738 From: Rafał Miłecki This avoids code duplication (NVMEM device access) and allows reusing this on top of other NVMEM devices. Signed-off-by: Rafał Miłecki --- drivers/mtd/mtdcore.c | 7 ++ drivers/nvmem/Kconfig | 15 ++- drivers/nvmem/Makefile | 2 - drivers/nvmem/layouts/Kconfig | 10 ++ drivers/nvmem/layouts/Makefile | 1 + drivers/nvmem/{ => layouts}/u-boot-env.c | 112 +++++++++-------------- 6 files changed, 68 insertions(+), 79 deletions(-) rename drivers/nvmem/{ => layouts}/u-boot-env.c (67%) diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 3d781ffb8c32..5f96affdfb0f 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -556,6 +556,13 @@ static int mtd_nvmem_add(struct mtd_info *mtd) config.ignore_wp = true; config.priv = mtd; + if (IS_ENABLED(NVMEM_U_BOOT_ENV) && + (of_device_is_compatible(node, "u-boot,env") || + of_device_is_compatible(node, "brcm,env"))) { + /* FIXME */ + pr_warn("Missing support for deprecated U-Boot env binding\n"); + } + mtd->nvmem = nvmem_register(&config); if (IS_ERR(mtd->nvmem)) { /* Just ignore if there is no NVMEM support in the kernel */ diff --git a/drivers/nvmem/Kconfig b/drivers/nvmem/Kconfig index da9befa3d6c4..ff99c284a582 100644 --- a/drivers/nvmem/Kconfig +++ b/drivers/nvmem/Kconfig @@ -347,18 +347,15 @@ config NVMEM_SUNXI_SID will be called nvmem_sunxi_sid. config NVMEM_U_BOOT_ENV - tristate "U-Boot environment variables support" + bool "U-Boot environment variables support" depends on OF && MTD - select CRC32 - select GENERIC_NET_UTILS + select NVMEM_LAYOUT_U_BOOT_ENV help - U-Boot stores its setup as environment variables. This driver adds - support for verifying & exporting such data. It also exposes variables - as NVMEM cells so they can be referenced by other drivers. - - Currently this drivers works only with env variables on top of MTD. + This option enables support for the old device tree binding describing + U-Boot environment variables block on top of MTD partition. - If compiled as module it will be called nvmem_u-boot-env. + Those bindings have been deprecated in favor of using a proper NVMEM + layout. config NVMEM_UNIPHIER_EFUSE tristate "UniPhier SoCs eFuse support" diff --git a/drivers/nvmem/Makefile b/drivers/nvmem/Makefile index cc23ce4ffb1f..2558752fd9a3 100644 --- a/drivers/nvmem/Makefile +++ b/drivers/nvmem/Makefile @@ -69,8 +69,6 @@ obj-$(CONFIG_NVMEM_SUNPLUS_OCOTP) += nvmem_sunplus_ocotp.o nvmem_sunplus_ocotp-y := sunplus-ocotp.o obj-$(CONFIG_NVMEM_SUNXI_SID) += nvmem_sunxi_sid.o nvmem_sunxi_sid-y := sunxi_sid.o -obj-$(CONFIG_NVMEM_U_BOOT_ENV) += nvmem_u-boot-env.o -nvmem_u-boot-env-y := u-boot-env.o obj-$(CONFIG_NVMEM_UNIPHIER_EFUSE) += nvmem-uniphier-efuse.o nvmem-uniphier-efuse-y := uniphier-efuse.o obj-$(CONFIG_NVMEM_VF610_OCOTP) += nvmem-vf610-ocotp.o diff --git a/drivers/nvmem/layouts/Kconfig b/drivers/nvmem/layouts/Kconfig index 7ff1ee1c1f05..f33999be787e 100644 --- a/drivers/nvmem/layouts/Kconfig +++ b/drivers/nvmem/layouts/Kconfig @@ -20,4 +20,14 @@ config NVMEM_LAYOUT_ONIE_TLV If unsure, say N. +config NVMEM_LAYOUT_U_BOOT_ENV + tristate "U-Boot environment variables layout support" + depends on OF + select CRC32 + select GENERIC_NET_UTILS + help + U-Boot stores its setup as environment variables. This driver adds + support for verifying & exporting such data. It also exposes variables + as NVMEM cells so they can be referenced by other drivers. + endmenu diff --git a/drivers/nvmem/layouts/Makefile b/drivers/nvmem/layouts/Makefile index 2974bd7d33ed..4940c9db0665 100644 --- a/drivers/nvmem/layouts/Makefile +++ b/drivers/nvmem/layouts/Makefile @@ -5,3 +5,4 @@ obj-$(CONFIG_NVMEM_LAYOUT_SL28_VPD) += sl28vpd.o obj-$(CONFIG_NVMEM_LAYOUT_ONIE_TLV) += onie-tlv.o +obj-$(CONFIG_NVMEM_LAYOUT_U_BOOT_ENV) += u-boot-env.o diff --git a/drivers/nvmem/u-boot-env.c b/drivers/nvmem/layouts/u-boot-env.c similarity index 67% rename from drivers/nvmem/u-boot-env.c rename to drivers/nvmem/layouts/u-boot-env.c index ee9fd9989b6e..32eae6df8d96 100644 --- a/drivers/nvmem/u-boot-env.c +++ b/drivers/nvmem/layouts/u-boot-env.c @@ -8,11 +8,9 @@ #include #include #include -#include #include #include #include -#include #include enum u_boot_env_format { @@ -25,7 +23,7 @@ struct u_boot_env { struct device *dev; enum u_boot_env_format format; - struct mtd_info *mtd; + struct nvmem_device *nvmem; /* Cells */ struct nvmem_cell_info *cells; @@ -50,28 +48,6 @@ struct u_boot_env_image_broadcom { uint8_t data[0]; } __packed; -static int u_boot_env_read(void *context, unsigned int offset, void *val, - size_t bytes) -{ - struct u_boot_env *priv = context; - struct device *dev = priv->dev; - size_t bytes_read; - int err; - - err = mtd_read(priv->mtd, offset, bytes, &bytes_read, val); - if (err && !mtd_is_bitflip(err)) { - dev_err(dev, "Failed to read from mtd: %d\n", err); - return err; - } - - if (bytes_read != bytes) { - dev_err(dev, "Failed to read %zu bytes\n", bytes); - return -EIO; - } - - return 0; -} - static int u_boot_env_read_post_process_ethaddr(void *context, const char *id, int index, unsigned int offset, void *buf, size_t bytes) { @@ -95,17 +71,25 @@ static int u_boot_env_add_cells(struct u_boot_env *priv, uint8_t *buf, size_t data_offset, size_t data_len) { struct device *dev = priv->dev; + struct device_node *layout_np; char *data = buf + data_offset; char *var, *value, *eq; + int err = 0; int idx; + layout_np = of_nvmem_layout_get_container(priv->nvmem); + if (!layout_np) + return -ENOENT; + priv->ncells = 0; for (var = data; var < data + data_len && *var; var += strlen(var) + 1) priv->ncells++; priv->cells = devm_kcalloc(dev, priv->ncells, sizeof(*priv->cells), GFP_KERNEL); - if (!priv->cells) - return -ENOMEM; + if (!priv->cells) { + err = -ENOMEM; + goto err_of_node_put; + } for (var = data, idx = 0; var < data + data_len && *var; @@ -117,11 +101,13 @@ static int u_boot_env_add_cells(struct u_boot_env *priv, uint8_t *buf, value = eq + 1; priv->cells[idx].name = devm_kstrdup(dev, var, GFP_KERNEL); - if (!priv->cells[idx].name) - return -ENOMEM; + if (!priv->cells[idx].name) { + err = -ENOMEM; + goto err_of_node_put; + } priv->cells[idx].offset = data_offset + value - data; priv->cells[idx].bytes = strlen(value); - priv->cells[idx].np = of_get_child_by_name(dev->of_node, priv->cells[idx].name); + priv->cells[idx].np = of_get_child_by_name(layout_np, priv->cells[idx].name); if (!strcmp(var, "ethaddr")) { priv->cells[idx].raw_len = strlen(value); priv->cells[idx].bytes = ETH_ALEN; @@ -132,7 +118,10 @@ static int u_boot_env_add_cells(struct u_boot_env *priv, uint8_t *buf, if (WARN_ON(idx != priv->ncells)) priv->ncells = idx; - return 0; +err_of_node_put: + of_node_put(layout_np); + + return err; } static int u_boot_env_parse(struct u_boot_env *priv) @@ -143,21 +132,25 @@ static int u_boot_env_parse(struct u_boot_env *priv) size_t crc32_offset; size_t data_offset; size_t data_len; + size_t env_size; uint32_t crc32; uint32_t calc; - size_t bytes; + ssize_t bytes; uint8_t *buf; int err; - buf = kcalloc(1, priv->mtd->size, GFP_KERNEL); + env_size = nvmem_device_size(priv->nvmem); + + buf = kcalloc(1, env_size, GFP_KERNEL); if (!buf) { err = -ENOMEM; goto err_out; } - err = mtd_read(priv->mtd, 0, priv->mtd->size, &bytes, buf); - if ((err && !mtd_is_bitflip(err)) || bytes != priv->mtd->size) { - dev_err(dev, "Failed to read from mtd: %d\n", err); + bytes = nvmem_device_read(priv->nvmem, 0, env_size, buf); + if (bytes < 0 || bytes != env_size) { + dev_err(dev, "Failed to read from NVMEM device: %zd\n", bytes); + err = -EIO; goto err_kfree; } @@ -179,8 +172,8 @@ static int u_boot_env_parse(struct u_boot_env *priv) break; } crc32 = le32_to_cpu(*(__le32 *)(buf + crc32_offset)); - crc32_data_len = priv->mtd->size - crc32_data_offset; - data_len = priv->mtd->size - data_offset; + crc32_data_len = env_size - crc32_data_offset; + data_len = env_size - data_offset; calc = crc32(~0, buf + crc32_data_offset, crc32_data_len) ^ ~0L; if (calc != crc32) { @@ -189,7 +182,7 @@ static int u_boot_env_parse(struct u_boot_env *priv) goto err_kfree; } - buf[priv->mtd->size - 1] = '\0'; + buf[env_size - 1] = '\0'; err = u_boot_env_add_cells(priv, buf, data_offset, data_len); if (err) dev_err(dev, "Failed to add cells: %d\n", err); @@ -200,14 +193,9 @@ static int u_boot_env_parse(struct u_boot_env *priv) return err; } -static int u_boot_env_probe(struct platform_device *pdev) +static int u_boot_env_layout_add_cells(struct device *dev, struct nvmem_device *nvmem, + struct nvmem_layout *layout) { - struct nvmem_config config = { - .name = "u-boot-env", - .reg_read = u_boot_env_read, - }; - struct device *dev = &pdev->dev; - struct device_node *np = dev->of_node; struct u_boot_env *priv; int err; @@ -216,28 +204,18 @@ static int u_boot_env_probe(struct platform_device *pdev) return -ENOMEM; priv->dev = dev; - priv->format = (uintptr_t)of_device_get_match_data(dev); + priv->format = (uintptr_t)nvmem_layout_get_match_data(nvmem, layout); - priv->mtd = of_get_mtd_device_by_node(np); - if (IS_ERR(priv->mtd)) { - dev_err_probe(dev, PTR_ERR(priv->mtd), "Failed to get %pOF MTD\n", np); - return PTR_ERR(priv->mtd); - } + priv->nvmem = nvmem; err = u_boot_env_parse(priv); if (err) return err; - config.dev = dev; - config.cells = priv->cells; - config.ncells = priv->ncells; - config.priv = priv; - config.size = priv->mtd->size; - - return PTR_ERR_OR_ZERO(devm_nvmem_register(dev, &config)); + return 0; } -static const struct of_device_id u_boot_env_of_match_table[] = { +static const struct of_device_id u_boot_env_layout_of_match_table[] = { { .compatible = "u-boot,env", .data = (void *)U_BOOT_FORMAT_SINGLE, }, { .compatible = "u-boot,env-redundant-bool", .data = (void *)U_BOOT_FORMAT_REDUNDANT, }, { .compatible = "u-boot,env-redundant-count", .data = (void *)U_BOOT_FORMAT_REDUNDANT, }, @@ -245,15 +223,13 @@ static const struct of_device_id u_boot_env_of_match_table[] = { {}, }; -static struct platform_driver u_boot_env_driver = { - .probe = u_boot_env_probe, - .driver = { - .name = "u_boot_env", - .of_match_table = u_boot_env_of_match_table, - }, +static struct nvmem_layout u_boot_env_layout = { + .name = "u_boot_env", + .of_match_table = u_boot_env_layout_of_match_table, + .add_cells = u_boot_env_layout_add_cells, }; -module_platform_driver(u_boot_env_driver); +module_nvmem_layout_driver(u_boot_env_layout); MODULE_AUTHOR("Rafał Miłecki"); MODULE_LICENSE("GPL"); -MODULE_DEVICE_TABLE(of, u_boot_env_of_match_table); +MODULE_DEVICE_TABLE(of, u_boot_env_layout_of_match_table);