9
0
Fork 0
Commit Graph

1971 Commits

Author SHA1 Message Date
Lucas Stach cce74dff55 globalvar: select FNMATCH
This is needed since support for wildcards has been introduced.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-09 13:41:12 +01:00
Sascha Hauer 8eb1fb3519 Merge branch 'for-next/vybrid' 2016-11-14 12:37:20 +01:00
Sascha Hauer f55e379fca Merge branch 'for-next/state' 2016-11-14 12:35:52 +01:00
Sascha Hauer e5374fa4d4 Merge branch 'for-next/squashfs' 2016-11-14 12:35:50 +01:00
Sascha Hauer f772aa92c2 Merge branch 'for-next/misc' 2016-11-14 12:35:49 +01:00
Andrey Smirnov 3dc136ef87 i.MX: Add DEBUG_LL hooks for VF610
Add code to support DEBUG_LL functionality on VF610/Vybrid platform.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-11-11 08:57:25 +01:00
Stefan Lengfeld 2e93886c38 state: fix indentation
Signed-off-by: Stefan Lengfeld <s.lengfeld@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-11-03 07:20:13 +01:00
Stefan Lengfeld 88b67f8ee4 state: use packed attribute for on storage structs
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>
2016-11-03 07:19:13 +01:00
Stefan Lengfeld d0f1f07dfa state: fix state is not saved when string variable is changed
The dirty flag was not set properly.

Signed-off-by: Stefan Lengfeld <s.lengfeld@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-11-03 07:18:08 +01:00
Enrico Jorns 9bcbb51263 Add filetype and detection for squashfs images
This adds `filetype_squashfs` to the list of known filetypes and adds a
detection for squashfs files to file_detect_type(). This currently
matches on the `hsqs` start sequence of an image file.

Additionally, the newly introduced filetype is registered as the type of
the squashfs_driver which allows, for example, to mount squashfs without
the need to specify a type parameter.

This changes enable booting a squashfs with the simple `boot` command
pointing to the location (device) that holds the squashfs.

Note that booting with blspec is limited as the current squashfs driver
is not capable of handling symbolic links.

Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-10-24 08:14:41 +02:00
Sascha Hauer 28d5eb1bbc state: Use dev_* for information rather than pr_*
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-10-20 09:34:42 +02:00
Sascha Hauer 8099956f6a state: pass error code instead of inventing new one
Both of_find_path() and of_find_path_by_node() return a meaningful
error code, so forward it instead of inventing a new one. Do this
especially for the -EPROBE_DEFER case which currently does not work.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-10-20 09:31:07 +02:00
Sascha Hauer eca7871bce complete: Add completion for nv and globalvar commands
The 'nv' command is often used to create a nv variable
for an existing global variable, so add a command completion
function for this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-10-18 22:45:32 +02:00
Sascha Hauer 179d4060e8 Merge branch 'for-next/state' 2016-10-10 08:31:08 +02:00
Sascha Hauer bfdb14c7da Merge branch 'for-next/misc' 2016-10-10 08:31:07 +02:00
Sascha Hauer db9c78d579 Merge branch 'for-next/defenv' 2016-10-10 08:31:06 +02:00
Sascha Hauer c80ba33cbe Merge branch 'for-next/bootchooser' 2016-10-10 08:31:06 +02:00
Sascha Hauer 790980bf18 Make generic default environment type a use choice
So far it was hardcoded for each board if defenv-1 or defenv-2 is used.
Make this a user choice so that a particular board no longer enforces
a defenv type.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-10-10 08:30:36 +02:00
Sascha Hauer e4a45c0961 completion: Fix completion for devices with a dot in the name
Devices can have a dot in the name, so do not expect the full
device name before the first dot.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-10-07 09:09:01 +02:00
Sascha Hauer f5d77d80f5 Allow device parameters for devices with dots in name
Devices can have a dot in the name, so we can't expect to find the
full device name before the first dot. Currently parameters of devices
with a dot in the name are inaccessible from the shell.
Fix this by iterating over the possible device name / parameter name
combinations to find a existing combination.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-10-07 09:07:41 +02:00
Lucas Stach 38c0c1105a arm64: don't allow to build relocatable image
The current ARM64 implementation is lacking the lowlevel functions
to do the relocation. Don't allow to select it.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-10-04 08:12:19 +02:00
Ulrich Ölmann 322890fa62 blspec: fix typo
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-28 08:29:18 +02:00
Ulrich Ölmann bfe946c959 blspec: fix return value of entry_is_of_compatible()
The function returns a boolean and not an integer. Hence the former
explicit/implicit cast of an ERR_PTR to a boolean has led to a return value of
true although a bootspec entry with a faulty devicetree is not compatible.

Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-28 08:28:49 +02:00
Ulrich Ölmann 71f6328d00 blspec: fix erroneus free in entry_is_of_compatible()
Whenever of_unflatten_dtb() encountered an error it already released the memory
before returning the error code. Make this apparent by setting the pointer to
NULL to avoid an erroneus free.

Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-27 08:22:17 +02:00
Sam Ravnborg 8b07b925ac environment: "wrong magic" gives the impression of an error
From 15e7ff689cfda27eab10aacda5c26a1ba47979ec Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <srn@skov.dk>
Date: Thu, 22 Sep 2016 06:54:42 +0200
Subject: [PATCH 1/1] environment: "wrong magic" give the impression of an
 error

Introduce a more soft wording when the magic of
the superblock does not match.
Include a hint to the typical reason "(envfs never written?)"

This prevents a "what is wrong?" moment when looking at
the boot log.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-26 08:04:51 +02:00
Marc Kleine-Budde cc532a3f73 boot: add framework for redundant boot scenarios
There are several use cases where a redundant Linux system is needed. The
barebox bootchooser framework provides the building blocks to model different
use cases without the need to start from the scratch over and over again.

The bootchooser works on abstract boot targets, each with a set of properties
and implements an algorithm which selects the highest priority target to boot.

See the documentation contained in this patch for more information.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-22 11:44:23 +02:00
Sascha Hauer 6d8beeaad1 globalvar: introduce globalvar_add_simple_bitmask
Using the just introduced param_bitmask this adds the corresponding
globalvar convenience function.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-22 11:35:00 +02:00
Sascha Hauer 5cc00c3e2a globalvar: Allow full variable name in globalvar_add
As a convenience for users allow to pass the full name, including
the leading "global.", to globalvar_add().

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-22 11:31:38 +02:00
Sascha Hauer f5bf5b9c5a nv: Allow full variable name in nvvar_add
As a convenience for users allow to pass the full name, including
the leading "nv.", to nvvar_add().

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-22 11:31:34 +02:00
Sascha Hauer d3e108645b globalvar: Also create globalvars from for nonvolatile device vars
nv variables beginning with "nv.dev.<devname>.<varname>" are directly
mirrored to <devname>.<varname> and there is no globalvar for it. To
make it a bit more consistent and to increase the visibility of the
nonvolatile device variables create globalvars for them aswell.

With this the propagation flow has changed from:

nv.dev.<devname>.<varname>
  -> <devname>.<varname>

to:

nv.dev.<devname>.<varname>
  -> global.dev.<devname>.<varname>
    -> <devname>.<varname>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-22 11:31:30 +02:00
Sascha Hauer ffc6031313 nv: simplify nvvar_add
We do not need to have an extra code path when the variable already
exists, instead setting an existing variable can be done in the
variable creation code path aswell.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-22 11:31:25 +02:00
Sascha Hauer 0ad0baac55 globalvar: Allow to remove multiple globalvars using wildcards
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-22 11:31:16 +02:00
Sascha Hauer d60230bded convert users to %pI4
Convert users of ip_to_string() and print_IPaddr() to %pI4 and
remove the now unused functions.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-22 11:30:38 +02:00
Sascha Hauer 8776eca37a globalvar: sync with nvvars
This patch fixes the behaviour when a driver creates a globalvar using
globalvar_add_simple_[string|int|bool|enum|ip]) *after* nvvars are
initialized and this globalvar is overwritten with a nvvar. Currently
this fix is not needed because all globalvars are registered before the
nvvars are initialized.

We have two different typed of globalvars. The first type, here referred
to as qualified globalvars, has a backend variable storage (the ones
created with globalvar_add_simple_[string|int|bool|enum|ip]), the other
created with globalvar_add_simple only has a dynamically allocted string
as backend.

Normally during startup of barebox the qualified globalvars are
registered and during load of nvvars are synced with the values from the
nvvars. Everything works fine in this case. However, when during nvvar
initialisation a globalvar for a nvvar does not exist, then it is
registered as unqualified globalvar. When then later some driver wants
to register a qualified globalvar for which a unqualified globalvar
already exists, it will get a -EEXIST. This is not the expected
behaviour. Instead, the current unqualified globalvar should be removed,
recreated as qualified globalvar and then afterwards synced with the
corresponding nvvar. This behaviour is fixed with this patch.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-22 11:30:28 +02:00
Sascha Hauer 5126579f97 globalvar: Move static inline functions to common/
These functions will get bigger in the next patch which disqualifies
them as static inline functions.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-22 11:30:23 +02:00
Sascha Hauer c42e8262c8 nv: Fix variable removal in nvvar_save()
When nv variables are removed during runtime then they are
present again when saved with nvvar_save(). This is because nvvar_save()
does not delete variables that exist on the saved environment. Delete
/nv on the saved environment before saving the new variables.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-22 10:10:18 +02:00
Sascha Hauer fdf498cf02 state: consistently pass one type as private data to dev_add_param_*
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>
2016-09-20 10:29:14 +02:00
Sascha Hauer 1d02283b2f state: make locally used function static
state_set_dirty() is only used in one file, make it static.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-20 10:29:06 +02:00
Sascha Hauer 3a690e4d69 state: Add state to state_variable
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>
2016-09-20 10:29:01 +02:00
Michael Olbrich 8c6ca8acc5 state: fix finding the correct parent node
Looking for the parent node during fixup is broken. The path of the parent
node is not correctly terminated ('0' vs '\0'). Also, the new state node
should be added to the supplied device tree not the barebox device tree
used by of_find_node_by_path().

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-20 10:28:53 +02:00
Michael Olbrich ba5e1708cd state: don't keep pointers to device tree nodes
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>
2016-09-20 10:28:53 +02:00
Michael Olbrich 872e6069d5 state: copy backend of_path string
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>
2016-09-20 10:28:46 +02:00
Sascha Hauer 074a8fdc92 Merge branch 'for-next/socfpga' 2016-09-13 14:56:06 +02:00
Sascha Hauer 0e1892b2e9 Merge branch 'for-next/rockchip' 2016-09-13 14:56:05 +02:00
Sascha Hauer dd534571bd Merge branch 'for-next/misc' 2016-09-13 14:56:05 +02:00
Sascha Hauer 6b8ae8f2e1 Merge branch 'for-next/menu' 2016-09-13 14:56:05 +02:00
Sascha Hauer b2c398f440 Merge branch 'for-next/imx' 2016-09-13 14:56:04 +02:00
Alexander Kurz f6ebdf2194 Add i.MX50 support
Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-12 08:23:09 +02:00
Sam Van Den Berge a1109d78dd Fix small typo in common/Kconfig
Fix small typo frendly -> friendly

Signed-off-by: Sam Van Den Berge <sam.van.den.berge@telenet.be>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-05 08:53:24 +02:00
Andrey Smirnov da1f91422c of_unflatten_dtb(): Check return value with IS_ERR
Of_unflatten_dtb returns a ERR_PTR value so checking it against NULL is
incorrect. Fix it in all of the places where this was happening.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-05 08:29:12 +02:00