Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4328620pxb; Thu, 14 Oct 2021 03:10:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6sHe8MDvaxKTDJy0da8xMWkNCO9NTh9hln/wjc8/c+0t+KMB9uVOPhymsYSvzjI/lTQw1 X-Received: by 2002:a05:6402:14cc:: with SMTP id f12mr7559990edx.242.1634206232797; Thu, 14 Oct 2021 03:10:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634206232; cv=none; d=google.com; s=arc-20160816; b=reRBNYO7zyUBap+p7rpdJRC5p7GyQ2V7069sUCmgKf4d9WsQnElNFpzD5xYpp5O3fi J/Hot2Y/F6ePedsw+T0szxyvE1lY/J2LtDy2XFUX71NWGgvaMGwtuhMhi6AYF6PAmrpU XW/m8+xwCdllqCK+b02tMVIXR2lxWjWu60Vytv+MZhqV39/JfqQ/L2T8C0rpB5fFKvhf 4WEnlSfQst7BEvT3YvlP0NnrnQW/bYBWg10i1iL2o0CnEIhsnfFvi72QR3JjTusza1q3 +radAzpzPfmRr617awLuxxwFq2lr5STXR2IofAGVOu0VUHeLo/MXaS2FDXEOOZ/ud2zf kn7w== 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:subject:cc:to:from:date :dkim-signature; bh=k4mWMZX/3PsbdFxQz+H52ILtHUb+3AYrk1WiLPcKoN4=; b=YbH2av4mn2YIOB2128XKbku1lA/4wSu62c4/bZkm0h3ikDLpUP9JD3XCeF/cuNQy4a Fkhu0p2Z7EBE4vjP5fa1LQGNLn3eoXelZ13R5IDqIY5efB/fEpzs0PRWXfReYSVoD80t ko9m/KrScaRZX99NpFMsYRvDTR2FgvBDiXiFaKXPAISZC2fQOVZOnXzspxpLNA57iuxE WKw0vDmowm9+Wt4MP/qFMxL9LX4sVxYDBvqPOSGVjBEAAEHbII9OMQur+lzTRTtpyUHz CRdx1eIBm+DqB8nZZkzOQ9lj8v2mk7f+oxz0M1yjkaq+m6NJQ6CLMiYAH4R2a3WKy+rO 0TbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m52fPtgt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ce14si3040345ejb.147.2021.10.14.03.10.09; Thu, 14 Oct 2021 03:10:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m52fPtgt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230198AbhJNKIR (ORCPT + 99 others); Thu, 14 Oct 2021 06:08:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:47382 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230179AbhJNKIJ (ORCPT ); Thu, 14 Oct 2021 06:08:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 26B856101E; Thu, 14 Oct 2021 10:06:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634205965; bh=/DwZK5Nqwyga0GMSWPMyT43TU7YWs7C3bgxh4CwgbEw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=m52fPtgtgnew0Aq0pgkU6z7LidydJ+7r294XdHXWQlpClh0dni+lhC7ORhqNG57Dn zqV8yIdYjoknBtZ/zrLVqm84podfu/tth4b35shx3G78BHpb5hkGtrYpz8y2yc3Hlu C0An/rlAg9obXIa7HhdO9yzxVARlgtnOBd4rbvQU++Oit8HpuehM1nleW5Qmfkl9oV 0N0B/quQC4RHz6Fz7aUsb6WEsoTp0dWNvmty29qTjG2b7npsUR990bde5eBv74x7Bk 3CUOYNKHFcj55v25yv+NVhTVgu0z8YhpLh6O8ZXm7ZZfDlzygq/0romtNUHRcGHgdd /jdO/m+Axe2nw== Date: Thu, 14 Oct 2021 12:06:01 +0200 From: Marek =?UTF-8?B?QmVow7pu?= To: Srinivas Kandagatla Cc: robh+dt@kernel.org, devicetree@vger.kernel.org, U-Boot Mailing List , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Luka Kovacic Subject: Re: [PATCH RFC linux] dt-bindings: nvmem: Add binding for U-Boot environment NVMEM provider Message-ID: <20211014120601.133e9a84@dellmb> In-Reply-To: <629c8ba1-c924-565f-0b3c-8b625f4e5fb0@linaro.org> References: <20211013232048.16559-1-kabel@kernel.org> <629c8ba1-c924-565f-0b3c-8b625f4e5fb0@linaro.org> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 14 Oct 2021 09:26:27 +0100 Srinivas Kandagatla wrote: > On 14/10/2021 00:20, Marek Beh=C3=BAn wrote: > > Add device tree bindings for U-Boot environment NVMEM provider. > >=20 > > U-Boot environment can be stored at a specific offset of a MTD > > device, EEPROM, MMC, NAND or SATA device, on an UBI volume, or in a > > file on a filesystem. > >=20 > > The environment can contain information such as device's MAC > > address, which should be used by the ethernet controller node. > > =20 >=20 > Have you looked at=20 > ./Documentation/devicetree/bindings/mtd/partitions/nvmem-cells.yaml ? Hello srini, yes, I have. What about it? :) That binding won't work for u-boot-env, because the data are stored in a different way. A cell does not have a constant predetermined offset on the MTD. The variables are stored as a sequence of values of format "name=3Dvalue", separated by '\0's, for example: board=3Dturris_mox\0ethaddr=3D00:11:22:33:44:55\0bootcmd=3Drun distro_boo= tcmd\0.... Chaning lengths of values of variables, or deleting variables, moves the data around. Integers and MAC addresses are stored as strings, and so o= n. Also the mtd/partitions/nvmem-cells.yaml doesn't take into account u-boot-env stored on non-MTD devices. Marek =20