summaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/misc'Sascha Hauer2016-10-104-25/+45
|\
| * completion: Fix completion for devices with a dot in the nameSascha Hauer2016-10-071-8/+8
| | | | | | | | | | | | | | 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>
| * Allow device parameters for devices with dots in nameSascha Hauer2016-10-071-14/+34
| | | | | | | | | | | | | | | | | | | | 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>
| * blspec: fix typoUlrich Ölmann2016-09-281-1/+1
| | | | | | | | | | Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * environment: "wrong magic" gives the impression of an errorSam Ravnborg2016-09-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * convert users to %pI4Sascha Hauer2016-09-221-1/+1
| | | | | | | | | | | | | | 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>
* | Merge branch 'for-next/defenv'Sascha Hauer2016-10-101-21/+15
|\ \
| * | Make generic default environment type a use choiceSascha Hauer2016-10-101-21/+15
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge branch 'for-next/bootchooser'Sascha Hauer2016-10-105-70/+1138
|\ \ \
| * | | boot: add framework for redundant boot scenariosMarc Kleine-Budde2016-09-224-0/+942
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | globalvar: introduce globalvar_add_simple_bitmaskSascha Hauer2016-09-221-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the just introduced param_bitmask this adds the corresponding globalvar convenience function. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | globalvar: Allow full variable name in globalvar_addSascha Hauer2016-09-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | nv: Allow full variable name in nvvar_addSascha Hauer2016-09-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | globalvar: Also create globalvars from for nonvolatile device varsSascha Hauer2016-09-221-45/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | nv: simplify nvvar_addSascha Hauer2016-09-221-18/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | globalvar: Allow to remove multiple globalvars using wildcardsSascha Hauer2016-09-221-4/+6
| | | | | | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | globalvar: sync with nvvarsSascha Hauer2016-09-221-4/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | globalvar: Move static inline functions to common/Sascha Hauer2016-09-221-0/+67
| | |/ | |/| | | | | | | | | | | | | | | | 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>
* | | arm64: don't allow to build relocatable imageLucas Stach2016-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | blspec: fix return value of entry_is_of_compatible()Ulrich Ölmann2016-09-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | blspec: fix erroneus free in entry_is_of_compatible()Ulrich Ölmann2016-09-271-0/+1
|/ / | | | | | | | | | | | | | | | | 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>
* | nv: Fix variable removal in nvvar_save()Sascha Hauer2016-09-221-0/+1
| | | | | | | | | | | | | | | | | | 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>
* | Merge branch 'for-next/socfpga'Sascha Hauer2016-09-131-0/+4
|\ \
| * | filetype: add new filetype for SoCFPGA xload imageSteffen Trumtrar2016-08-181-0/+4
| | | | | | | | | | | | | | | Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/rockchip'Sascha Hauer2016-09-131-3/+3
|\ \ \
| * | | ARM: rockchip: Add early debug support for RK3288Wadim Egorov2016-08-261-3/+3
| |/ / | | | | | | | | | | | | Signed-off-by: Wadim Egorov <w.egorov@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/misc'Sascha Hauer2016-09-131-1/+2
|\ \ \
| * | | Fix small typo in common/KconfigSam Van Den Berge2016-09-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | Kconfig: defaultenv-2 select CMD_TESTAlexander Kurz2016-08-221-0/+1
| |/ / | | | | | | | | | | | | | | | | | | CMD_TEST is required for scripts in defaultenv-2, e.g. automount. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/menu'Sascha Hauer2016-09-133-15/+85
|\ \ \
| * | | rework menu so that it can support multiline titlesAleksey Kuleshov2016-09-053-14/+84
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | properly remove menu entryAleksey Kuleshov2016-08-181-0/+1
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | fix double freeAleksey Kuleshov2016-08-181-1/+0
| |/ / | | | | | | | | | | | | | | | | | | | | | it already gets free in bootentries_free no need to do this in ->release method Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/imx'Sascha Hauer2016-09-131-0/+7
|\ \ \
| * | | Add i.MX50 supportAlexander Kurz2016-09-121-0/+7
| |/ / | | | | | | | | | | | | Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | / of_unflatten_dtb(): Check return value with IS_ERRAndrey Smirnov2016-09-051-1/+5
| |/ |/| | | | | | | | | | | | | 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>
* | blspec: Handle nfs:// pathes from bootSascha Hauer2016-08-291-1/+2
|/ | | | | | | | | | Fixes: cb47dde boot: Call blspec_scan_directory() only on strings containing an absolute path This commit introduced a check if the path contains a '/' at the beginning. For booting a bootloader spec entry from NFS we have to test the path for starting with "nfs://" aswell. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bbu: parameters are inverted in error messageRenaud Barbier2016-08-181-2/+2
| | | | | | | | | The error message warning the user that the image is too big for the device has its parameters in the wrong order. Swap the two parameters so that the output makes sense. Signed-off-by: Renaud Barbier <renaud.barbier@ge.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/nv'Sascha Hauer2016-08-033-18/+122
|\
| * nv: Allow wildcards when removing NV varsSascha Hauer2016-07-252-8/+11
| | | | | | | | | | | | | | With this patch 'nv -r' can also take "*" and "?" wildcards for nv variables. This makes it easier to remove multiple nv variables. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * lib: Add Kconfig symbol for FNMATCHSascha Hauer2016-07-251-0/+1
| | | | | | | | | | | | | | fnmatch is useful on its own, so make a separate Kconfig symbol and select it from GLOB. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * nv: Use dev_remove_param to delete nv variableSascha Hauer2016-07-221-4/+3
| | | | | | | | | | | | | | | | dev_remove_param() is exactly for the purpose of removing a device parameter, so use this function instead of open coding the functionality. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * nv: Save nv variables on shutdownSascha Hauer2016-07-222-3/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this patch nv variables are automatically saved whenever barebox shuts down (that is 'reset' is executed or a kernel is started). With this the additional 'saveenv' step becomes unnecessary. The nv variables are stored in the environment and the estasblished behaviour is that files in the environment must be manually saved using 'saveenv'. This behaviour shall be kept for now, so this patch cannot just call 'saveenv' since that would save the modified environment files aswell. Instead we read the environment from the device, modifiy the nv variables and save the environment back. Since this changes a long existing behaviour messages are printed the first time a nv variable is modified and during shutdown when the variables are actually saved. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * nv: Do not save nv variables while loadingSascha Hauer2016-07-221-5/+27
| | | | | | | | | | | | | | | | When reading nv variables from the storage in /env/nv we do not need to write back the value to the file we just read from. Optimize this a bit and make it unnecessary. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2016-08-032-0/+16
|\ \
| * | state: Save on shutdownSascha Hauer2016-07-222-0/+16
| |/ | | | | | | | | | | | | | | | | The state framework is meant for storing persistent variables. To make the state more persistent automatically save it on shutdown. This is now the default behaviour, but can be disabled using a 'save_on_shutdown' variable attached to the state. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/boot'Sascha Hauer2016-08-036-202/+489
|\ \
| * | blspec: Turn message back to debug levelSascha Hauer2016-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Normally one should not be interested that the blspec code scans a directory. In case blspec is not actively used it might even be confusing, so lower priority of the message in blspec_scan_directory() to pr_debug. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | boot: add single quotes when printing boot target namesSascha Hauer2016-07-261-3/+3
| | | | | | | | | | | | | | | | | | | | | It's nicer to read when target names have quotes around them, it makes it clear that this is a string passed in somewhere. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | boot: Move code to common/Sascha Hauer2016-07-263-0/+343
| | | | | | | | | | | | | | | | | | | | | | | | | | | Normally code in commands/ shall only do the option parsing whereas the functionality shall be in common/ to make the code usable from C aswell. Do this in the boot code aswell, move it to common/boot.c and add the function prototypes to include/boot.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>