summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* state: remove unused arguments from state_new_from_node()Sascha Hauer2018-02-221-2/+1
| | | | | | | | state_new_from_node() has arguments describing the backend path. These are never used in barebox, the backend path is always derived from the device nodes backend description. Remove these arguments. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/zstd'Sascha Hauer2018-02-083-0/+1395
|\
| * lib: Add zstd decompression modulePhilipp Zabel2018-02-051-0/+1157
| | | | | | | | | | | | | | Based on kernel commit 73f3d1b48f50 ("lib: Add zstd modules"). Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * lib: Add xxhash modulePhilipp Zabel2018-02-051-0/+236
| | | | | | | | | | | | | | Based on kernel commit 5d2405227a9e ("lib: Add xxhash module"). Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * include linux/compiler.h in linux/unaligned/generic.hPhilipp Zabel2018-02-051-0/+2
| | | | | | | | | | | | | | | | Without this include, the __force macro used in this header may be undefined. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/tftp-workaround'Sascha Hauer2018-02-084-17/+12
|\ \
| * | fs: remove now unused function can_lseek_backward()Sascha Hauer2018-01-251-20/+0
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | fs/uimagefs: Use is_tftp_fs() and cache_file() to ease TFTP workaroundSascha Hauer2018-01-251-1/+1
| | | | | | | | | | | | | | | | | | | | | We have helper functions now to ease file caching when a file is on TFTP. Use them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | uimage: Use is_tftp_fs() and cache_file() to ease TFTP workaroundSascha Hauer2018-01-251-0/+1
| | | | | | | | | | | | | | | | | | | | | We have helper functions now to ease file caching when a file is on TFTP. Use them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | libfile: implement a function to cache a fileSascha Hauer2018-01-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to the nature of TFTP which can't lseek and due to the silliness of our filesystem implementation which can't cache accesses we have to manually cache files on TFTP filesystems sometimes. Make it easier for them by providing a cache_file() function which copies the file from TFTP to RAM. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | libfile: implement make_tempSascha Hauer2018-01-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create a make_temp() function which creates a name for a temporary file. Since we do not have any concurrency in barebox we do not need to create the file right away and can leave that to the caller. Unlike unix mktemp the resulting filename is dynamically allocated and must be freed by the caller. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | fs: implement is_tftp_fs()Sascha Hauer2018-01-251-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some commands need files in which they can lseek backwards which is particularly not possible on TFTP. Instead of hiding this behind can_lseek_backward() create a function for it which tests if the file is on TFTP directly rather than using different lseek operations. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/ratp'Sascha Hauer2018-02-082-7/+4
|\ \ \
| * | | ratp: remove unused list pointer from ratp_bb_pktAleksander Morgado2018-01-301-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This struct type is used in the RATP FS implementation, but was never used as a list element anywhere. Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | ratp: move barebox-specific command to ratp_bb.hAleksander Morgado2018-01-302-5/+4
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | The ratp_run_command() is really an implementation detail of the barebox ratp 'command' operation support. Move it to the barebox specific header and rename it with the correct prefix. Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/of'Sascha Hauer2018-02-081-0/+5
|\ \ \
| * | | of: fdt: add of_unflatten_dtb_constSascha Hauer2018-01-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a variant of of_unflatten_dtb() which uses the property data directly from the input tree rather than copying it. This is mainly useful for a single user: FIT images. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | of: Allow for const propertiesSascha Hauer2018-01-311-0/+4
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for const properties. We add a const void *value_const to struct property which will not be modified. The value of a property should no longer be used directly, but with the of_property_get_value() accessor which picks the right value. With this we can unflatten dtbs and use the property values directly from the dtb instead of copying them. This is useful for device trees which (ab)use properties to store huge data files, aka FIT images. To create a property whose value is not copied but used from the original input data we introduce of_new_property_const(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/misc'Sascha Hauer2018-02-083-1/+4
|\ \ \
| * | | fs: add support loop mount offsetPhilipp Zabel2018-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When loop mounting, allow to specify an offset into the file, similarly to the losetup offset option. Multiplicative suffixes are supported. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | filetype: Add type detection at an offsetPhilipp Zabel2018-02-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add file_name_detect_type_offset to allow file system detection for loop mounts at an offset. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | fs/parseopt: Add parseopt_llu_suffixPhilipp Zabel2018-02-051-0/+2
| |/ / | | | | | | | | | | | | | | | | | | | | | Add an option parser using strtoull_suffix that can be used to parse a loop mount offset option. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/constify'Sascha Hauer2018-02-083-13/+14
|\ \ \
| * | | libfile: Make write_file buffer constSascha Hauer2018-01-311-1/+1
| | | | | | | | | | | | | | | | 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-302-11/+12
| |/ / | | | | | | | | | | | | | | | | | | 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>
* | | Merge branch 'for-next/FIT'Sascha Hauer2018-02-082-13/+16
|\ \ \
| * | | FIT: Allow to open buffer as FIT imageSascha Hauer2018-02-081-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | This adds fit_open_buf() which can open a buffer as FIT image. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | FIT: store device_nodes in fit_handleSascha Hauer2018-02-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need the /images and /configurations nodes more than once, so store them in the fit_handle rather than searching for them each time again. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | FIT: Let user specify the configuration to useSascha Hauer2018-02-082-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The images in FIT images can be opened in two different ways. They can be either opened directly based on their names in the images/ node or as part of a configuration based on their names in the corresponding /configuration/ node. So far we only supported the latter. To prepare supporting the former we return a cookie belonging to the configuration from fit_open_configuration() which we use in fit_open_image() to refer to the desired configuration. While at it document fit_open_configuration(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | FIT: Do not pre-open imagesSascha Hauer2018-02-081-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Only do what fit_open_configuration() suggests: open the configuration, but not the images in it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | bootm: FIT: do not depend on FIT pre-opened imagesSascha Hauer2018-02-081-0/+3
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | When calling fit_open_configuration the FIT code already opens the images "kernel", "ramdisk" and "dtb". This does not fit well into the FIT code, so make the bootm code independent of these pre-opened images so that we can drop the opening from the FIT code in the next step. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | / of: Add function to find the same node in another treeSascha Hauer2018-02-061-1/+4
| |/ |/| | | | | | | | | | | | | | | | | | | | | For our device tree fixups we have to find a node corresponding to another node in another device tree. We used to use the full name to match the nodes, but this falls apart when nodes get renamed or for example a new bus hierarchy is introduced. To make this more robust we create reproducible names from device nodes which mostly depend on the address in MMIO space, the reg property and as a last resort the name of the device node. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | reset: add missing stub for reset_control_getLucas Stach2018-02-051-0/+7
|/ | | | | | Fixes: 45b95b50cd0b (reset: add reset controller framework) Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2018-01-227-5/+23
|\
| * mci: drop unused parameter from mci_switch()Uwe Kleine-König2018-01-221-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SWITCH command has two purposes: a) switch the command set b) Write to the EXT_CSD register If the access field (bits [25:24]) in the argument are b00, we're in case a), otherwise in b). As mci_switch() always passes MMC_SWITCH_MODE_WRITE_BYTE (0b3) in the access field, only case b) is relevant here. According to the eMMC specification[1] the command set field is ignored in case b) and so the respective parameter (that is unused already now) can be dropped. [1] Embedded Multi-Media Card (e•MMC) Electrical Standard (5.1), February 2015; paragraph 6.6.1 Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * FIT: export fit_open_configuration() and fit_open_image()Sascha Hauer2018-01-181-1/+7
| | | | | | | | | | | | | | | | | | Currently only fit_open() is exported which only opens the predefined images "kernel", "dtb" and "ramdisk". To make the FIT code more usable for other code which may want to open other images export fit_open_configuration() and fit_open_image(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * parseopt: introduce parseopt_u16() and parseopt_str()Antony Pavlov2018-01-171-0/+2
| | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * include/parseopt.h: add guard macroAntony Pavlov2018-01-171-0/+5
| | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * move parseopt to lib/Antony Pavlov2018-01-171-0/+2
| | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * of: base: use root_node compatible as suggestion for a hostnameOleksij Rempel2018-01-172-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on some SoCs we can use generic PLL and RAM initialization. In this cases we create board file only to provide a host name. With this patch host name will be created from device tree compatible. For example: compatible = "board_vendor,board", "chip_vendor,soc" the host name will be: "board" This function will not overwrite a host name which is already set by board or machine code. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * linux/kernel.h: move ALIGN_DOWN() to include/linux/kernel.hMasahiro Yamada2018-01-052-2/+1
| | | | | | | | | | | | | | | | | | | | Linux commit ed067d4a859f ("linux/kernel.h: Add ALIGN_DOWN macro") moved ALIGN_DOWN to include/linux/kernel.h. Let's do likewise. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * string.h: Implement strndupUwe Kleine-König2018-01-051-0/+3
| | | | | | | | | | | | | | | | | | I implemented this while trying to import mmc-utils into barebox. While I didn't finish this import this function might still be useful for someone?! Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | file_list: Add ubi flagSascha Hauer2018-01-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | This flag is added to better support flashing UBI image with Android sparse images. Android fastboot splits images which are bigger than the free memory into multiple images which are then transferred in multiple fastboot sessions. In a session which is not the first one we can no longer detect if an image is a UBI image or not, so we need a flag to make this explicit. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | filetype: Add fastboot sparse format detectionSascha Hauer2018-01-171-0/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Add support for fastboot sparse imagesSascha Hauer2018-01-171-0/+67
| | | | | | | | | | | | | | | | This adds support for reading Android fastboot sparse images. This code is based on the corresponding U-Boot code, but has been heavily modified to provide a read-like API which better fits into barebox. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ubiformat: Add ubiformat write functionSascha Hauer2018-01-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | The ubiformat C API expects an image file as argument. With upcoming Android fastboot sparse image support we can no longer provide a complete image anymore. With this patch we can write an image in multiple chunks after we've formatted a MTD device with ubiformat. ubiformat_write will skip the EC header in both the MTD device we write to and also the image we read from, so we can flash an image on a MTD device containing EC headers already. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fs: implement ftruncateSascha Hauer2018-01-101-0/+1
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/net'Sascha Hauer2018-01-053-8/+48
|\
| * net: Add linuxdevname propertySascha Hauer2017-12-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you have a static network environment but more than one network device on your machine it is necessary to provide the <device> parameter to the ip parameter at kernel cmd line. The device name assigned by Linux cannot in general be predicted as it depends on driver bind order. This patch introduces a new property linux.devname to eth devices. The value is added to bootargs per interface and can be changed in env/network/INTF Based on patch by Gavin Schenk <g.schenk@eckelmann.de>. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>