summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* barebox-state: get devicetree from filev2019.01.0/topic/efi-stateSteffen Trumtrar2019-10-213-10/+36
| | | | | | | | | | | Adds a -i/--input argument to barebox-state to allow passing a devicetree as a file instead of using it from the system. This can be used for example on systems that do not use device trees (such as x86) but where we want to use a dtb blob for describing the state storage and format. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
* libdt: support finding devices by partuuidSteffen Trumtrar2019-10-211-0/+12
| | | | | | | | | | | | | | | | | | | This allows specifying partitions in devicetree that are actually not described in the devicetree to allow referencing them: partitions { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; state_part: state { partuuid = "21367da7-c51f-499f-9aad-e1f366992365"; }; }; Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* Release 2019.01.0v2019.01.0Roland Hieber2019-01-283-3/+45
| | | | Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* fix leaks of memory returned by read_file() callsEnrico Jorns2019-01-102-0/+2
| | | | | | Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Reviewed-by: Michael Olbrich <mol@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* Introduce dev_set_name()Ulrich Ölmann2019-01-072-1/+27
| | | | | | | | | | | | | | | | | | | This ports the following barebox commit: | commit 05683764a77ff91419cabe0c26e537589b8a28ff | Author: Andrey Smirnov <andrew.smirnov@gmail.com> | Date: Tue Oct 16 12:15:40 2018 -0700 | | drivers: Introduce dev_set_name() | | Introduce dev_set_name() in order to hide implementation details of | setting device's name so it'd be easier to change it. | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: fix documentation of state_new_from_node()Ulrich Ölmann2019-01-071-0/+1
| | | | | | | | | | | | | | | | | | | This ports the following barebox commit: | commit 63b9aad03e2c0d64154426e24eb4e3b2b6dfe780 | Author: Ulrich Ölmann <u.oelmann@pengutronix.de> | Date: Fri Oct 12 08:48:48 2018 +0200 | | state: fix documentation of state_new_from_node() | | Commit a66a8d79871c ("state: remove unused arguments from | state_new_from_node()") removed a little bit too much. | | Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* backend_bucket_circular: remove unused variablesUlrich Ölmann2019-01-071-2/+0
| | | | | | | | | | | | | | | | | | | | This ports the following barebox commit: | commit 0d0a472821b28aa999fb8e71ff949a87cb4f27b0 | Author: Ulrich Ölmann <u.oelmann@pengutronix.de> | Date: Wed Oct 10 14:23:40 2018 +0200 | | state: backend_bucket_circular: remove unused variables | | This has been forgotten in commit 9d6d91931afb ("state: Remove -EUCLEAN | check | from userspace tool"). | | Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: fix typoUlrich Ölmann2019-01-071-1/+1
| | | | | | | | | | | | | | | | This ports the following barebox commit: | commit f6a47cc3de70b6bc8a79b0b6dc120b2442c472c2 | Author: Ulrich Ölmann <u.oelmann@pengutronix.de> | Date: Mon Oct 8 20:02:06 2018 +0200 | | common: state: fix typo | | Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: backend_bucket_circular: fix memory leakUlrich Ölmann2019-01-071-4/+7
| | | | | | | | | | | | | | | | This ports the following barebox commit: | commit 87a0df348347932a69c260d57184197a2cc24a58 | Author: Ulrich Ölmann <u.oelmann@pengutronix.de> | Date: Mon Oct 8 19:45:23 2018 +0200 | | state: backend_bucket_circular: fix memory leak | | Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: backend_bucket_circular: fix for non power of 2 writesizeUlrich Ölmann2019-01-071-2/+6
| | | | | | | | | | | | | | | | | | | | | This includes sys/param.h to have the definition of roundup() and ports the following barebox commit: | commit f70141447cf1aedd77a40d8bf76657927bb73840 | Author: Ladislav Michl <ladis@linux-mips.org> | Date: Tue Sep 25 12:58:45 2018 +0200 | | state: backend_bucket_circular: fix for non power of 2 writesize | | backend_bucket_circular currently assumes writesize is power of 2, | which makes it fail on dataflash devices, where this assumption | is false. | | Signed-off-by: Ladislav Michl <ladis@linux-mips.org> | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: Add property to protect existing dataUlrich Ölmann2019-01-074-4/+27
| | | | | | | | | | | | | | | | | | | | | | This ports the following barebox commit: | commit 67c1c0853fa06bcbc1725e93b6ad9942e80a1e56 | Author: Daniel Schultz <d.schultz@phytec.de> | Date: Thu Apr 12 11:13:01 2018 +0200 | | common: state: Add property to protect existing data | | After an update to a newer barebox version with an enabled state | framework, existing data in storage memories could be overwritten. | | Add a new property to check in front of every write task, if the meta | magic field only contains the magic number, zeros or ones. | | Signed-off-by: Daniel Schultz <d.schultz@phytec.de> | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: find backend node with its reproducible nameUlrich Ölmann2019-01-073-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | This ports the following barebox commit and removes the now no longer used noop definition of of_find_node_by_devpath() that was introduced in commit "state: find device node from device path, not from device node path": | commit 1eddb0d3821d7bb368fa6b092b980b89fc47db28 | Author: Sascha Hauer <s.hauer@pengutronix.de> | Date: Tue Feb 20 12:41:26 2018 +0100 | | state: find backend node with its reproducible name | | When fixing up the kernels state nodes we depended on the full node path | of the input device tree. This does not work when the kernel device tree | has different names. This has happened lately when the i.MX6 device | trees got their leading zeroes removed from the node names. | | Use of_find_node_by_reproducible_name() to find the node corresponding | to the storage backend node in the kernel device tree. | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: remove unused arguments from state_new_from_node()Ulrich Ölmann2019-01-074-53/+25
| | | | | | | | | | | | | | | | | | | | | | | | Other than in barebox the offset and size of a state's backend device do not necessarily equal zero in Linux userspace (EEPROMs & block devices). So we have to consider that and differentiate between both usecases here while porting the following barebox commit and removing the now no longer used noop definition of of_find_path_by_node(): | commit a66a8d79871c3763cd488cd5e785415a5dbc36de | Author: Sascha Hauer <s.hauer@pengutronix.de> | Date: Tue Feb 20 12:21:00 2018 +0100 | | state: remove unused arguments from state_new_from_node() | | state_new_from_node() has arguments describing the backend path. These | are never used in barebox, the backend path is always derived from the | device nodes backend description. Remove these arguments. | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> [rhi: fixed tabs vs. spaces indentation in state_new_from_node()] Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: Add 'init_from_defaults' parameterUlrich Ölmann2019-01-072-0/+9
| | | | | | | | | | | | | | | | | | This ports the following barebox commit: | commit 6a77d1cfb6596ed0a269ab52028f7e4bb22c99e2 | Author: Sascha Hauer <s.hauer@pengutronix.de> | Date: Wed May 4 12:01:05 2016 +0200 | | state: Add 'init_from_defaults' parameter | | The init_from_defaults parameter allows to detect if a state has been | initialized from default values, i.e. state_load failed. | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: refuse to set dirty parameter via setenvUlrich Ölmann2019-01-071-1/+6
| | | | | | | | | | | | | | | | | This ports the following barebox commit: | commit 6d3e10c67822816d3ff2021dcfba5e7a83906586 | Author: Sascha Hauer <s.hauer@pengutronix.de> | Date: Wed May 4 11:59:59 2016 +0200 | | state: refuse to set dirty parameter via setenv | | The dirty parameter is readonly, so refuse to set it. | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: Add function to read state MACUlrich Ölmann2019-01-072-0/+23
| | | | | | | | | | | | | | | | | | | This ports the following barebox commit: | commit 09f15cdb3817902897544296cc90d1eeff4a9487 | Author: Daniel Schultz <d.schultz@phytec.de> | Date: Fri Nov 3 11:48:28 2017 +0100 | | common: state: Add function to read state MAC | | This API function allows to receive a copy of a MAC address from | variables in a state. | | Signed-off-by: Daniel Schultz <d.schultz@phytec.de> | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: refactor variable typeUlrich Ölmann2019-01-074-36/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This ports the following barebox commits and adjusts the handling of type information of state variables in barebox-state: | commit 7b3d284f4bad78d61e9f5d32ec5aa1efc19ce733 | Author: Sascha Hauer <s.hauer@pengutronix.de> | Date: Mon Apr 3 22:51:58 2017 +0200 | | state: remove unused variable type | | enum state_variable_type is never used. Remove it. | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> | commit 7126dffd0be98a0f4c80bc13bc7df601526f056f | Author: Daniel Schultz <d.schultz@phytec.de> | Date: Fri Nov 3 11:48:26 2017 +0100 | | common: state: Add variable_type to state_variable | | Add a pointer in state_variable to the corresponding variable_type array | element. | | Signed-off-by: Daniel Schultz <d.schultz@phytec.de> | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> | commit dc74265d2ac074a18609d51bad1fdbd2bbcdd608 | Author: Daniel Schultz <d.schultz@phytec.de> | Date: Fri Nov 3 11:48:27 2017 +0100 | | common: state: Add variable type as enum | | The variable_type struct holds a name of its type. Checking the type of | a variable with this string needs much resources. | | This patch introduce a enum of the variable type for better type | checking. | | Signed-off-by: Daniel Schultz <d.schultz@phytec.de> | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> [rhi: fixed function parameter alignment in common/state/state_variables.c, and submitted those changes as patches for barebox: https://www.mail-archive.com/barebox@lists.infradead.org/msg29427.html https://www.mail-archive.com/barebox@lists.infradead.org/msg29462.html ] Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: remove checks for xzalloc() returning NULLUlrich Ölmann2019-01-073-8/+0
| | | | | | | | | | | | | | | | | | This ports the following barebox commit: | commit 25e67cbb2fce8690bcde07598ad4998aad475f13 | Author: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | Date: Mon Sep 25 12:02:35 2017 +0200 | | remove checks for xzalloc() returning NULL | | xzalloc() either returns memory or panics, so checking for NULL is useless. | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* libdt: xzalloc: die on failureRoland Hieber2019-01-071-1/+9
| | | | | | | Behave like the well-known kernel variant, so existing code that doesn't check xzallocs return value can be ported easier. Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: don't use uninitialized variableUlrich Ölmann2019-01-071-1/+1
| | | | | | | | | | | | | | | | | | This ports the following barebox commit: | commit b67b8d92d770daf90f8efcfdfaa249bf048b53fa | Author: Juergen Borleis <jbe@pengutronix.de> | Date: Thu Aug 17 11:32:33 2017 +0200 | | state: don't use uninitialized variable | | Printing 'ret' makes no sense. | | Signed-off-by: Juergen Borleis <jbe@pengutronix.de> | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: use the given backend storage type nameUlrich Ölmann2019-01-071-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This ports the following barebox commit: | commit 84ec1554e2a7b80202c01d6e04201bd5ea986cb7 | Author: Juergen Borleis <jbe@pengutronix.de> | Date: Thu Aug 17 11:32:32 2017 +0200 | | state: use the given backend storage type name | | Change 119f92b27e131a0cb506fe8d8bffe8010fb14a3d already tried to fix it, but | forgets the 'direct' usecase. | | The 'backend-storage-type' node is optional. Its default depends on the | capability of the used backend memory, which means "circular" or NULL. | The latter defaults to 'direct' in the routines. | If it is NULL, the devicetree fixup routine skips exporting a | 'backend-storage-type' node to the kernel's devicetree. | | But currently if the 'backend-storage-type' node is explicitly given as | 'direct', it will be skipped silently and set to NULL instead. In this | case the user of the 'barebox-state' tool then ends up with the warning: | | "No backend-storage-type found, using default" | | which is annoying, because it was given. | | Storing the given value will still use a NULL if the | 'backend-storage-type' node isn't defined, but stores everything else if | it is defined. Then the 'backend-storage-type' node is present in the | kernel's devicetree as well. | | Signed-off-by: Juergen Borleis <jbe@pengutronix.de> | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: provide an error message when an error occursUlrich Ölmann2019-01-071-0/+1
| | | | | | | | | | | | | | | | | | | This ports the following barebox commit: | commit 8db7a230bd144912ccc361cfb859ed28beb0817e | Author: Juergen Borleis <jbe@pengutronix.de> | Date: Wed Aug 16 14:27:07 2017 +0200 | | state: provide an error message when an error occurs | | A simple typo makes the state framework fail, but without an error | message the developer is lost in the dark. | | Signed-off-by: Juergen Borleis <jbe@pengutronix.de> | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: add debugging helpUlrich Ölmann2019-01-072-1/+8
| | | | | | | | | | | | | | | | | | | | This ports the following barebox commit: | commit b6a35329fe07bc4e4d34506d541853c076692140 | Author: Juergen Borleis <jbe@pengutronix.de> | Date: Tue Aug 15 15:46:35 2017 +0200 | | state: add debugging help | | While working on the state documentation it turns out to be helpful to have | more debug messages while a developer implements a 'state' variable set | and tries to configure it correctly. | | Signed-off-by: Juergen Borleis <jbe@pengutronix.de> | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: backend_storage: remove unreachable error messageUlrich Ölmann2019-01-071-2/+0
| | | | | | | | | | | | | | | | | | This ports the following barebox commit: | commit e19730531a167b65ffb1e3b497810dc5d1e30666 | Author: Philipp Zabel <p.zabel@pengutronix.de> | Date: Tue Jul 18 15:15:34 2017 +0200 | | state: backend_storage: remove unreachable error message | | This looks like a leftover. | | Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> | Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: backend_bucket_circular: promote old state debug message to infoUlrich Ölmann2019-01-071-1/+1
| | | | | | | | | | | | | | | | | | | This ports the following barebox commit: | commit 0f5ecafbe3b3f999dc187d49ebeda6167967e995 | Author: Philipp Zabel <p.zabel@pengutronix.de> | Date: Tue Jul 18 15:15:23 2017 +0200 | | state: backend_bucket_circular: promote old state debug message to info | | A report about the changed on-storage state format might be interesting | to the user. | | Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> | Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: backend_bucket_circular: fix old state readsUlrich Ölmann2019-01-071-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | This ports the following barebox commit: | commit a0c26429e472a175ac6b1736c8687a19a76e97a9 | Author: Philipp Zabel <p.zabel@pengutronix.de> | Date: Tue Jul 18 15:14:45 2017 +0200 | | state: backend_bucket_circular: fix old state reads | | When the circular bucket meta magic was not found, it is assumed that | the whole written state is in the old on-storage format. In that case, | the size of the circular bucket meta must not be subtracted from the | read length, or the (complete_len > len) check in the raw backend's | verify function will fail: | | state: Error, invalid data_len 16 in header, have data of len 24 | | Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> | Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: backend: always pass backend type to Linux dtbUlrich Ölmann2019-01-071-1/+2
| | | | | | | | | | | | | | | | | | | | | This ports the following barebox commit: | commit 119f92b27e131a0cb506fe8d8bffe8010fb14a3d | Author: Sascha Hauer <s.hauer@pengutronix.de> | Date: Fri Jun 23 12:43:14 2017 +0200 | | state: backend: always pass backend type to Linux dtb | | When the "backend-storage-type" property is unset in the barebox dtb | then barebox will use the default. Instead of leaving the property | unset in the Linux dtb, set it to the value we used as default. By | making the default explicit to Linux we force Linux to the same backend | type, even when the defaults may differ. | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: do not complain about missing backend-storage-typeUlrich Ölmann2019-01-071-7/+2
| | | | | | | | | | | | | | | | | | | This ports the following barebox commit: | commit 02a0af266e45a936e50454fdc6ae949b5245c3ac | Author: Sascha Hauer <s.hauer@pengutronix.de> | Date: Tue May 23 09:31:29 2017 +0200 | | state: do not complain about missing backend-storage-type | | backend-storage-type is irrelevant for mtd devices, so do not | complain about this option missing. The mtd backend will print | messages if necessary. | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: remove unused variablesUlrich Ölmann2019-01-071-9/+0
| | | | | | | | | | | | | | | | | | | This ports the following barebox commit: | commit d528a3bbe6417c569342e5f0861e11c4092ecf36 | Author: Sascha Hauer <s.hauer@pengutronix.de> | Date: Thu May 11 10:06:24 2017 +0200 | | state: remove unused variables | | There's no need to check for the existence of the backend property as | this is done implicitly later anyway. With this check removed of_path | is only assigned, but never used. Remove the unused code. | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: Create alias in of_state_fixup()Ulrich Ölmann2019-01-071-1/+12
| | | | | | | | | | | | | | | | | | | This ports the following barebox commit: | commit 70ea799f6b6ddcd92b94420a2d352a73f0f9ff08 | Author: Sascha Hauer <s.hauer@pengutronix.de> | Date: Thu May 4 12:50:59 2017 +0200 | | state: Create alias in of_state_fixup() | | When the kernel device tree is fixed up we assume that it doesn't | have a state node, so we must also assume that it doesn't have | a alias. Create it. | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: Make an alias mandatoryUlrich Ölmann2019-01-071-2/+4
| | | | | | | | | | | | | | | | | | | This ports the following barebox commit: | commit 49831918036ab3292870dc2c6035292e6af47ae1 | Author: Sascha Hauer <s.hauer@pengutronix.de> | Date: Thu May 4 12:27:21 2017 +0200 | | state: Make an alias mandatory | | The userspace barebox-state utility gets confused when no alias exists. | Make the alias mandatory, so that people make it right^tm without having | to ask. | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: warn when a state node will be overwrittenUlrich Ölmann2019-01-071-0/+9
| | | | | | | | | | | | | | | | | | | | This ports the following barebox commit: | commit b30047b433a60e6183216e8364971efddd5d208e | Author: Sascha Hauer <s.hauer@pengutronix.de> | Date: Thu May 4 11:58:23 2017 +0200 | | state: warn when a state node will be overwritten | | People do not seem to know that a state node in the kernel | device tree will be overwritten by barebox. Print a warning | when this happens so that people can get an idea why changes | in the kernel device tree state node do not have any effect. | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: make parameter functions more consistentUlrich Ölmann2019-01-072-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces a dummy version dev_add_param_int() by a dummy version of dev_add_param_uint32() to make the compiler happy and ports the following barebox commit: | commit c5d95eb4c72a2639c10d01a801df00b4c34db315 | Author: Sascha Hauer <s.hauer@pengutronix.de> | Date: Fri Apr 7 11:57:08 2017 +0200 | | param: make parameter functions more consistent | | This patch creates a consitent set of device parameter functions. | | With this we have: dev_add_param_<type><access> | | "type" is one of: int32, uint32, int64, uint64, string, mac, ipv4, enum, | bitmask | The improvement here is that we now can exactly specify the width of the | int type parameters and also correctly distinguish between signed and | unsigned variables which means that a variable no longer ends up with | INT_MAX when it's assigned -1. | | "access" can be empty for regular read/write parameter, "_ro" for readonly | parameters which get their value from a variable pointer in the | background or "_fixed" for parameters which are set to a fixed value | (without a pointer in the background). | | Some more exotic types are not (yet) implemented, like | dev_add_param_ip_ro. | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: backend_bucket_circular: drop unused free_pattern constantUlrich Ölmann2019-01-071-1/+0
| | | | | | | | | | | | | | | | This ports the following barebox commit: | commit b876c2b7394f9d5258e6b73f684741c88fa41f23 | Author: Antony Pavlov <antonynpavlov@gmail.com> | Date: Wed May 3 14:41:18 2017 +0300 | | state: backend_bucket_circular: drop unused free_pattern constant | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: Fix "pack" returning freed data for DTB backendUlrich Ölmann2019-01-071-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | This ports the following barebox commit: | commit ec01cbce2165deb3d814f0c031043fa999632eaa | Author: Ian Abbott <abbotti@mev.co.uk> | Date: Fri Apr 21 10:53:25 2017 +0100 | | state: Fix "pack" returning freed data for DTB backend | | `state_backend_format_dtb_pack()` passes a buffer containing state | packed in flattened DTB format back to its caller via its `buf` | parameter. It then frees the buffer before returning. This means the | caller (`state_save()`) will be working on freed buffer contents before | freeing the buffer a second time itself. Fix it by removing the | spurious call to `free()`. | | This should fix a bug reported by Norbert Wiedmann in | <http://lists.infradead.org/pipermail/barebox/2017-April/029980.html>. | | Cc: Norbert Wiedmann <info@n-wiedmann.de> | Signed-off-by: Ian Abbott <abbotti@mev.co.uk> | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: Fix error return valueUlrich Ölmann2019-01-071-0/+1
| | | | | | | | | | | | | | | | | | This ports the following barebox commit: | commit d11584df3d8c311f8d12a16badc8fbe18e592f87 | Author: Sascha Hauer <s.hauer@pengutronix.de> | Date: Wed Apr 19 14:34:30 2017 +0200 | | state: Fix error return value | | When the backend phandle cannot be resolved we jump to the error | return path without initializing ret. Fix this. | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: backend_storage: Set needs_refresh back to 0 after refreshingUlrich Ölmann2019-01-071-2/+4
| | | | | | | | | | | | | | | | | | | | | This ports the following barebox commit: | commit 275f35461a454be350ca18a25042be8800ac5008 | Author: Sascha Hauer <s.hauer@pengutronix.de> | Date: Wed Apr 19 10:18:42 2017 +0200 | | state: backend_storage: Set needs_refresh back to 0 after refreshing | | Set needs_refresh back to 0 after refreshing so that we do not refresh | it again without need. This would only happen when we read the state | from the storage multiple times, which normally is not the case. | However, it's more consistent like this. | | Reported-by: Sam Ravnborg <sam@ravnborg.org> | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: backend_bucket_circular: Do not leak memoryUlrich Ölmann2019-01-071-2/+4
| | | | | | | | | | | | | | | | | | This ports the following barebox commit: | commit af187108cf33826fd3ff2be4469563ae4169fe48 | Author: Sascha Hauer <s.hauer@pengutronix.de> | Date: Wed Apr 19 10:13:58 2017 +0200 | | state: backend_bucket_circular: Do not leak memory | | buf was just allocated, free it before returning an error. | | Reported-by: Sam Ravnborg <sam@ravnborg.org> | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: find device node from device path, not from device node pathUlrich Ölmann2019-01-073-6/+12
| | | | | | | | | | | | | | | | | | | | | This adds a dummy version of of_find_node_by_devpath() to make the linker happy and ports the following barebox commit: | commit e627903d59b7f7d085e53a0dc9ed942bcc63dff9 | Author: Sascha Hauer <s.hauer@pengutronix.de> | Date: Thu Mar 30 16:33:26 2017 +0200 | | state: find device node from device path, not from device node path | | The device node path may change from the internal device tree to the | one Linux is started with, so using this path to fixup the tree is | not very robust. Instead, use of_find_node_by_devpath() which has | been created for exactly this purpose. | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* state: Make pointing to the backend using a phandle the only supported methodUlrich Ölmann2019-01-072-18/+9
| | | | | | | | | | | | | | | | | | | | | | This ports the following barebox commit and removes the now no longer used noop definition of of_find_path(): | commit 99020ca016f5569a14ef7571384a0205f13522e8 | Author: Sascha Hauer <s.hauer@pengutronix.de> | Date: Tue Mar 21 13:57:51 2017 +0100 | | state: Make pointing to the backend using a phandle the only supported method | | All other methods are broken for some time already: When starting the | kernel the state code rewrites the state node in the device tree and | replaced the "backend" property with a phandle - even when the target | can't be described as a phandle. Since using phandles is the nicest way | to point to the storage device anyway remove the other methods. | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* treewide: Use of_property_write_string() where appropriateUlrich Ölmann2019-01-073-8/+5
| | | | | | | | | | | | | | | | | | This ports the following barebox commit: | commit b6089182316d831c3bfe0d96994df7e372a43c1b | Author: Sascha Hauer <s.hauer@pengutronix.de> | Date: Thu Mar 30 10:38:19 2017 +0200 | | treewide: Use of_property_write_string() where appropriate | | Replace users which use of_set_property() to set a property to a string | with of_property_write_string(). | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* libdt: add of_property_write_string()Ulrich Ölmann2019-01-073-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | This ports the following barebox commits: | commit 2d36433aa8f360b3c9fce3f4efc0a34c69444694 | Author: Sascha Hauer <s.hauer@pengutronix.de> | Date: Thu Mar 30 10:36:58 2017 +0200 | | of: Add of_property_write_string() | | Setting a property to a string is used many times. Create a convenience | function for it. | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> | commit 4da7cf0a63b7a821973b2de5f9319ff56ebe49bf | Author: Ulrich Ölmann <u.oelmann@pengutronix.de> | Date: Fri Oct 19 06:33:11 2018 +0200 | | of: base: fix typo | | Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* backend_storage: remove fs.hUlrich Ölmann2019-01-071-1/+0
| | | | | | | | | Starting with commit e790822a6676 ("state: simplify direct backend") the ioctl BLKGETSIZE64 is no longer used so there is no need for fs.h anymore (included since commit bbafbee71370 ("backend_storage: add fs.h for BLKGETSIZE64")). Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* README: add note about subject prefixRoland Hieber2018-12-201-0/+3
| | | | Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* Release v2018.05.0v2018.05.1Roland Hieber2018-12-143-2/+8
| | | | Signed-off-by: Roland Hieber <rhi@pengutronix.de>
* README: also use oss-tools@pengutronix.de hereRoland Hieber2018-11-091-4/+1
| | | | Signed-off-by: Roland Hieber <r.hieber@pengutronix.de>
* Fix compiler warnings about wrong type conversion in messages.Philipp Rosenberger2018-11-094-10/+10
| | | | | | | These warning were observed with gcc-6.3 on x86-64. Signed-off-by: Philipp Rosenberger <p.rosenberger@linutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* src: fix compilation for glibc version 2.27.9000-36.fc29 and newerEnrico Joerns2018-09-102-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As recent glibc versions (>= 2.27.9000-36.fc29) also define 'struct statx' which is also defined in linux/stat.h, compilation fails with error: | In file included from ../dt-utils-2018.05.0/src/crypto/digest.c:24: | [..]/usr/include/linux/stat.h:56:8: error: redefinition of 'struct statx_timestamp' | struct statx_timestamp { | ^~~~~~~~~~~~~~~ | In file included from [..]/usr/include/sys/stat.h:446, | from ../dt-utils-2018.05.0/src/dt/common.h:15, | from ../dt-utils-2018.05.0/src/crypto/digest.c:19: | [..]/usr/include/bits/statx.h:25:8: note: originally defined here | struct statx_timestamp | ^~~~~~~~~~~~~~~ | In file included from ../dt-utils-2018.05.0/src/crypto/digest.c:24: | [..]/usr/include/linux/stat.h:99:8: error: redefinition of 'struct statx' | struct statx { | ^~~~~ | In file included from [..]/usr/include/sys/stat.h:446, | from ../dt-utils-2018.05.0/src/dt/common.h:15, | from ../dt-utils-2018.05.0/src/crypto/digest.c:19: | [..]/usr/include/bits/statx.h:36:8: note: originally defined here | struct statx | ^~~~~ The linux/stat.h originates from the code that was copied from barebox but is not explicitly required to be linux/stat.h instead of sys/stat.h and we do not actually use struct statx. Thus it is safe to simply replace occurrences of linux/stat.h by sys/stat.h to fix compilation. Signed-off-by: Enrico Joerns <ejo@pengutronix.de>
* configure.ac: change project mail to oss-tools@pengutronix.deEnrico Jorns2018-06-281-1/+1
| | | | | Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
* Release v2018.05.0v2018.05.0Roland Hieber2018-06-053-4/+14
| | | | Signed-off-by: Roland Hieber <r.hieber@pengutronix.de>