9
0
Fork 0
Commit Graph

20 Commits

Author SHA1 Message Date
Jan Luebbe 918e1c52cd state: add support for uint8 variables
Signed-off-by: Jan Luebbe <jluebbe@debian.org>
2015-06-13 14:35:04 +02:00
Jan Luebbe fa7fc5c957 state: add some more error messages
This helps with finding out why the state cannot be loaded correctly.

Signed-off-by: Jan Luebbe <jluebbe@debian.org>
2015-06-13 14:35:04 +02:00
Marc Kleine-Budde cbded3f539 state: backend_raw: update documentation of struct state_backend_raw members
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2015-06-13 14:35:03 +02:00
Marc Kleine-Budde c028c09a4b state: backend_raw: add sanity check of data_len during load
The length of the data must fit into the remaining available space until the
next copy of the data.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2015-06-13 14:35:03 +02:00
Marc Kleine-Budde 3d809e6595 state: backend_raw: rename backend_raw_write_one() -> backend_raw_save_one()
Use a consistent naming scheme: backend_raw_save_one() is called from
backend_raw_save().

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2015-06-13 14:35:03 +02:00
Marc Kleine-Budde cba8ec9e57 state: backend_raw: factor out state_backend_raw_file_get_size() into separate function
This patch factors out the state_backend_raw_file_get_size() into a separate
function and adds some ifdefs to make this code work under Linux aswell.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2015-06-13 14:35:03 +02:00
Marc Kleine-Budde e5ec09d771 state: backend_raw: properly align write and erase size
This patch makes it easier to share the code with linux, on Linux the ease and
write size have to be aligned. Use stride (which is already aligned to erase
block size) during erase, align size_full to writesize and use it while
writing.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2015-06-13 14:35:03 +02:00
Marc Kleine-Budde 0e7a86744a state: backend_raw: rename struct state_backend_raw::step -> stride
This patch renames the member "step" of the struct state_backend_raw to
"stride" and tries to clarifies its meaning.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2015-06-13 14:35:03 +02:00
Marc Kleine-Budde 633d92e709 state: backend_raw: remove hard coded limit of two copies
Although there is the define RAW_BACKEND_COPIES, the state_backend_raw_save()
function silently assumes exactly two copies. This patch removes that assumtion
by looping over all copies, but saving the one we're read from at the end.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2015-06-13 14:35:03 +02:00
Marc Kleine-Budde a8a3c2de5b state: mtd_get_meminfo: make usage of mtd's meminfo compatible to linux
This patch makes it possible to share the code with linux.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2015-06-13 14:35:03 +02:00
Marc Kleine-Budde 6fecafad03 state: mtd_get_meminfo: open path readonly instead of readwrite
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2015-06-13 14:35:03 +02:00
Marc Kleine-Budde f25cc8d880 state: print name of property of size mismatch is detected
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2015-06-13 14:35:03 +02:00
Marc Kleine-Budde 0caa4b8075 state: print proper error message, if reg property is not found
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2015-06-13 14:35:02 +02:00
Marc Kleine-Budde 177c5b7739 state: add fixup to copy state from barebox to kernel device tree
This patch registeres a DT fixup, that copies the statate nodes from the active
to the kernel DT. The backend reference will be a phandles.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
[ukl: add call to of_unregister_fixup]
2015-06-13 14:35:02 +02:00
Marc Kleine-Budde 4e26c8c6d9 state: backend: support phandle and of_path references
This patch improves the backend property, it can be either a phandle or a
of_path. During probe() of the state driver the backend property is
dereferenced and the resulting of_path is saved in the state context. In a
later patch it will be used to generate a phandle reference to the backend
during DT fixup.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2015-05-17 20:43:40 +02:00
Marc Kleine-Budde 1c3c233a93 state: add functionality to export state description
This patch adds the functionality to export the description of the state, but
not the contents of the variables to a DT node. This will be used in a later
patch to "copy" the state description to the kernel device tree during DT
fixup.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2015-05-17 20:43:40 +02:00
Marc Kleine-Budde 02c6da8d85 state: make state_release() non static
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2015-05-17 20:43:40 +02:00
Marc Kleine-Budde 618d712f91 state: state_new_from_fdt(): remove unused function
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Applied-Upstream: next, commit:9a6dc0376add
2015-05-17 20:43:40 +02:00
Marc Kleine-Budde 55396feb25 state: state_uint32_create: use %u to print unsigned variable
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Applied-Upstream: next, commit:2ce086b8beee
2015-05-17 20:43:39 +02:00
Sascha Hauer 1487e6b9ad state: add framework for persistent state handling
This patch adds a framework to describe, access, store and restore a set of
variables. A state variable set can be fully described in a devicetree node.
This node could be part of the regular devicetree blob or it could be an extra
devicetree solely for the state. The state variable set contains variables of
different types and a place to store the variable set.

For more information see:
    Documentation/devicetree/bindings/barebox/barebox,state.rst

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-12 08:28:31 +01:00