summaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | 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>
| * | blspec: Make blspec_boot staticSascha Hauer2016-07-261-78/+78
| | | | | | | | | | | | | | | | | | | | | Since blspec_boot is now only used locally we can make it static. Move it up to avoid a static declaration. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | blspec: separate bootentries from blspec entriesSascha Hauer2016-07-261-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | This completes the separation of the blspec code from the boot code. With this the boot code only handles generic boot entries of type struct bootentry which are embedded into the type (blspec/bootscript) specific structs. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | bootentries: Add title/descriptionSascha Hauer2016-07-261-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently have to special case blspec entries vs. boot scripts in the common boot code since we want to print different informations about them. This adds a 'title' and 'description' which can be filled in with different information by bootscripts and blspec entries and so we get rid of the special handling. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | blspec: factor out a struct bootentrySascha Hauer2016-07-261-4/+7
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | blpec: rename struct lspec -> bootentriesSascha Hauer2016-07-261-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code in common/boot.c collects the different boot entries in lists of type struct blspec, eventhough many of them may not be bootloader spec entries but for example boot scripts. This is the first step of separating the data structures from boot entries and bootloader spec: As struct blspec is merely a container for collecting boot entries We simply rename struct blspec to struct bootentries. No functional change. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | include: Move bulk of boot.h to bootm.hSascha Hauer2016-07-263-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | The majority of the stuff currently in include/boot.h is about bootm code implemented common/bootm.c. To be more consistent move it to a new file include/bootm.h. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | blspec: Remove once/default handlingSascha Hauer2016-07-221-56/+1
| | | | | | | | | | | | | | | | | | | | | | | | This is widely unused and in the way of subsequent cleanups. If you are indeed using it please complain on the list, we'll find a solution to add it back in a different way. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | blspec: remove unused blspec_boot_devicenameSascha Hauer2016-07-221-30/+0
| |/ | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / state: only build circular backend if MTD is enabledLucas Stach2016-07-252-3/+5
|/ | | | | | | | The circular backend depends on MTD symbols and is only useful if MTD is present. Exclude it from the build if MTD is not enabled. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/state'Sascha Hauer2016-07-1113-1721/+3395
|\
| * state: also append backend storage stridesizeMichael Grzeschik2016-07-083-0/+10
| | | | | | | | | | Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * state: Refactor state frameworkMarkus Pargmann2016-07-0813-1721/+3385
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The state framework grew organically over the time. Unfortunately the architecture and abstractions disappeared during this period. This patch refactors the framework to recreate the abstractions. The main focus was the backend with its storage. The main use-case was to offer better NAND support with less erase cycles and interchangeable data formats (dtb,raw). The general architecture now has a backend which consists of a data format and storage. The storage consists of multiple storage buckets each holding exactly one copy of the state data. A data format describes a data serialization for the state framework. This can be either dtb or raw. A storage bucket is a storage location which is used to store any data. There is a (new) circular type which writes changes behind the last written data and therefore reduces the number of erases. The other type is a direct bucket which writes directly to a storage offset for all non-erase storage. Furthermore this patch splits up all classes into different files in a subdirectory. This is currently all in one patch as I can't see a good way to split the changes up without having a non-working state framework in between. The following diagram shows the new architecture roughly: .----------. | state | '----------' | | v .----------------------------. | state_backend | |----------------------------| | + state_load(*state); | | + state_save(*state); | | + state_backend_init(...); | | | | | '----------------------------' | | The format describes | | how the state data | '-------------> is serialized | .--------------------------------------------. | | state_backend_format <INTERFACE> | | |--------------------------------------------| | | + verify(*format, magic, *buf, len); | | | + pack(*format, *state, **buf, len); | | | + unpack(*format, *state, *buf, len); | | | + get_packed_len(*format, *state); | | | + free(*format); | | '--------------------------------------------' | ^ ^ | * * | * * | .--------------------. .--------------------. | | backend_format_dtb | | backend_format_raw | | '--------------------' '--------------------' | | | v .----------------------------------------------------------. | state_backend_storage | |----------------------------------------------------------| | + init(...); | | + free(*storage); | | + read(*storage, *format, magic, **buf, *len, len_hint); | | + write(*storage, *buf, len); | | + restore_consistency(*storage, *buf, len); | '----------------------------------------------------------' | The backend storage is responsible to manage multiple data copies and distribute them onto several buckets. Read data is verified against the given format to ensure that the read data is correct. | | | | | v .------------------------------------------. | state_backend_storage_bucket <INTERFACE> | |------------------------------------------| | + init(*bucket); | | + write(*bucket, *buf, len); | | + read(*bucket, **buf, len_hint); | | + free(*bucket); | '------------------------------------------' ^ ^ ^ * * * * * * A storage bucket represents*exactly one data copy at one data location. A circular b*cket writes any new data to the end of the bucket (for *educed erases on NAND). A direct bucket directly writ*s at one location. * * * * * * * * * .-----------------------. * .-------------------------. | backend_bucket_direct | * | backend_bucket_circular | '-----------------------' * '-------------------------' ^ * ^ | * | | * | | * | | .-----------------------. | '--| backend_bucket_cached |---' '-----------------------' A backend_bucket_cached is a transparent bucket that directly uses another bucket as backend device and caches all accesses. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/nvdevvars'Sascha Hauer2016-07-111-24/+127
|\ \
| * | Introduce non volatile device variablesSascha Hauer2016-07-061-10/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Non volatile device variables are used to make device parameters persistent. They are like normal non volatile variables, but set the values of the device parameters with the corresponding name. Every nv variable beginning with nv.dev is a non volatile device variable. They have the form nv.dev.<devname>.<paramname> and act on the parameter <paramname> of the device named <devname>. The non volatile device variables are designated for example for video modes, ethernet device ip addresses or mtd partitioning. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | nvvar: Simplify by using dev_set_param()Sascha Hauer2016-07-061-6/+1
| | | | | | | | | | | | | | | | | | | | | The combination of get_param_by_name()/param->set() can be replaced by using dev_set_param() Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | nvvar: Simplify by using nv_set()Sascha Hauer2016-07-061-11/+2
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/misc'Sascha Hauer2016-07-111-0/+1
|\ \ \
| * | | Add more files to .gitignoreAlexander Shiyan2016-07-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds more generated files to ignore list. ... shc@shc /home/git/barebox-github $ git status На ветке imx51 Неотслеживаемые файлы: (используйте «git add <файл>…», чтобы добавить в то, что будет включено в коммит) common/barebox_default_env common/barebox_default_env.h include/asm scripts/basic/docproc ничего не добавлено в коммит, но есть неотслеживаемые файлы (используйте "git add", чтобы отслеживать их) Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>