mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] state: Documentation updates
@ 2016-11-15  8:19 Sascha Hauer
  0 siblings, 0 replies; only message in thread
From: Sascha Hauer @ 2016-11-15  8:19 UTC (permalink / raw)
  To: Barebox List; +Cc: Trostel Alain

From: Trostel Alain <Alain.Trostel@haslerrail.com>

Some improvements for the state binding documentation. These come
from the conversation with Trostel Alain who tried to use the
state framework and stumbled upon these things missing. Patch
originally by Alain, thanks.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 .../devicetree/bindings/barebox/barebox,state.rst  | 39 +++++++++++++++++++---
 1 file changed, 35 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/barebox/barebox,state.rst b/Documentation/devicetree/bindings/barebox/barebox,state.rst
index 438cc43..7b9d1bb 100644
--- a/Documentation/devicetree/bindings/barebox/barebox,state.rst
+++ b/Documentation/devicetree/bindings/barebox/barebox,state.rst
@@ -43,6 +43,16 @@ Optional properties:
   moment. For MTD with erasing the correct type is ``circular``. For all other
   devices and files, ``direct`` is the needed type.
 
+Configuration
+-------------
+
+The following config options must be enabled when building the barebox image
+to have full support of the barebox state framework:
+
+* CONFIG_STATE
+* CONFIG_STATE_DRV
+* CONFIG_CMD_STATE
+
 Variable nodes
 --------------
 
@@ -71,13 +81,18 @@ Optional properties:
   storage. For ``enum32`` values it is an integer representing an
   offset into the names array.
 
-Example::
+The following examples have to be configured in the board-specific device
+tree files (\*.dts) within barebox.
 
-  state: state@0 {
+State example::
+
+  state: state {
   	magic = <0x27031977>;
   	compatible = "barebox,state";
   	backend-type = "raw";
-  	backend = &eeprom, "partname:state";
+  	backend = &part_state;
+  	#address-cells = <1>;
+  	#size-cells = <1>;
 
   	foo {
 		reg = <0x00 0x4>;
@@ -93,6 +108,13 @@ Example::
   	};
   };
 
+Partition example::
+
+  part_state: partition@1C0000 {
+  	label = "state";
+  	reg = <0x1C0000 0x60000>;
+  };
+
 Variable Types
 --------------
 
@@ -139,4 +161,13 @@ be accessed like normal shell variables. The ``state`` command is used
 to save/restore a state to the backend device.
 
 After initializing the variable can be accessed with ``$state.foo``.
-``state -s`` stores the state to eeprom.
+``state -s`` stores the state persistently.
+
+From Linux
+----------
+
+It exists a tool called «barebox-state» to access these state variables
+from the Linux user-space. The mentioned tool is available as GIT project
+under the following location::
+
+  git://git.pengutronix.de/git/tools/dt-utils.git
-- 
2.10.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-11-15  8:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-15  8:19 [PATCH] state: Documentation updates Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox