summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Release v2017.05.4v2017.05.4stable/v2017.05Lucas Stach2017-07-141-1/+1
| | | | Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
* crypto: caam: use dma_alloc_coherent instead of dma_allocOleksij Rempel2017-07-141-3/+1
| | | | | | | | | | dma_alloc return non-coherent memory, but the driver does no cache maintenance on the buffer, causing memory corruption. Fix this by requesting coherent memory for the DMA transfer. Fixes: ef4144b4ab63 (crypto: caam - fix RNG buffer cache alignment) Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
* crypto: digest: Fix digesting over memory chunks > 4096 bytesUwe Kleine-König2017-07-141-0/+3
| | | | | | | | | | | | | | | | | | | There are two different cases that are handled in digest_file_window: a) the file to digest is memmappable (e.g. /dev/mem) b) it isn't (e.g. files in /) In both cases a file is digested in hunks of (up to) 4096 bytes. After each hunk in b) the buffer that is fed to digest_update() is then overwritten using read() to get the next hunk to digest. In case a) however it was forgotten to step forward in the buffer and instead the same data was handed to digest_update() again and again. So to fix that increase buffer by the number of bytes already digested for case a) which is characterized by flags == 0. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
* Release v2017.05.3v2017.05.3Sascha Hauer2017-06-281-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Revert "nv: Do not create globalvars from nvvars"Sascha Hauer2017-06-141-21/+21
| | | | This reverts commit 35d8e858bea17ec4796069c9c27fd0b134125eaf.
* Revert "globalvar: remove code for unqualified globalvars"Sascha Hauer2017-06-142-1/+43
| | | | This reverts commit e4f81050e098074792730b61563538d9e394e3d6.
* Revert "param: remove unnecessary device_d * argument"Sascha Hauer2017-06-141-2/+2
| | | | This reverts commit 0071bacb4c7cab21c9fab8540f5aa9922a270a85.
* Revert "globalvar: don't use nv_device if CONFIG_NVVAR is disabled"Sascha Hauer2017-06-141-11/+1
| | | | This reverts commit b378e8c9427b45d856d052a6df4a879a2cee670c.
* Revert "nv: Fix setting of nv.dev.<devname>.<param> variables"Sascha Hauer2017-06-141-23/+42
| | | | This reverts commit eaf884ba55def055fd81ff3291a1a534fc8bd8f9.
* Revert "globalvar: Fix value of new globalvar when nvvar exists"Sascha Hauer2017-06-141-2/+2
| | | | This reverts commit f8a177478c1b79e369ecc65501d9d15ff573339f.
* Release v2017.05.2v2017.05.2Sascha Hauer2017-06-131-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nv: Fix setting of nv.dev.<devname>.<param> variablesSascha Hauer2017-05-301-42/+23
| | | | | | | | | | | | | | | | | | nv variables with the form nv.dev.<devname>.<param> shall be mirrored to the device parameter <param> of the device named <devname>. This is broken since: | commit 35d8e858bea17ec4796069c9c27fd0b134125eaf | Author: Sascha Hauer <s.hauer@pengutronix.de> | Date: Thu Apr 6 15:23:56 2017 +0200 | | nv: Do not create globalvars from nvvars Fix this by attaching the setting of the mirror device parameter directly to the nv device rather than to the global device. Reported-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Makefile: Speed up evaluation of ld optionsv2017.05.1Sascha Hauer2017-05-242-4/+2
| | | | | | | | | Since "333ff7b1e4 Fix linking with new ld, based on u-boot" the build with multiple images became unreasonable slow. This is because the ld-option macro was evaluated once for each image. Fix this by exporting and using LDFLAGS_barebox from the main Makefile. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: imx: Only use clock when it existsSascha Hauer2017-05-241-4/+2
| | | | | | | | | | | | Fixes: bbe0df90b8e2463dd8db651e9f1dd57702985d2d I assumed all chipidea devices actually have a clock. This is true when looking at the device tree, but in barebox not all i.MX SoCs use the clocks provided by the device tree. Most instead use clkdev_add_physbase() to attach a clocks to devices. For these the chipidea device does not have a clock. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Fix linking with new ld, based on u-bootAndrey Panov2017-05-243-1/+7
| | | | | | | | U-boot commit info: http://git.denx.de/?p=u-boot.git;a=commit;h=e391b1e64b0bd65709a28a4764afe4f32d408243 Signed-off-by: Andrey Panov <rockford@yandex.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* param: fix stub prototype of dev_add_paramLucas Stach2017-05-241-2/+2
| | | | | Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: of_find_node_by_devpath: Fix offset in mtd devicesSascha Hauer2017-05-241-1/+4
| | | | | | | When a cdev is a mtd device the partition offset must be used from there, not from the cdev. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* globalvar: Fix value of new globalvar when nvvar existsSascha Hauer2017-05-241-2/+2
| | | | | | | | | | | | | When a new globalvar with a value is created and the corresponding nvvar exists, then the globalvar gets the value of the nvvar, not from the newly assigned value as expected. nv quux=foo; global quux=bar; echo ${global.quux} Should give "bar", not "foo". Fix this. Reported-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clock: initialize dummy clocksource staticallySascha Hauer2017-05-241-6/+1
| | | | | | | | | | | | | | | | | | | | Assigning the dummy clocksource in a initcall has the problem that get_time_ns() crashes before that initcall is executed. This happens when dmesg support is enabled in conjunction with CONFIG_DEBUG_INITCALLS. In this case the dmesg code wants to have the timestamp of a log message. Solve this by setting the current clocksource to the dummy clock statically and not at runtime. This way we always have a dummy clock available. Fixes: commit 8972eb7ff17ad058a6c6018305bb912138ab0ca2 Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Date: Fri Mar 3 13:34:02 2017 +0100 clocksource: move dummy clock source to init_clock Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Release v2017.05.0v2017.05.0Sascha Hauer2017-05-051-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm: mach-omap: Change file flags in emmc handlerDaniel Schultz2017-05-051-1/+1
| | | | | | | | | This handler tries to read from a file descriptor with 'write only' flags and fails. Add read permissions for the file, so the handler can read the partition layout. Signed-off-by: Daniel Schultz <d.schultz@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* param: fix stub prototype const annotationLucas Stach2017-04-261-1/+1
| | | | | Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: ifup needs to be able to run commandsLucas Stach2017-04-261-0/+1
| | | | | Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* HAB: don't reference unused HAB opsLucas Stach2017-04-261-2/+2
| | | | | Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common: BLSPEC needs boot infrastructure and at least simple command supportLucas Stach2017-04-261-0/+3
| | | | | Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* globalvar: don't use nv_device if CONFIG_NVVAR is disabledAntony Pavlov2017-04-251-1/+11
| | | | | | | | | | | | | | | | | | | At the moment barebox crashes if CONFIG_NVVAR is disabled because of access to unregistered nv_device in get_param_by_name(&nv_device, "version"). How to reproduce the crash: barebox$ unset ARCH barebox$ unset CROSS_COMPILE barebox$ make sandbox_defconfig barebox$ sed -i "s/CONFIG_ENV_HANDLING=y/# CONFIG_ENV_HANDLING is not set/" .config barebox$ make oldconfig barebox$ ./barebox Segmentation fault Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: backend_raw: init digest earlierSascha Hauer2017-04-241-4/+6
| | | | | | | | | In backend_format_raw_pack() digest_length is used before it's initialized in backend_raw_digest_init() which results in a too small memory allocation for the raw backend. Fix this and prevent a memory corruption. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: Fix "pack" returning freed data for DTB backendIan Abbott2017-04-211-2/+0
| | | | | | | | | | | | | | | | `state_backend_format_dtb_pack()` passes a buffer containing state packed in flattened DTB format back to its caller via its `buf` parameter. It then frees the buffer before returning. This means the caller (`state_save()`) will be working on freed buffer contents before freeing the buffer a second time itself. Fix it by removing the spurious call to `free()`. This should fix a bug reported by Norbert Wiedmann in <http://lists.infradead.org/pipermail/barebox/2017-April/029980.html>. Cc: Norbert Wiedmann <info@n-wiedmann.de> Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: cache-l2x0: honour aux_val when determing way sizeSascha Hauer2017-04-211-4/+3
| | | | | | | | | | | | | | l2x0_init() allows to overwrite bits in the AUX_CTRL register using the aux_val/aux_mask arguments. On i.MX35 this is used to pass a correct AUX_CTRL value to overwrite bogus reset values for this register. To make this work we have to apply aux_val/aux_mask before using the AUX_CTRL value to determine the way size. This fixes: 3f7e890da7 ARM: l2x0: Implement L310 support Before this commit the way size was hardcoded to 8. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: Fix error return valueSascha Hauer2017-04-191-0/+1
| | | | | | | When the backend phandle cannot be resolved we jump to the error return path without initializing ret. Fix this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91sam9x5ek: Actually build imageSascha Hauer2017-04-191-2/+2
| | | | | | | | The Kconfig variable is named CONFIG_MACH_AT91SAM9X5EK, not MACH_AT91SAM9X5EK. Reported-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: backend_storage: Set needs_refresh back to 0 after refreshingSascha Hauer2017-04-191-2/+4
| | | | | | | | | | Set needs_refresh back to 0 after refreshing so that we do not refresh it again without need. This would only happen when we read the state from the storage multiple times, which normally is not the case. However, it's more consistent like this. Reported-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: backend_bucket_circular: Do not leak memorySascha Hauer2017-04-191-2/+4
| | | | | | | buf was just allocated, free it before returning an error. Reported-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: nand_omap_gpmc: fix BCH error correctionMatt Reimer2017-04-191-1/+2
| | | | | | | | | | | | | | | | | | | BCH error detection and correction was only looking at the first of four syndrome polynomials, which meant it was failing to detect and correct bitflips in the last 3/4 of the data. In effect, only the first 512 bytes of a 2048 byte page were being protected by ECC. The syndrome polynomials (BCH error codes) are stored in the NAND's OOB, each of which protects 512 bytes of data. The driver used eccsteps = 1 which effectively made it only use the first polynomial, and therefore was only protecting the first 512 bytes of the page. The fix is to pull over a bit of code from the kernel's omap_correct_data() that sets eccsteps = 4 when the page size is 2048 bytes and hardware ECC is being used. Signed-off-by: Matt Reimer <mreimer@sdgsystems.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: imx: HAB needs fuse driver supportLucas Stach2017-04-191-0/+2
| | | | | Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: of: only add partition layout param when GLOBAL support is enabledLucas Stach2017-04-191-3/+5
| | | | | | Fixes: a2fa18f9f483 (mtd: of: Make used partition binding configurable) Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common: bootchooser: add dependenciesLucas Stach2017-04-191-0/+3
| | | | | | | | Bootchooser isn't worth much without the boot infrastructure, also it needs at least the simple shell variant to be enabled. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: squashfs: fix "no previous prototype for 'squashfs_set_rootarg'" warningAntony Pavlov2017-04-101-1/+2
| | | | | | | | | | | The patch fixes this compiler's warning: fs/squashfs/squashfs.c:115:6: warning: no previous prototype for 'squashfs_set_rootarg' [-Wmissing-prototypes] void squashfs_set_rootarg(struct squashfs_priv *priv, struct fs_device_d *fsdev) ^ Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/tegra'Sascha Hauer2017-04-078-6/+130
|\
| * ARM: tegra: enable Tegra124 memory controller driver in defconfigLucas Stach2017-03-301-0/+1
| | | | | | | | | | Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * add driver for Tegra124 memory controllerLucas Stach2017-03-305-0/+89
| | | | | | | | | | | | | | | | This driver performs the required initialization to get the GPU into a functional state, so it can be used when the OS is running. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: tegra: jetson-tk1: use phandle for stdout pathLucas Stach2017-03-301-1/+1
| | | | | | | | | | | | | | | | Now that the UARTs have phandles in the upstream DT, we can make use of them in Barebox. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: tegra124: use old XUSB bindingLucas Stach2017-03-301-0/+34
| | | | | | | | | | | | | | | | | | | | The XUSB binding was changed upstream, to allow for more flexibility needed to support USB3. The barebox driver has not been adapted to this change. Add back the old DT properties in the Barebox internal DT to keep the existing PCIe functionality working. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: tegra: jetson-tk1: adapt internal DT paths to changed upstream DTLucas Stach2017-03-302-5/+5
| | | | | | | | | | | | | | | | The upstream DT changed the node names, so the barebox internal references didn't work anymore. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/state'Sascha Hauer2017-04-0725-887/+713
|\ \
| * | state: remove unused variable typeSascha Hauer2017-04-043-17/+0
| | | | | | | | | | | | | | | | | | enum state_variable_type is never used. Remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | state: find device node from device path, not from device node pathSascha Hauer2017-03-312-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | The device node path may change from the internal device tree to the one Linux is started with, so using this path to fixup the tree is not very robust. Instead, use of_find_node_by_devpath() which has been created for exactly this purpose. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | state: Remove -EUCLEAN check from userspace toolSascha Hauer2017-03-311-21/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The state code is used for the userspace tool aswell, kept in sync manually. This patch only introduces a change for the userspace tool, not for barebox. In Linux userspace there is no direct possibility to check for -EUCLEAN. To indirectly check for -EUCLEAN the state tool reads the number of corrected bits before and after reading a block. Unfortunately it does not take the number of acceptable bitflips into account, but instead returns -EUCLEAN even when only a single bitflip occurred on a whole page. To be correct the algorithm must be more complicated: We would have to read the bitflip_threshold from sysfs. This value is per ECC step (often 512 byte), not per page. We would have to read the page in ECC step size chunks, testing for bitflips lower than the threshold for each chunk. Even if we would do that, there's still another issue. The eccstats ioctl delivers the eccstats for the whole device, so a concurrent reader would falsify the result. Let's decide that this is not worth the hassle and assume that no device has enough uptime that a cleanup in barebox is not sufficient. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | state: Do not load state during state_new_from_nodeSascha Hauer2017-03-312-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | The caller of state_new_from_node() may have it's own ideas what to do when loading the state fails, so do not load it in the initialization function, but instead let the caller do it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | state: Update documentationSascha Hauer2017-03-311-7/+26
| | | | | | | | | | | | | | | | | | | | | | | | - explain what buckets are - rework text about storage backends - explain redundancy concept Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>