From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8000C433EF for ; Thu, 14 Oct 2021 10:06:14 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DEB026101E for ; Thu, 14 Oct 2021 10:06:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DEB026101E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6C16583626; Thu, 14 Oct 2021 12:06:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="m52fPtgt"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E8DBD8362A; Thu, 14 Oct 2021 12:06:09 +0200 (CEST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 28B4083173 for ; Thu, 14 Oct 2021 12:06:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org 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 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean 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