expo: cedit: Support reading settings from environment vars

Add a command to read cedit settings from environment variables so that
they can be restored as part of the environment.

Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/doc/usage/cmd/cedit.rst b/doc/usage/cmd/cedit.rst
index 426470a..1f92b73 100644
--- a/doc/usage/cmd/cedit.rst
+++ b/doc/usage/cmd/cedit.rst
@@ -13,6 +13,7 @@
     cedit write_fdt <dev[:part]> <filename>
     cedit read_fdt <dev[:part]> <filename>
     cedit write_env [-v]
+    cedit read_env [-v]
 
 Description
 -----------
@@ -53,6 +54,16 @@
 Reads the user settings from a devicetree file and updates the cedit with those
 settings.
 
+cedit read_env
+~~~~~~~~~~~~~~
+
+Reads the settings from the environment variables. For each menu item `<name>`,
+cedit looks for a variable called `c.<name>` with the ID of the selected menu
+item.
+
+The `-v` flag enables verbose mode, where each variable is printed after it is
+read.
+
 cedit write_env
 ~~~~~~~~~~~~~~~
 
@@ -91,6 +102,10 @@
 This shows settings being stored in the environment::
 
     => cedit write_env -v
+    c.cpu-speed=7
+    c.cpu-speed-str=2.5 GHz
+    c.power-loss=12
+    c.power-loss-str=Memory
     => print
     ...
     c.cpu-speed=6
@@ -98,3 +113,7 @@
     c.power-loss=10
     c.power-loss-str=Always Off
     ...
+
+    => cedit read_env -v
+    c.cpu-speed=7
+    c.power-loss=12