mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Cc: Trostel Alain <Alain.Trostel@haslerrail.com>
Subject: [PATCH] state: Documentation updates
Date: Tue, 15 Nov 2016 09:19:34 +0100	[thread overview]
Message-ID: <20161115081934.21737-1-s.hauer@pengutronix.de> (raw)

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

                 reply	other threads:[~2016-11-15  8:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161115081934.21737-1-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=Alain.Trostel@haslerrail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox