summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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>
| * | state: Allow to load without authentificationSascha Hauer2017-03-317-15/+41
| | | | | | | | | | | | | | | | | | | | | Sometimes it's useful to be able to load a state even when it can't be authentificated. Add an option for this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | state: backend bucket circular: Explain metadataSascha Hauer2017-03-311-0/+5
| | | | | | | | | | | | | | | | | | Explain why we have metadata and where it is used. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | state: backend_circular: Set minumum writesize to 8Sascha Hauer2017-03-311-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | NOR flashes have a write size of 1. With this the metadata may end up on non-4-byte-aligned offsets. Force the minimum writesize to 8 so that the metadata is always at aligned offsets. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | state: backend_raw: alloc digest only when neededSascha Hauer2017-03-311-53/+59
| | | | | | | | | | | | | | | | | | | | | | | | Instead of deferring probe just allocate the digest when it's needed. This way the credentials can be added later, possibly on the commandline. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | crypto: digest: initialize earlierSascha Hauer2017-03-314-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Digests have dependencies and are needed for state which initializes at device_initcall level. To make sure the digests are available for state register them earlier, at coredevice_initcall level. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | commands: state: allow loading state with -lSascha Hauer2017-03-311-4/+9
| | | | | | | | | | | | | | | | | | | | | At least for testing purposes it's useful to be able to manually load a state. Add -l option for this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | commands: implement keystore commandSascha Hauer2017-03-313-0/+107
| | | | | | | | | | | | | | | | | | The keystore command provides access to the barebox keystore. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | keystore: implement forgetting secretsSascha Hauer2017-03-312-15/+42
| | | | | | | | | | | | | | | | | | To be able to change secrets add a function to forget secrets. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | state: backend_storage: rename more variablesSascha Hauer2017-03-311-6/+6
| | | | | | | | | | | | | | | | | | Use "buckets" rather than "copies" in variable names. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | state: backend_storage: make locally used variable staticSascha Hauer2017-03-311-1/+1
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | state: backend_storage: rewrite function docSascha Hauer2017-03-311-2/+2
| | | | | | | | | | | | | | | | | | | | | The function documentation for state_storage_file_buckets_init() is not very accurate. Rewrite it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | state: backend_storage: Rename variable desired_copies to desired_bucketsSascha Hauer2017-03-311-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | We defined what a bucket is, so rename the variable that holds the number of desired buckets from desired_copies to desired_buckets. While at it, make locally used variable static. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | state: backend_storage: Rename variable nr_copies to n_bucketsSascha Hauer2017-03-311-12/+12
| | | | | | | | | | | | | | | | | | | | | We defined what a bucket is, so use n_buckets when counting buckets, and not nr_copies. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | state: backend_circular: rewrite function docSascha Hauer2017-03-311-5/+3
| | | | | | | | | | | | | | | | | | | | | The commment talks about copies where buckets are meant and also claims we start at offset 0, which may not be true. Rewrite comment. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | state: backend_circular: default to circular storageSascha Hauer2017-03-312-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | Default to the new circular storage format which saves erase cycles. The old format can still be selected with backend-storage-type = "noncircular". Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | state: backend: Add some documentationSascha Hauer2017-03-312-1/+37
| | | | | | | | | | | | | | | | | | Write some sentences to make the concepts clearer. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | state: storage: direct: do not close file that is not openedSascha Hauer2017-03-311-1/+0
| | | | | | | | | | | | | | | | | | When open failed to not try to close the invalid fd afterwards. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | state: backend_circular: remove unnecessary warningSascha Hauer2017-03-311-4/+1
| | | | | | | | | | | | | | | | | | | | | It's expected that NAND flashes contain bad blocks, do not warn about them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | state: backend: Add more fields to struct state_backend_storageSascha Hauer2017-03-312-28/+26
| | | | | | | | | | | | | | | | | | To save a few function arguments. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>