blob: 426470a82ac283bb68019f6d3c84166c6d65309e [file] [log] [blame]
Simon Glassa0874dc2023-06-01 10:23:02 -06001.. SPDX-License-Identifier: GPL-2.0+:
2
3cedit command
4=============
5
6Synopis
7-------
8
9::
10
11 cedit load <interface> <dev[:part]> <filename>
12 cedit run
Simon Glass2dee81f2023-08-14 16:40:33 -060013 cedit write_fdt <dev[:part]> <filename>
Simon Glass472317c2023-08-14 16:40:34 -060014 cedit read_fdt <dev[:part]> <filename>
Simon Glassfc9c0e02023-08-14 16:40:35 -060015 cedit write_env [-v]
Simon Glassa0874dc2023-06-01 10:23:02 -060016
17Description
18-----------
19
20The *cedit* command is used to load a configuration-editor description and allow
21the user to interact with it.
22
23It makes use of the expo subsystem.
24
25The description is in the form of a devicetree file, as documented at
26:ref:`expo_format`.
27
Simon Glassc5aacf52023-08-14 16:40:29 -060028See :doc:`../../develop/cedit` for information about the configuration editor.
29
Simon Glassd65ccbb2023-08-14 16:40:31 -060030cedit load
31~~~~~~~~~~
32
33Loads a configuration-editor description from a file. It creates a new cedit
34structure ready for use. Initially no settings are read, so default values are
35used for each object.
36
37cedit run
38~~~~~~~~~
39
40Runs the default configuration-editor event loop. This is very simple, just
41accepting character input and moving through the objects under user control.
42The implementation is at `cedit_run()`.
43
Simon Glass2dee81f2023-08-14 16:40:33 -060044cedit write_fdt
45~~~~~~~~~~~~~~~
46
47Writes the current user settings to a devicetree file. For each menu item the
48selected ID and its text string are written.
49
Simon Glass472317c2023-08-14 16:40:34 -060050cedit read_fdt
51~~~~~~~~~~~~~~
52
53Reads the user settings from a devicetree file and updates the cedit with those
54settings.
Simon Glassd65ccbb2023-08-14 16:40:31 -060055
Simon Glassfc9c0e02023-08-14 16:40:35 -060056cedit write_env
57~~~~~~~~~~~~~~~
58
59Writes the settings to environment variables. For each menu item the selected
60ID and its text string are written, similar to:
61
62 setenv c.<name> <selected_id>
63 setenv c.<name>-str <selected_id's text string>
64
65The `-v` flag enables verbose mode, where each variable is printed before it is
66set.
67
68
Simon Glassa0874dc2023-06-01 10:23:02 -060069Example
70-------
71
72::
73
74 => cedit load hostfs - fred.dtb
75 => cedit run
Simon Glass2dee81f2023-08-14 16:40:33 -060076 => cedit write_fdt hostfs - settings.dtb
77
78That results in::
79
80 / {
81 cedit-values {
82 cpu-speed = <0x00000006>;
83 cpu-speed-str = "2 GHz";
84 power-loss = <0x0000000a>;
85 power-loss-str = "Always Off";
86 };
87 }
Simon Glass472317c2023-08-14 16:40:34 -060088
89 => cedit read_fdt hostfs - settings.dtb
Simon Glassfc9c0e02023-08-14 16:40:35 -060090
91This shows settings being stored in the environment::
92
93 => cedit write_env -v
94 => print
95 ...
96 c.cpu-speed=6
97 c.cpu-speed-str=2 GHz
98 c.power-loss=10
99 c.power-loss-str=Always Off
100 ...