expo: cedit: Support writing settings to a file

Support writing settings from an expo into a file in FDT format. It
consists of a single node with a two properties for each sceneitem,
one with tag ID chosen by the user and another for its text value.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2023-08-14 16:40:33 -06:00
committed by Tom Rini
parent 6e648fa781
commit 2dee81fe5f
5 changed files with 270 additions and 3 deletions

View File

@@ -10,6 +10,7 @@ Synopis
cedit load <interface> <dev[:part]> <filename>
cedit run
cedit write_fdt <dev[:part]> <filename>
Description
-----------
@@ -38,6 +39,12 @@ Runs the default configuration-editor event loop. This is very simple, just
accepting character input and moving through the objects under user control.
The implementation is at `cedit_run()`.
cedit write_fdt
~~~~~~~~~~~~~~~
Writes the current user settings to a devicetree file. For each menu item the
selected ID and its text string are written.
Example
-------
@@ -46,3 +53,15 @@ Example
=> cedit load hostfs - fred.dtb
=> cedit run
=> cedit write_fdt hostfs - settings.dtb
That results in::
/ {
cedit-values {
cpu-speed = <0x00000006>;
cpu-speed-str = "2 GHz";
power-loss = <0x0000000a>;
power-loss-str = "Always Off";
};
}