devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Marek Behún" <kabel@kernel.org>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: robh+dt@kernel.org, devicetree@vger.kernel.org,
	U-Boot Mailing List <u-boot@lists.denx.de>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	Luka Kovacic <luka.kovacic@sartura.hr>
Subject: Re: [PATCH RFC linux] dt-bindings: nvmem: Add binding for U-Boot environment NVMEM provider
Date: Thu, 14 Oct 2021 12:06:01 +0200	[thread overview]
Message-ID: <20211014120601.133e9a84@dellmb> (raw)
In-Reply-To: <629c8ba1-c924-565f-0b3c-8b625f4e5fb0@linaro.org>

On Thu, 14 Oct 2021 09:26:27 +0100
Srinivas Kandagatla <srinivas.kandagatla@linaro.org> wrote:

> On 14/10/2021 00:20, Marek Behún wrote:
> > Add device tree bindings for U-Boot environment NVMEM provider.
> > 
> > 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.
> > 
> > The environment can contain information such as device's MAC
> > address, which should be used by the ethernet controller node.
> >   
> 
> Have you looked at 
> ./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=value", separated by '\0's, for example:
  board=turris_mox\0ethaddr=00:11:22:33:44:55\0bootcmd=run distro_bootcmd\0....
Chaning lengths of values of variables, or deleting variables, moves
the data around. Integers and MAC addresses are stored as strings, and so on.

Also the mtd/partitions/nvmem-cells.yaml doesn't take into account
u-boot-env stored on non-MTD devices.

Marek

  

  reply	other threads:[~2021-10-14 10:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-13 23:20 [PATCH RFC linux] dt-bindings: nvmem: Add binding for U-Boot environment NVMEM provider Marek Behún
2021-10-14  8:26 ` Srinivas Kandagatla
2021-10-14 10:06   ` Marek Behún [this message]
2021-10-14 10:30     ` Srinivas Kandagatla
2021-10-14 10:55       ` Marek Behún
2021-10-14 11:36         ` Srinivas Kandagatla
2021-10-14 13:33 ` Tom Rini
2021-10-14 14:31 ` Rob Herring
2021-10-14 14:41 ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211014120601.133e9a84@dellmb \
    --to=kabel@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luka.kovacic@sartura.hr \
    --cc=netdev@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).