summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* ratp: allow building without full console supportAleksander Morgado2018-03-015-6/+8
| | | | | | | | | | | | | Make CONFIG_RATP a selectable config option, so that the user can enable RATP support without explicitly needing to enable the full console support over RATP (e.g. only for RATP FS or built-in command support). The full console can still be explicitly enabled with CONFIG_CONSOLE_RATP. Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ratp: moved logic to its own subdirectoryAleksander Morgado2018-03-015-14/+18
| | | | | | | | We are going to add new RATP command implementations in separate files within this subdirectory. Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ratp: implement generic command supportAleksander Morgado2018-03-0116-18/+171
| | | | | | | | | | | | | | | | | | | The RATP implementation now allows executing generic commands with a binary interface: binary requests are received and binary responses are returned. Each command can define its own RATP request contents (e.g. to specify command-specific options) as well as its own RATP response contents (if any data is to be returned). Each command is associated with a pair of numeric unique request and response IDs, and for easy reference these IDs are maintained in the common ratp_bb header. Modules may override generic implemented commands or include their own new ones (as long as the numeric IDs introduced are unique). Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: find backend node with its reproducible nameSascha Hauer2018-02-222-1/+6
| | | | | | | | | | | | When fixing up the kernels state nodes we depended on the full node path of the input device tree. This does not work when the kernel device tree has different names. This has happened lately when the i.MX6 device trees got their leading zeroes removed from the node names. Use of_find_node_by_reproducible_name() to find the node corresponding to the storage backend node in the kernel device tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: remove unused arguments from state_new_from_node()Sascha Hauer2018-02-224-32/+19
| | | | | | | | 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>
* scripts/compiler.h: inline functions in headers must be staticMichael Olbrich2018-02-091-2/+2
| | | | | | | | | | | | | | | | | | Without this building bareboxenv-target with gcc 7.3 fails with: CC scripts/bareboxenv-target /tmp/cc9G2oOY.o: In function `file_action': bareboxenv.c:(.text+0x14): undefined reference to `xzalloc' /tmp/cc9G2oOY.o: In function `concat_path_file': bareboxenv.c:(.text+0xf4): undefined reference to `xmalloc' /tmp/cc9G2oOY.o: In function `envfs_save': bareboxenv.c:(.text+0x5b4): undefined reference to `xzalloc' /tmp/cc9G2oOY.o: In function `envfs_load': bareboxenv.c:(.text+0x7d8): undefined reference to `xmalloc' collect2: error: ld returned 1 exit status Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c: i2c_master_send(): don't leave flags uninitializedAntony Pavlov2018-02-091-0/+1
| | | | | | | | Leaving the flags field unitialized can lead to performing read operation instead of write operation. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* FIT: Use const dtb unflatten variantSascha Hauer2018-02-081-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/zstd'Sascha Hauer2018-02-0825-0/+8860
|\
| * squashfs: Add zstd supportPhilipp Zabel2018-02-056-0/+169
| | | | | | | | | | | | | | | | | | | | Based on kernel commit 87bf54bb43dd ("squashfs: Add zstd support"). Creating zstd compressed squashfs images is supported by squashfs-tools newer than commit e38956b92f73 ("squashfs-tools: Add zstd support"). Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * lib: Add zstd decompression modulePhilipp Zabel2018-02-0516-0/+7949
| | | | | | | | | | | | | | 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-054-0/+740
| | | | | | | | | | | | | | 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-089-66/+127
|\ \
| * | 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-252-25/+14
| | | | | | | | | | | | | | | | | | | | | 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-252-25/+23
| | | | | | | | | | | | | | | | | | | | | 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: fix memory leak in error pathSascha Hauer2018-01-251-0/+2
| | | | | | | | | | | | | | | | | | | | | handle->name is dynamically allocated, so free it in the error path. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reported-by: Stefan Lengfeld <contact@stefanchrist.eu>
| * | libfile: implement a function to cache a fileSascha Hauer2018-01-252-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-252-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-252-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | startup: create /tmpSascha Hauer2018-01-231-0/+1
| | | | | | | | | | | | | | | | | | | | | Some commands create temporary files in /. Create /tmp to offer these commands an appropriate place for storing temporary files. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/sandbox-libftdi'Sascha Hauer2018-02-0810-3/+414
|\ \ \
| * | | sandbox: add i2c and spi libftdi1 bit-bang exampleAntony Pavlov2018-01-292-1/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make necessary changes in sandbox_defconfig: enable gpio, spi, i2c and led stuff. Usage: barebox$ make sandbox_defconfig barebox$ sed -i "s/# CONFIG_GPIO_LIBFTDI1.*$/CONFIG_GPIO_LIBFTDI1=y/" .config # edit arch/sandbox/dts/sandbox-libftdi-example.dtsi barebox$ echo '#include "sandbox-libftdi-example.dtsi"' >> arch/sandbox/dts/sandbox.dts barebox$ make barebox$ sudo ./barebox -d arch/sandbox/dts/sandbox.dtb Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | sandbox: add gpio support with libftdi1Antony Pavlov2018-01-298-1/+317
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | sandbox: avoid symbol conflict for {open,read,close}dirAntony Pavlov2018-01-291-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes libusb's /dev/bus/usb directory scan. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/ratp'Sascha Hauer2018-02-084-25/+16
|\ \ \ \
| * | | | ratp: remove unused context fieldsAleksander Morgado2018-01-301-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | 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-304-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | | ratp: rename global context variableAleksander Morgado2018-01-301-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'ratp_command_ctx' seems to specify that this variable is only used to process command operations, but it really is used in every async operation (e.g. also in FS), so just rename it to a more generic name for clarity. 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-085-35/+132
|\ \ \ \ \
| * | | | | of: fdt: add of_unflatten_dtb_constSascha Hauer2018-01-312-2/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-313-21/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | | | pinctrl: do not dereference a device tree property directlySascha Hauer2018-01-311-12/+6
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use of_get_property() rather than of_find_property() to avoid dereferencing a struct property directly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | | Merge branch 'for-next/misc'Sascha Hauer2018-02-0825-58/+137
|\ \ \ \ \
| * | | | | env: Add more context to error messageSascha Hauer2018-02-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When setenv complains that it can't set a device parameter, then print which parameter it tried to set. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | bootchooser: Drop SHELL_NONE conflictSascha Hauer2018-02-061-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Earlier versions of the bootchooser code executed scripts, thus had to depend on shell support. We do not need this anymore, so the dependency can be dropped. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | boot: Make independent of command supportSascha Hauer2018-02-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The boot code works with command support disabled if we skip support for boot scripts. Bail out before parsing boot scripts and allow to build with command support disabled. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | net: phy: fixed-link: read link parameters from devicetreeLucas Stach2018-02-061-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement the missing reading of the fixed link parameters from the devicetree properties. Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
| * | | | | startup: Load default environment earlierSascha Hauer2018-02-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some files compiled into the default environment may be needed earlier in the boot process, so move loading of the default environment to fs_initcall. Only the default environment is loaded earlier, but not the overwriting with the persistent environment files, so when the files are used that early, only the compiled in version is available; it's not overwritable at that time. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | state: Add 'init_from_defaults' parameterSascha Hauer2018-02-062-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The init_from_defaults parameter allows to detect if a state has been initialized from default values, i.e. state_load failed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | state: refuse to set dirty parameter via setenvSascha Hauer2018-02-061-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dirty parameter is readonly, so refuse to set it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | pstore: lower message prioritySascha Hauer2018-02-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having no valid data in pstore after a coldstart is pretty much expected, so do not print a scary error message, but a debug message instead. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | fs: add support loop mount offsetPhilipp Zabel2018-02-053-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-052-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-052-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | | | rsa: Add missing newline to pr_err messagesSascha Hauer2018-01-301-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | ARM: configs: am335x_defconfig: Reorder configsDaniel Schultz2018-01-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These configs were added directly in the config file and not with menuconfig. Reorder these like menuconfig would place them. Signed-off-by: Daniel Schultz <d.schultz@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | commands: ubi: ubiupdatevol: Reduce error code to 0 or 1Daniel Schultz2018-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | do_ubiupdatevol can either return 0 or the ioctl return value. This is not in conformity with the other ubi comannds return values. Signed-off-by: Daniel Schultz <d.schultz@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>