public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH v2 0/3] fdt: introduce "fsapply" command
@ 2023-02-10 11:02 Andre Przywara
  2023-02-10 11:02 ` [PATCH v2 1/3] cmd: fdt: move: Use map_sysmem to convert pointers Andre Przywara
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Andre Przywara @ 2023-02-10 11:02 UTC (permalink / raw)
  To: Simon Glass, Tom Rini; +Cc: Heinrich Schuchardt, u-boot

Hi,

updating the series, basically just changing the name of the command
to "fsapply", as suggested by Simon.
The first two patches are still the same fixes, Simon said he merged
them to u-boot-dm in July already, but I don't see them there or in
master.
I am still looking into a test for fsapply, but wanted to get at least
the fixes merged now, hence this new version.

===============================
This is an attempt to simplify the usage of user provided devicetree
overlays. The idea is to let the user drop all desired .dtbo files into
one directory (for instance on the EFI system partition), and U-Boot just
applies all of them, with generic commands:
=> fdt move $fdtcontroladdr $fdt_addr_r
=> fdt resize
=> fdt fsapply mmc 0:1 overlays/

This would pick all files ending in .dtbo from the /overlays directory
found on the first partition of the first MMC device. Ideally the device
type, number and partition name would be provided by the distroboot
scripting, so it checks the media it scans for boot scripts anyways.

Patch 1 fixes the "fdt move" operation in the sandbox. Since hostfs does
not support fs_opendir/fs_readdir, which fsapply relies on, this cannot
be tested in the sandbox, but I figured this bug is worth fixing anyway.
Patch 2 avoids a redundant call to "fdt addr", if we just want to move
(actually copy) the DTB. This is needed when we want to build on the
control DT, since this might live in an area where it cannot be changed
or grow enough.
Patch 3 then implements the main attraction: It uses the U-Boot
filesystem API to fs_readdir() the given directory, reads all files
ending in ".dtbo" into memory, and tries to apply them to the working DT.

Please let me know what you think of the idea in general and the
implementation in particular.
The first two patches are actually bug fixes, and should be applied
regardless.

Cheers,
Andre

Changelog v1 ... v2:
- add Simon's tags
- change command name from "apply-all" to "fsapply"


Andre Przywara (3):
  cmd: fdt: move: Use map_sysmem to convert pointers
  cmd: fdt: allow standalone "fdt move"
  fdt: introduce fsapply command

 cmd/fdt.c | 121 +++++++++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 107 insertions(+), 14 deletions(-)

-- 
2.25.1


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

end of thread, other threads:[~2023-02-16 16:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-10 11:02 [PATCH v2 0/3] fdt: introduce "fsapply" command Andre Przywara
2023-02-10 11:02 ` [PATCH v2 1/3] cmd: fdt: move: Use map_sysmem to convert pointers Andre Przywara
2023-02-13  0:34   ` Simon Glass
2023-02-10 11:02 ` [PATCH v2 2/3] cmd: fdt: allow standalone "fdt move" Andre Przywara
2023-02-10 11:34   ` Lothar Waßmann
2023-02-13  0:34     ` Simon Glass
2023-02-10 11:02 ` [PATCH v2 3/3] fdt: introduce fsapply command Andre Przywara
2023-02-10 11:32   ` Lothar Waßmann
2023-02-10 16:05     ` Simon Glass
2023-02-13 17:26       ` Andre Przywara
2023-02-13 18:12         ` Simon Glass
2023-02-16 16:13 ` [PATCH v2 0/3] fdt: introduce "fsapply" command Heinrich Schuchardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox