summaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-07-11 07:58:34 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-07-11 07:58:34 +0200
commite77acea709fb64b64ab884f5e946738d326df970 (patch)
tree5ffae8d7af61072d94c170c82e317a502d7cd681 /Documentation
parent4daa7a20c949e45ab9a93fd6ca7cb63bcebfb2ca (diff)
parente703d1ed730df92011f37692780b40fef110dd07 (diff)
downloadbarebox-e77acea709fb64b64ab884f5e946738d326df970.tar.gz
barebox-e77acea709fb64b64ab884f5e946738d326df970.tar.xz
Merge branch 'for-next/state'
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/devicetree/bindings/barebox/barebox,state.rst7
-rw-r--r--Documentation/user/state.rst46
-rw-r--r--Documentation/user/user-manual.rst1
3 files changed, 53 insertions, 1 deletions
diff --git a/Documentation/devicetree/bindings/barebox/barebox,state.rst b/Documentation/devicetree/bindings/barebox/barebox,state.rst
index d507657053..e39245f6c0 100644
--- a/Documentation/devicetree/bindings/barebox/barebox,state.rst
+++ b/Documentation/devicetree/bindings/barebox/barebox,state.rst
@@ -36,7 +36,12 @@ Optional properties:
* ``algo``: A HMAC algorithm used to detect manipulation of the data
or header, sensible values follow this pattern ``hmac(<HASH>)``,
- e.g. ``hmac(sha256)``.
+ e.g. ``hmac(sha256)``. Only used for ``raw``.
+* ``backend-stridesize``: Maximum size per copy of the data. Only important for
+ non-MTD devices
+* ``backend-storage-type``: Type of the storage. This has two options at the
+ moment. For MTD with erasing the correct type is ``circular``. For all other
+ devices and files, ``direct`` is the needed type.
Variable nodes
--------------
diff --git a/Documentation/user/state.rst b/Documentation/user/state.rst
new file mode 100644
index 0000000000..c401f105bd
--- /dev/null
+++ b/Documentation/user/state.rst
@@ -0,0 +1,46 @@
+Barebox State Framework
+=======================
+
+The state framework is build to exchange data between Barebox and Linux
+userspace using a non-volatile storage. There are several components involved.
+Barebox has a state driver to access the variables. For the Linux Userspace
+there is a userspace tool.
+
+Devicetree
+----------
+
+Currently the devicetree defines the layout of the variables and data.
+Variables are fixed size. Several types are supported, see the binding
+documentation for details.
+
+Data Formats
+------------
+
+The state data can be stored in different ways. Currently two formats are
+available, ``raw`` and ``dtb``. Both format the state data differently.
+Basically these are serializers. The raw serializer additionally supports a
+HMAC algorithm to detect manipulations.
+
+Storage Backends
+----------------
+
+The serialized data can be stored to different backends which are automatically
+selected depending on the defined backend in the devicetree. Currently two
+implementations exist, ``circular`` and ``direct``. ``circular`` writes the
+data sequentially on the backend storage device. Each save is appended until
+the storage area is full. It then erases the block and starts from offset 0.
+``circular`` is used for MTD devices with erase functionality. ``direct``
+writes the data directly to the file without erasing.
+
+For all backends multiple copies are written to handle read errors.
+
+Commands
+--------
+
+The ``state`` command can be used to store and manipulate the state. Using
+``state`` without argument lists you all available states with their name.
+``devinfo STATE_NAME`` shows you all variables and their values. ``state -s``
+stores the state.
+
+Starting Barebox will automatically load the last written state. If loading the
+state fails the defaults are used.
diff --git a/Documentation/user/user-manual.rst b/Documentation/user/user-manual.rst
index be44f0d645..5841ea625c 100644
--- a/Documentation/user/user-manual.rst
+++ b/Documentation/user/user-manual.rst
@@ -31,6 +31,7 @@ Contents:
system-setup
reset-reason
system-reset
+ state
* :ref:`search`
* :ref:`genindex`