summaryrefslogtreecommitdiffstats
path: root/commands
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/ubiformat'Sascha Hauer2016-05-092-651/+37
|\
| * ubiformat: use default values for ubi_ver and image_seqSascha Hauer2016-04-261-2/+0
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * commands: ubiformat: move code to common/Sascha Hauer2016-04-262-641/+3
| | | | | | | | | | | | | | This is the final step to separate the ubiformat code from the command. With this the ubiformat code gains a C API. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * commands: ubiformat: create separate function for ubiformatSascha Hauer2016-04-251-29/+54
| | | | | | | | | | | | | | Factor out the code out of the main function to a ubiformat function to separate the command code from the ubiformat functionality. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * commands: ubiformat: Pass around context dataSascha Hauer2016-04-251-120/+121
| | | | | | | | | | | | | | Instead of using a static global context data struct, pass the data around. This is a first step to create a C API for ubiformat. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2016-05-091-6/+5
|\ \
| * | Kconfig: Create Kconfig symbol for NVVARSascha Hauer2016-04-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nvvar support not only needs globalvar, but also persistent environment storage. Add a separate default-y option which depends on ENV_HANDLING for this case. Make the option visible to let the user decide whether he wants to have this option and add a help text to make this decision easier. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | 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/include-cleanup'Sascha Hauer2016-05-0924-86/+86
|\ \ \
| * | | commands: mmc_extcsd: Fix incorrect usage of sprintfAndrey Smirnov2016-04-281-33/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a number of places print_field_ge_v7() and print_field() function would call sprintf() without providing is with appropriate output buffer (str is initialized to NULL). Replace the sprintf() with basprintf() to fix that. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | stdio: Replace FILE functions with filedescriptor functionsSascha Hauer2016-04-151-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have defined stdin, stdout and stderr as integer file descriptors, but normally they should be FILE *. Also fprintf, fputc and fputs take file descriptors instead of FILE *. As FILE * are inconvenient in the barebox environment replace the f* functions with the corresponding d* functions. dprintf is POSIX conform whereas dputc and dputs are barebox specific, but do not conflict with any stdc function. fgetc is unused and can be removed without replacing it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | stdio: replace fprintf(stderr,...) with eprintfSascha Hauer2016-04-154-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a shortcut for fprintf(stderr, so use it. This is done to be able to remove fprintf in the next step. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | stdio: rename getc to getcharSascha Hauer2016-04-153-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The function we have implemented as getc has the semantics of the standard function getchar, so rename it accorgingly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | move unlink_recursive declaration to libfile.hSascha Hauer2016-04-152-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | unlink_recursive is a file utility function, so move the prototype to libfile.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | move make_directory declaration to libfile.hSascha Hauer2016-04-152-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | As a utility function for file handling make_directory() is well suited for libfile. Move it there. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | string: Fix (v)asprintf prototypesSascha Hauer2016-04-156-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our asprintf and vasprintf have different prototypes than the glibc functions. This causes trouble when we want to share barebox code with userspace code. Change the prototypes for (v)asprintf to match the glibc prototypes. Since the current (v)asprintf are convenient to use change the existing functions to b(v)asprintf. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | libfile: move open_and_lseek() to libfileSascha Hauer2016-04-157-23/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | libfile is a collection of helpers for handling files. open_and_lseek() is a perfect match for this, so move it there. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | include: move crc specific stuff to crc.hSascha Hauer2016-04-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a crc.h, so move our crc function prototypes there to further cleanup common.h. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/bootm'Sascha Hauer2016-05-091-0/+1
|\ \ \ \
| * | | | bootm: Optionally add a root= option to Kernel command lineSascha Hauer2016-05-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It becomes a common case that the Kernel is loaded from the filesystem which later becomes the rootfs. This adds a possibility to let bootm automatically append the root= option to the kernel command line. This is done when global.bootm.appendroot is true. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | | Merge branch 'for-next/arm'Sascha Hauer2016-05-091-13/+0
|\ \ \ \ \ | |/ / / / |/| | | |
| * | | | move FLEXIBLE_BOOTARGS from commands/ to common/Sascha Hauer2016-04-251-13/+0
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | FLEXIBLE_BOOTARGS also works without command support being enabled. Move this option from commands/Kconfig to common/Kconfig so that it doesn't depend on COMMAND_SUPPORT. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | documentation: i2c_read() does not expect any "DATA".Andreas Geisenhainer2016-04-281-1/+1
| |_|/ |/| | | | | | | | | | | | | | | | | Remove information about DATA from help text. Signed-off-by: Andreas Geisenhainer <Andreas.Geisenhainer@atsonline.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | fix erasing/protecting flashes with unspecified sizeSascha Hauer2016-04-191-1/+1
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fixes: 81737c1 mtd: Fix erasing of devices >4GiB Several places erased a complete flash partition passing ~0 as count to erase(). With the above commit count to erase was changed from an unsigned type to a signed type, so the (count > f->size - offset) check in erase() no longer triggers and the ~0 count is no longer adjusted to the whole device size. Among other things this results in saveenv failures on NOR flashes. This patch fixes this by introducing an explicit macro for erasing the whole device which is tested for in erase(). All other negative values are rejected. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reported-by: Giorgio <giorgio.nicole@arcor.de>
* | i2c_probe: fix wrong start and stop addressesMiquel Raynal2016-04-151-1/+1
|/ | | | | | | | | | This patch fixes the wrong range of i2c addresses used by the i2c_probe command when a stop address is provided. In this case the start address (startaddr) was taking the value of the stop address and the stop address (stopaddr) was always set to its default value. Signed-off-by: Miquel Raynal <raynal.miquel@gmail.com> 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
|\ \