summaryrefslogtreecommitdiffstats
path: root/commands
Commit message (Collapse)AuthorAgeFilesLines
* Kconfig: Make ENV_HANDLING visibleSascha Hauer2016-04-281-2/+2
| | | | | | | | | ENV_HANDLING is usable even without explicit loadenv/saveenv command support. Instead of selecting this option from loadenv/saveenv, make this option visible. loadenv/saveenv can then depend on ENV_HANDLING rather than selecting it. This reduces Kconfig dependencies hassles. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Kconfig: Make GLOBALVAR visibleSascha Hauer2016-04-281-3/+2
| | | | | | | | | Currently global environment variables are only enabled when the "global" command is enabled. In fact, they could be used even with the "global" command disabled, so make the GLOBALVAR option visible. While at it, add a help text for this option. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/ubiformat'Sascha Hauer2016-04-083-7/+49
|\
| * ubiformat: Cleanly umount and detach the ubi before formatingMarkus Pargmann2016-04-081-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This was an open fixme for some time. ubiformat does not care about used ubi volumes or attached ubis. This patch adds functionality that umounts all filesystems that are mounted from this nand device. After that the ubi is detached. Then the normal ubiformat code reformats the ubi. If a ubi was detached previously, the code tries to reattach the ubi. Filesystems are not remounted. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * commands: ubidetach: Allow mtd devices as argumentSascha Hauer2016-04-081-4/+26
| | | | | | | | | | | | | | Instead of only allow ubi numbers make it possible to detach a mtd device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: ubi: make ubi_detach_mtd_dev ubi internalSascha Hauer2016-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | We want to extend the functionality of the ubi detach function, but we don't want to change the original detach function to make UBI updates easier. This adds a barebox specific detach function which encapsulates the original UBI function. Also this makes the original ubi detach function internal to ubi. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * fs: umount based on device path and mount pathMarkus Pargmann2016-04-081-1/+1
| | | | | | | | | | | | | | umount on Linux can be used on a mount pathes and device pathes. This patch adds this functionality to barebox. Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
* | Merge branch 'for-next/imx-bbu-nand-fcb'Sascha Hauer2016-04-086-115/+317
|\ \
| * | bbu: Allow to refresh/repair imagesSascha Hauer2016-04-081-10/+16
| |/ | | | | | | | | | | | | | | | | | | 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>
| * commands: Create nand_bitflip commandSascha Hauer2016-04-063-0/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a command to flip bits in a Nand flash. This is useful for testing purposes to check if flipped bits are corrected and if the driver returns the correct number of bitflips. The command writes a configurable number of bitflips to a single Nand page. If the -r option is not given the results are reproducible, so calling the same command twice will revert the bitflips. The command uses the raw read/write Nand operations which are probably less tested than the regular read/write operations, so the command may produce surprising results. As of writing the command has been tested with the GPMI Nand driver and the imx-nand driver with fixes posted. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * remove now unused libmtdSascha Hauer2016-04-061-1/+0
| | | | | | | | | | | | | | The only user of libmtd was ubiformat which now uses the mtd-peb API, so remove the now unused libmtd. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ubiformat: Use mtd-peb APISascha Hauer2016-04-061-91/+100
| | | | | | | | | | | | | | | | This changes ubiformat from the libmtd API to the mtd-peb API. This makes the libmtd API unnecessary and it can be removed in the next step. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: nand: Add option to print bbt in nand commandSascha Hauer2016-03-151-11/+40
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: Add support for marking blocks as goodSascha Hauer2016-03-151-5/+29
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | commands: nandtest: Fix wrong format specifierSascha Hauer2016-03-301-1/+1
|/ | | | | | Fixes: 1e009bf mtd: Make erase_info structs 64bit where necessary Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mtd'Sascha Hauer2016-03-111-2/+7
|\
| * mtd: core: check offset in mtd_block_markbadStefan Christ2016-02-231-2/+7
| | | | | | | | | | | | | | | | Check if the given offset is valid for the mtd device. Print an error message if not to inform the user in the command 'nand'. Signed-off-by: Stefan Christ <s.christ@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2016-03-114-1/+92
|\ \
| * | commands: Add of_fixup_statusTeresa Remmet2016-03-013-0/+91
| | | | | | | | | | | | | | | | | | | | | | | | of_fixup_status enables or disables the status property of a given node with a device tree fixup. Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | commands: magicvar: make locally used magicvar_find() staticAntony Pavlov2016-02-241-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | The patch fixes this compiler's warning: commands/magicvar.c:27:22: warning: no previous prototype for 'magicvar_find' [-Wmissing-prototypes] struct magicvar_dyn *magicvar_find(const char *name) ^ Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / commands: of_dump: Add description for -n optionSascha Hauer2016-02-121-1/+2
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/net'Sascha Hauer2016-02-081-28/+96
|\
| * miitool: Add code to register a PHYAndrey Smirnov2016-02-041-18/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes the behaviour of the 'miitool'. Now in order to show PHY's link information 'miitool' should be invoked as such: miitool -s [PHY] Also, implment code to allow to register a dummy PHY device in order to be able to perform raw MDIO bus access. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * miitool: Don't print negative parent IDsAndrey Smirnov2016-02-031-2/+3
| | | | | | | | | | | | | | | | | | Do not include ID of the parent to mii_bus if that ID is negative since it produces a rather confusing string (e.g. "mdio.11-1", which is very likely to be interpreted as "mdio.11<dash>1"). Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * miitool: Fix PHY argument handlingAndrey Smirnov2016-02-031-8/+17
| | | | | | | | | | | | | | | | | | | | | | Instead of displaying the status of PHY "PHY" the tool will print status of all PHYs it encounters while searching for the one that was requested. This commit fixes the logic such that only requested information is printed. Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2016-02-082-6/+8
|\ \
| * | Convert users of PRINTF_CONVERSION_RESOURCE to %paSascha Hauer2016-01-152-6/+8
| |/ | | | | | | | | | | | | | | printf now supports printing resource_size_t directly, convert all users of the previously used PRINTF_CONVERSION_RESOURCE over to %pa. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | bootm: add initial FIT supportJan Luebbe2016-01-261-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implementation is inspired by U-Boot's FIT support. Instead of using libfdt (which does not exist in barebox), configuration signatures are verified by using a simplified DT parser based on barebox's own code. Currently, only signed configurations with hashed images are supported, as the other variants are less useful for verified boot. Compatible FIT images can be created using U-Boot's mkimage tool. Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | bootm: make verifying/hashing configurableSascha Hauer2016-01-261-3/+9
| | | | | | | | | | | | | | | | | | So long struct bootm_data.verify is a bool which enables CRC checking (hashing). Extend this to a enum and add support for signature checking in the same option. This also adds the corresponding globalvar and a -s option to bootm. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | bootm: Initialize bootm_data defaults in single placeSascha Hauer2016-01-262-38/+7
| | | | | | | | | | | | | | | | Both the bootm and the boot code initialize the struct bootm_data with defaults from the bootm global variables. Create a common function for doing this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | bootm: Push dryrun to handlersSascha Hauer2016-01-261-3/+0
|/ | | | | | | We can make the dryrun option more useful by calling into the handlers. With this we can detect more cases that can go wrong during boot. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/rtc'Sascha Hauer2016-01-111-8/+32
|\
| * commands/hwclock: Check return value of rtc_read_time()Andrey Smirnov2016-01-071-2/+4
| | | | | | | | | | | | | | | | | | It is possible for rtc_read_time() to fill struct rtc_time it returns with invalid values, so we have to check for its return value before using returned time. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * hwclock: Allow to set hwclock from sntpSascha Hauer2016-01-071-1/+26
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * hwclock command: forward return value of rtc_set_timeSascha Hauer2016-01-071-2/+1
| | | | | | | | | | | | rtc_set_time can fail, forward the error to the user. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * hwclock command: use format like the Linux tool doesSascha Hauer2016-01-071-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Print three-letter abbreviations of the days and months. With a fixup by Andrey Smirnov: | common/date.c: Fix off-by-one error | | As per http://pubs.opengroup.org/onlinepubs/007908775/xsh/time.h.html | 'tm_wday' is zero indexed with zero representing Sunday, this is also | corroborated by the code in rtc_time_to_tm() which used 4 to represent | Thursday. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2016-01-111-2/+5
|\ \
| * | devfs: Add symlink supportSascha Hauer2016-01-081-2/+5
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/gcc5'Sascha Hauer2016-01-111-3/+2
|\ \ \ | |/ / |/| |
| * | ubiformat: fix the subpage size hint on the error pathSascha Hauer2015-12-101-3/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From mtd-utils commit: | commit 15685fe39f1665d53d8b316c8f837f20f8700d4b | Author: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | Date: Mon Sep 8 15:05:54 2014 +0300 | | ubiformat: fix the subpage size hint on the error path | | David Binderman <dcb314@hotmail.com> reports that the following piece of looks | wrong: | | if (!args.subpage_size != mtd->min_io_size) | normsg("may be sub-page size is incorrect?"); | | I totally agree with him and I believe that we actually meant to have no | negation in fron to f 'args.subpage_size', so instead, the code should look | like this: | | if (args.subpage_size != mtd->min_io_size) | normsg("may be sub-page size is incorrect?"); | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / memtest: fix missing arguments in help stringAlexander Aring2016-01-041-1/+1
|/ | | | | | | This patch adds some missing arguments in help string of memtest. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/state'Sascha Hauer2015-12-081-14/+5
|\
| * state: disable load commandEnrico Jorns2015-11-271-14/+5
| | | | | | | | | | | | | | | | | | Explicitly loading environment is not required as it will be loaded if available during device probing Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2015-12-082-4/+7
|\ \
| * | readline: Kconfig: fix typoWjatscheslaw Stoljarski2015-11-231-2/+2
| | | | | | | | | | | | | | | Signed-off-by: Wjatscheslaw Stoljarski <wjatscheslaw.stoljarski@kiwigrid.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ls: fix exitcodeSascha Hauer2015-11-171-2/+5
| |/ | | | | | | | | | | | | Once ls is called with a non-existing directory it should exit with a non-zero status. Fix that. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/i2c'Sascha Hauer2015-12-081-19/+37
|\ \
| * | i2c_probe: Make command easier to work withSascha Hauer2015-11-191-19/+37
| |/ | | | | | | | | | | | | | | Instead of insisting on multiple parameters just use sane defaults. This allows us to scan all addresses on all busses which is normally what one wants to get an overview over devices on i2c busses. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/console'Sascha Hauer2015-12-082-28/+56
|\ \
| * | loads: Use putchar rather than console_putcSascha Hauer2015-11-171-3/+3
| | | | | | | | | | | | | | | | | | | | | 'putchar' is a standard function to output a character. Use this one instead of the lower level console_putc. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>