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 | a0874dc | 2023-06-01 10:23:02 -0600 | [diff] [blame] | 15 | |
| 16 | Description |
| 17 | ----------- |
| 18 | |
| 19 | The *cedit* command is used to load a configuration-editor description and allow |
| 20 | the user to interact with it. |
| 21 | |
| 22 | It makes use of the expo subsystem. |
| 23 | |
| 24 | The description is in the form of a devicetree file, as documented at |
| 25 | :ref:`expo_format`. |
| 26 | |
Simon Glass | c5aacf5 | 2023-08-14 16:40:29 -0600 | [diff] [blame] | 27 | See :doc:`../../develop/cedit` for information about the configuration editor. |
| 28 | |
Simon Glass | d65ccbb | 2023-08-14 16:40:31 -0600 | [diff] [blame] | 29 | cedit load |
| 30 | ~~~~~~~~~~ |
| 31 | |
| 32 | Loads a configuration-editor description from a file. It creates a new cedit |
| 33 | structure ready for use. Initially no settings are read, so default values are |
| 34 | used for each object. |
| 35 | |
| 36 | cedit run |
| 37 | ~~~~~~~~~ |
| 38 | |
| 39 | Runs the default configuration-editor event loop. This is very simple, just |
| 40 | accepting character input and moving through the objects under user control. |
| 41 | The implementation is at `cedit_run()`. |
| 42 | |
Simon Glass | 2dee81f | 2023-08-14 16:40:33 -0600 | [diff] [blame] | 43 | cedit write_fdt |
| 44 | ~~~~~~~~~~~~~~~ |
| 45 | |
| 46 | Writes the current user settings to a devicetree file. For each menu item the |
| 47 | selected ID and its text string are written. |
| 48 | |
Simon Glass | 472317c | 2023-08-14 16:40:34 -0600 | [diff] [blame^] | 49 | cedit read_fdt |
| 50 | ~~~~~~~~~~~~~~ |
| 51 | |
| 52 | Reads the user settings from a devicetree file and updates the cedit with those |
| 53 | settings. |
Simon Glass | d65ccbb | 2023-08-14 16:40:31 -0600 | [diff] [blame] | 54 | |
Simon Glass | a0874dc | 2023-06-01 10:23:02 -0600 | [diff] [blame] | 55 | Example |
| 56 | ------- |
| 57 | |
| 58 | :: |
| 59 | |
| 60 | => cedit load hostfs - fred.dtb |
| 61 | => cedit run |
Simon Glass | 2dee81f | 2023-08-14 16:40:33 -0600 | [diff] [blame] | 62 | => cedit write_fdt hostfs - settings.dtb |
| 63 | |
| 64 | That results in:: |
| 65 | |
| 66 | / { |
| 67 | cedit-values { |
| 68 | cpu-speed = <0x00000006>; |
| 69 | cpu-speed-str = "2 GHz"; |
| 70 | power-loss = <0x0000000a>; |
| 71 | power-loss-str = "Always Off"; |
| 72 | }; |
| 73 | } |
Simon Glass | 472317c | 2023-08-14 16:40:34 -0600 | [diff] [blame^] | 74 | |
| 75 | => cedit read_fdt hostfs - settings.dtb |