All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
To: u-boot@lists.denx.de
Subject: [PATCH v2 0/2] allow environment to be updated from dtb
Date: Wed, 21 Apr 2021 11:06:53 +0200	[thread overview]
Message-ID: <20210421090655.1458746-1-rasmus.villemoes@prevas.dk> (raw)
In-Reply-To: <20210413224345.2692591-1-rasmus.villemoes@prevas.dk>

Patch 1 adds a config option for updating the environment, after it
has been loaded from its persistent location, with a set of key/value
pairs from a node in the control DTB.

This is useful to create a few different images based on the same
U-Boot binary, e.g. one for normal use, one for development and one
for bootstrapping the board. It's also useful when SPL loads U-Boot
from a FIT image and decides between multiple possible control DTBs;
those control DTBs can then contain tweaks of the environment suitable
for that particular board variant.

Once those tweaks have been applied, one may no longer wish for the
DTB settings to be applied on subsequent boots; this is easily
achieved by clearing the fdt_env_path variable and saving the
environment.

In a previous version, I used a single property whose value was
expected to have the form "foo=1\0bar=234\0". But using a node and
individual property/value pairs is both more readable and more
flexible - for example, the individual control dtbs can easily be
prepared from each other using the fdtput utility, or with suitable
includes in the .dts. Combining fragments in that way is not possible
with a single property.

Patch 2 simply adds a small test case to the sandbox.

v2: Add Simon's R-b tags, use livetree/ofnode API.

Rasmus Villemoes (2):
  env: allow environment to be amended from control dtb
  sandbox: add test of CONFIG_ENV_IMPORT_FDT

 arch/sandbox/dts/test.dts   |  7 +++++++
 common/board_r.c            |  2 ++
 configs/sandbox64_defconfig |  1 +
 configs/sandbox_defconfig   |  1 +
 env/Kconfig                 | 18 ++++++++++++++++++
 env/common.c                | 30 ++++++++++++++++++++++++++++++
 include/env.h               | 15 +++++++++++++++
 include/env_default.h       |  3 +++
 test/env/Makefile           |  1 +
 test/env/fdt.c              | 20 ++++++++++++++++++++
 10 files changed, 98 insertions(+)
 create mode 100644 test/env/fdt.c

-- 
2.29.2

  parent reply	other threads:[~2021-04-21  9:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-13 22:43 [PATCH 0/2] allow environment to be updated from dtb Rasmus Villemoes
2021-04-13 22:43 ` [PATCH 1/2] env: allow environment to be amended from control dtb Rasmus Villemoes
2021-04-21  7:14   ` Simon Glass
2021-04-21  8:02     ` Rasmus Villemoes
2021-04-21  8:28       ` Rasmus Villemoes
2021-04-13 22:43 ` [PATCH 2/2] sandbox: add test of CONFIG_ENV_IMPORT_FDT Rasmus Villemoes
2021-04-21  7:14   ` Simon Glass
2021-04-21  9:06 ` Rasmus Villemoes [this message]
2021-04-21  9:06   ` [PATCH v2 1/2] env: allow environment to be amended from control dtb Rasmus Villemoes
2021-04-21 16:16     ` Joe Hershberger
2021-05-06 15:03     ` Tom Rini
2021-04-21  9:06   ` [PATCH v2 2/2] sandbox: add test of CONFIG_ENV_IMPORT_FDT Rasmus Villemoes
2021-04-21 16:17     ` Joe Hershberger
2021-05-06 15:03     ` Tom Rini

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=20210421090655.1458746-1-rasmus.villemoes@prevas.dk \
    --to=rasmus.villemoes@prevas.dk \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.