All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] allow environment to be updated from dtb
@ 2021-04-13 22:43 Rasmus Villemoes
  2021-04-13 22:43 ` [PATCH 1/2] env: allow environment to be amended from control dtb Rasmus Villemoes
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Rasmus Villemoes @ 2021-04-13 22:43 UTC (permalink / raw)
  To: u-boot

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.

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                | 23 +++++++++++++++++++++++
 include/env.h               | 15 +++++++++++++++
 include/env_default.h       |  3 +++
 test/env/Makefile           |  1 +
 test/env/fdt.c              | 20 ++++++++++++++++++++
 10 files changed, 91 insertions(+)
 create mode 100644 test/env/fdt.c

-- 
2.29.2

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-05-06 15:03 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH v2 0/2] allow environment to be updated from dtb Rasmus Villemoes
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

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.