Simon Glass | a0874dc | 2023-06-01 10:23:02 -0600 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+: |
| 2 | |
| 3 | cedit command |
| 4 | ============= |
| 5 | |
| 6 | Synopis |
| 7 | ------- |
| 8 | |
| 9 | :: |
| 10 | |
| 11 | cedit load <interface> <dev[:part]> <filename> |
| 12 | cedit run |
Simon Glass | 2dee81f | 2023-08-14 16:40:33 -0600 | [diff] [blame] | 13 | cedit write_fdt <dev[:part]> <filename> |
Simon Glass | 472317c | 2023-08-14 16:40:34 -0600 | [diff] [blame] | 14 | cedit read_fdt <dev[:part]> <filename> |
Simon Glass | fc9c0e0 | 2023-08-14 16:40:35 -0600 | [diff] [blame^] | 15 | cedit write_env [-v] |
Simon Glass | a0874dc | 2023-06-01 10:23:02 -0600 | [diff] [blame] | 16 | |
| 17 | Description |
| 18 | ----------- |
| 19 | |
| 20 | The *cedit* command is used to load a configuration-editor description and allow |
| 21 | the user to interact with it. |
| 22 | |
| 23 | It makes use of the expo subsystem. |
| 24 | |
| 25 | The description is in the form of a devicetree file, as documented at |
| 26 | :ref:`expo_format`. |
| 27 | |
Simon Glass | c5aacf5 | 2023-08-14 16:40:29 -0600 | [diff] [blame] | 28 | See :doc:`../../develop/cedit` for information about the configuration editor. |
| 29 | |
Simon Glass | d65ccbb | 2023-08-14 16:40:31 -0600 | [diff] [blame] | 30 | cedit load |
| 31 | ~~~~~~~~~~ |
| 32 | |
| 33 | Loads a configuration-editor description from a file. It creates a new cedit |
| 34 | structure ready for use. Initially no settings are read, so default values are |
| 35 | used for each object. |
| 36 | |
| 37 | cedit run |
| 38 | ~~~~~~~~~ |
| 39 | |
| 40 | Runs the default configuration-editor event loop. This is very simple, just |
| 41 | accepting character input and moving through the objects under user control. |
| 42 | The implementation is at `cedit_run()`. |
| 43 | |
Simon Glass | 2dee81f | 2023-08-14 16:40:33 -0600 | [diff] [blame] | 44 | cedit write_fdt |
| 45 | ~~~~~~~~~~~~~~~ |
| 46 | |
| 47 | Writes the current user settings to a devicetree file. For each menu item the |
| 48 | selected ID and its text string are written. |
| 49 | |
Simon Glass | 472317c | 2023-08-14 16:40:34 -0600 | [diff] [blame] | 50 | cedit read_fdt |
| 51 | ~~~~~~~~~~~~~~ |
| 52 | |
| 53 | Reads the user settings from a devicetree file and updates the cedit with those |
| 54 | settings. |
Simon Glass | d65ccbb | 2023-08-14 16:40:31 -0600 | [diff] [blame] | 55 | |
Simon Glass | fc9c0e0 | 2023-08-14 16:40:35 -0600 | [diff] [blame^] | 56 | cedit write_env |
| 57 | ~~~~~~~~~~~~~~~ |
| 58 | |
| 59 | Writes the settings to environment variables. For each menu item the selected |
| 60 | ID 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 | |
| 65 | The `-v` flag enables verbose mode, where each variable is printed before it is |
| 66 | set. |
| 67 | |
| 68 | |
Simon Glass | a0874dc | 2023-06-01 10:23:02 -0600 | [diff] [blame] | 69 | Example |
| 70 | ------- |
| 71 | |
| 72 | :: |
| 73 | |
| 74 | => cedit load hostfs - fred.dtb |
| 75 | => cedit run |
Simon Glass | 2dee81f | 2023-08-14 16:40:33 -0600 | [diff] [blame] | 76 | => cedit write_fdt hostfs - settings.dtb |
| 77 | |
| 78 | That 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 Glass | 472317c | 2023-08-14 16:40:34 -0600 | [diff] [blame] | 88 | |
| 89 | => cedit read_fdt hostfs - settings.dtb |
Simon Glass | fc9c0e0 | 2023-08-14 16:40:35 -0600 | [diff] [blame^] | 90 | |
| 91 | This 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 | ... |