summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* state: don't keep pointers to device tree nodesMichael Olbrich2017-03-312-8/+13
| | | | | | | | | | Caching pointers to device tree nodes or is not save. The barebox internal device tree may be changed by loading a new device tree or through fixup handlers. As a result, the node may be deleted and replaced with a new one. Keep a copy of the full path instead and resolve the node as needed. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: make locally used function staticSascha Hauer2017-03-312-2/+1
| | | | | | state_set_dirty() is only used in one file, make it static. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: consistently pass one type as private data to dev_add_param_*Sascha Hauer2017-03-311-15/+16
| | | | | | | The different dev_add_param_* calls all use different types as private data. This is unnecessary, use struct state_variable * for all of them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: Add state to state_variableSascha Hauer2017-03-312-6/+8
| | | | | | | A state variable should know which state it belongs to. Add field for it to struct state_variable. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: copy backend of_path stringMichael Olbrich2017-03-312-2/+3
| | | | | | | | | | Caching pointers to device tree nodes or names is not safe. The barebox internal device tree may be changed by loading a new device tree or through fixup handlers. As a result, the string may be deleted. Use local copies of the full path instead. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Revert "barebox-state: Do not defer probe"Sascha Hauer2017-03-311-1/+6
| | | | This reverts commit 898a46705d8e672932e8668149e94bb0c9f9a878.
* Revert "barebox-state: Add force switch"Sascha Hauer2017-03-316-29/+13
| | | | This reverts commit 89135e5522720bc75615a6ec22bb8bcb7b4994e2.
* state: use packed attribute for on storage structsSascha Hauer2017-03-213-3/+3
| | | | | | | | | | | These structs are used for on-storage data layouts. They should be not affected by different integer precisions and alignment optimizations of 32bit or 64bit machines. Using the architecture independent integer data types, like uint32_t, achieves the former, using the packed attribute the later. Signed-off-by: Stefan Lengfeld <s.lengfeld@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: Whitespace cleanupSascha Hauer2017-03-211-3/+3
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: bucket_circular: -EUCLEAN means data could be readSascha Hauer2017-03-211-1/+1
| | | | | | | | -EUCLEAN returned from state_mtd_peb_read() means that the data shall still be used. This fixes initialization of buckets which need cleanup. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: bucket_cached: Fix reading pages which need cleanupSascha Hauer2017-03-211-4/+4
| | | | | | | | When the raw device returns -EUCLEAN we have to return successfully to the upper layer, otherwise it will discard the data. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* barebox-state: Add force switchSascha Hauer2017-03-166-13/+29
| | | | | | | The force switch allows to read from a state even when the keystore blobs cannot be read. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* barebox-state: Do not defer probeSascha Hauer2017-03-161-6/+1
| | | | | | This makes no sense in the user space tool, remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rework logging functionsSascha Hauer2017-03-164-34/+108
| | | | | | | | We already use pr_* and dev_* functions. Replace some more fprintf(stderr,...) with appropriate pr_* function calls. Also provide control over which urgency level is printed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of_print_property: fix compiler warningUwe Kleine-König2017-02-101-1/+1
| | | | | | | src/libdt.c: In function ‘of_print_property’: src/libdt.c:97:13: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘const void *’ [-Wformat=] Calm the compiler with an explicit cast.
* of_get_devicepath: correct comment and add link to external patchUwe Kleine-König2017-02-101-3/+3
|
* of_get_devicepath: make partition finding more robustUwe Kleine-König2017-02-101-5/+6
| | | | | | If a backing device for a partition is neither an eeprom nor an mtd nor a block device I don't know what it should be. Still fall back to the generic case where the partition doesn't have a related of_node.
* of_get_devicepath: if the device is an mtd udev_parse_mtd is all we need.Uwe Kleine-König2017-02-101-0/+1
| | | | | | | So the function should return success and not fall back to the "there is no associated device" case. Fixes: d83976b8163d ("libdt: add block devicepath extraction")
* of_get_devicepath: simplify code flowUwe Kleine-König2017-02-101-7/+5
| | | | | | | | | This reduces indention level and makes the code more easy to follow. There is no semantic change (but now it's obvious there is a bug which is fixed in the next commit). Fixes: d83976b8163d ("libdt: add block devicepath extraction")
* remove two unused variablesUwe Kleine-König2017-02-091-2/+1
| | | | Fixes: 53df62ae2fe3 ("state: describe backend with phandle")
* barebox-state: Fix commentSascha Hauer2017-01-161-1/+1
| | | | | | | Writes are always beginning at a page and pages can't be erased. It's 'eraseblock' that is meant here. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Release v2016.12.0v2016.12.0Bastian Stender2016-12-082-1/+9
| | | | Signed-off-by: Bastian Stender <bst@pengutronix.de>
* barebox-state: fix typoBastian Stender2016-12-081-1/+1
| | | | Signed-off-by: Bastian Stender <bst@pengutronix.de>
* libdt: take the parent to search for block devicesMichael Grzeschik2016-09-221-0/+5
| | | | Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
* barebox-state: only set state->name by state->state if validMichael Grzeschik2016-09-221-1/+1
| | | | | | This patch fixes commit d4c997a3. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
* backend_storage: add fs.h for BLKGETSIZE64Michael Grzeschik2016-09-221-0/+1
| | | | Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
* barebox-state: make sure state->name is validMichael Olbrich2016-09-141-0/+2
| | | | | | | It's used later while setting state variables. Fixes: feb64890a302 ("barebox-state: fall back to /state if there is no alias defined") Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
* barebox-state: fall back to /state if there is no alias definedMichael Olbrich2016-09-121-2/+1
| | | | | | | | | | state_get() already supports this if no state name is given. This just removes the default state name to make use of this feature. Without this, an alias named 'state' is needed for barebox-state work without specifying the state node. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
* libdt: only enumerate devices we are interested inSascha Hauer2016-08-241-1/+4
| | | | | | | | Only devices of certain subsystems can have device nodes. Limit the enumeration to these subsystems, namely platform, i2c, spi and mtd. pci maybe missing here, but let's see once we are there. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* libdt: cache of_find_device_by_node_path resultsSascha Hauer2016-08-241-9/+36
| | | | | | | | Scanning udev for devices with a OF_FULLNAME property can take a long time. Since we may do this multiple times cache the results during first run to speed up subsequent runs. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Release v2016.08.0v2016.08.0Bastian Stender2016-08-222-1/+6
| | | | Signed-off-by: Bastian Stender <bst@pengutronix.de>
* barebox-state: return non-zero exit code for missing or invalid argEnrico Jorns2016-08-081-0/+6
| | | | | | | | | | This make barebox-state return non-zero exit-code in case of a missing parameter (':') or an invalid/unknown argument ('?'). No extra printing of error messages is performed as this is handled by getopt itself in this configuration. Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Tested-by: Bastian Stender <bst@pengutronix.de>
* barebox-state: fix print variable on --getBastian Stender2016-08-041-0/+1
| | | | | | | 676e2a13e90fb8bf37d6777dc3d21d2406916885 accidentally removed the printf call. Signed-off-by: Bastian Stender <bst@pengutronix.de>
* Release v2016.07.2v2016.07.2Markus Pargmann2016-07-222-1/+6
| | | | Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
* libdt: add block devicepath extractionBastian Stender2016-07-221-8/+73
| | | | | | | | | | | | This allows barebox state to find the backend node on block devices. This is a reworked version of the patch. The outdated patch did not specify the parent correctly resulting in an incorrect subtree. This lead to the wrong block device being returned. Signed-off-by: Bastian Stender <bst@pengutronix.de>
* barebox-state: Fix prefix removal of variablesMarkus Pargmann2016-07-131-1/+1
| | | | Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
* barebox-state: Fix default stateMarkus Pargmann2016-07-131-0/+11
| | | | Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
* Release v2016.07.1v2016.07.1Markus Pargmann2016-07-122-1/+6
| | | | Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
* dtblint: Add dtblint.h to sourcesMarkus Pargmann2016-07-121-1/+1
| | | | Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
* barebox-state: Add possibility to specify multiple state namesMarkus Pargmann2016-07-111-51/+97
| | | | Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
* dtblint: check for fec reset gpio polarity mismatchUwe Kleine-König2016-07-091-1/+52
|
* dtblint: imx-pinmux: mention bit that is wrongly setUwe Kleine-König2016-07-081-2/+3
|
* dtblint: imx-pinmux: add support for imx6qUwe Kleine-König2016-07-081-1/+1595
|
* dtblint: split out imx-pinmux checksUwe Kleine-König2016-07-084-1225/+1247
|
* Release v2016.07.0v2016.07.0Markus Pargmann2016-07-082-1/+6
| | | | Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
* dtblint: fix a few swpad reset valuesUwe Kleine-König2016-07-051-4/+4
| | | | The reset values had bits set that were not in the writeable mask.
* Update barebox-stateMarkus Pargmann2016-07-0512-141/+305
| | | | | | Fixed direct bucket Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
* Release v2016.05.2v2016.05.2Markus Pargmann2016-06-162-1/+5
| | | | Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
* pr_info: In userspace this should be redirected to stderrMarkus Pargmann2016-06-161-1/+1
| | | | | | | barebox-state outputs should be parsable by other applications. Therefore normal info outputs should be redirected to stderr. Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
* v2016.05.1v2016.05.1Markus Pargmann2016-06-022-1/+5
| | | | Signed-off-by: Markus Pargmann <mpa@pengutronix.de>