summaryrefslogtreecommitdiffstats
path: root/include/bbu.h
Commit message (Collapse)AuthorAgeFilesLines
* bbu: bbu_register_std_file_update should take const char*Sascha Hauer2019-05-101-2/+2
| | | | | | String arguments to bbu_register_std_file_update should be const. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bbu: Add "handler" parameter to barebox_update()Andrey Smirnov2018-10-081-1/+1
| | | | | | | | | | | | Add "handler" parameter to barebox_update() and remove the code that was respondible for header lookup before. With this change finding appropriate handler is caller's responsibility, which makes it possible to implement custom handler lookup/existence check, chache it, and then re-use it without calling handler_find_by_* functions for the second time. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bbu: Expose bbu_find_handler_by_*() functionsAndrey Smirnov2018-10-081-1/+2
| | | | | | | | | | | | Expose bbu_find_handler_by_device() and bbu_find_handler_by_name() as public functions and convert the only user of barebox_update_handler_exists() to use the former function instead. With this done, barebox_update_handler_exists() is no longer used anywhere in the code and can be removed. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bbu: reserve upper 16 bits for handler specific flagsSascha Hauer2018-07-021-0/+4
| | | | | | | | | | Let the handler store 16 bit of handler specific flags in the generic handler struct. The setup functions of some bbu handlers let the user specify a flags field. With this change they can now pass generic and handler specific flags in a single variable without having to use a second parameter. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bbu: Make pointer to image constSascha Hauer2018-01-301-1/+1
| | | | | | | Make pointer to image in bbu data const so that we can put const pointers into that. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* imd: Make all pointers into image constSascha Hauer2018-01-301-1/+1
| | | | | | | The IMD code should be readonly and never modify any pointers. Make all pointers const so that const pointers can be passed in to IMD. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bbu: Add function to iterate over registered handlersSascha Hauer2017-09-271-0/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/imx-bbu-nand-fcb'Sascha Hauer2016-04-081-0/+1
|\
| * bbu: Allow to refresh/repair imagesSascha Hauer2016-04-081-0/+1
| | | | | | | | | | | | | | | | | | | | Some SoCs allow to store multiple boot images on a device in order to improve robustness. This adds a -r option to barebox_update to indicate we do not want to make an update but instead repair/refresh an existing image. Handlers which want to support this feature must set the BBU_HANDLER_CAN_REFRESH flag during registration. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | bbu: print and evaluate image MetadataSascha Hauer2016-04-061-0/+1
|/ | | | | | | | | | | With imd we can store metadata in barebox images. Let's use this information to further verify that the image that is to be flashed is the correct one. This patch extracts the device tree compatible from the image and compares it with the one from the currently running barebox. If it doesn't match the update is aborted with a warning. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bbu: Add function to check if an update handler existsMarkus Pargmann2016-02-181-0/+2
| | | | | | | | This adds a function to check for the existence of an update handler based on the supplied bbu_data. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/imx-bbu-nand-fcb'Sascha Hauer2015-07-031-0/+14
|\ | | | | | | | | Conflicts: common/Kconfig
| * imx-bbu-nand-fcb: make available for i.MX28 aswellSascha Hauer2015-06-121-0/+5
| | | | | | | | | | | | | | | | The code can be used with slight modifications on i.MX28 aswell. Add a i.MX28 registration function and move the differences to function callbacks. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: i.MX6: bbu nand: Move to common placeSascha Hauer2015-06-121-0/+9
| | | | | | | | | | | | The code can be used on i.MX28 aswell, so move it to a common place. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | bbu: Add a standard file-to-device-copy handlerSascha Hauer2015-07-011-0/+9
|/ | | | | | | | The most standard update handler will simply copy a file to a device. This can be shared across several users, so add a standard handler for this operation. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bbu: include necessary headersLucas Stach2015-03-041-0/+2
| | | | | | | Fixes compile errors due to undefined symbols. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* include/bbu: Add missing include errno.hMarkus Pargmann2014-07-291-0/+2
| | | | | Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Add in-system barebox update infrastructureSascha Hauer2012-10-171-0/+49
Currently in-system update means to write an arbitrary file to an arbitrary device. There is no sanity check if the flashed image is of the right type or will fit onto the device. Furthermore some SoCs need a special preparation step for their images before flashing them. This adds a barebox in-system update infrastructure. Boards can register update handlers which know how to make the board bootable. The available handlers can be listed to be able to select one, different force levels give the user the chance to know it better. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>