summaryrefslogtreecommitdiffstats
path: root/commands
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/usb'Sascha Hauer2018-11-092-62/+11
|\
| * usbgadget: autostart: add DFU supportLadislav Michl2018-10-292-62/+11
| | | | | | | | | | | | | | | | | | | | | | Use global variable dfu_function to autostart DFU. As similar code is used to start multifunction gadget using command, move common code to common/usbgadget.c and consolidate it. It turned out that '-s' option of usbgadget command does nothing, so remove its help text and make it function as '-a'. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2018-11-092-2/+3
|\ \
| * | commands: mem: truncate mem device size to fit the loff_t file sizeLucas Stach2018-11-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On 64bit arches the file covering the whole address space is larger than what can be represented in the loff_t type (s64) used for the file size. Thus the size of this device is interpreted as negative in a lot of places. Fix this by truncating the size to fit the file size type. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | miitool: Fix inconsistent spacingAndrey Smirnov2018-10-161-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure that there's a space between device name and it's status string regardless if if device is using "id" field or not. Before: barebox@ZII RDU2 Board:/ miitool mdio0-phy00: mdio:no link mdio1-phy15: 2188000.ethernet@2188000:10 Mbit, half duplex, no link mdio1-phy16: 2188000.ethernet@2188000:10 Mbit, half duplex, no link mdio2-phy00: 2188000.ethernet@2188000:mdio:switch@0:no link mdio2-phy01: 2188000.ethernet@2188000:mdio:switch@0:no link mdio2-phy02: 2188000.ethernet@2188000:mdio:switch@0:negotiated 100baseTx-FD, link ok mdio2-phy03: 2188000.ethernet@2188000:mdio:switch@0:no link mdio2-phy04: 2188000.ethernet@2188000:mdio:switch@0:no link mdio3-phy01: eth1: negotiated 1000baseT-FD flow-control, link ok After: barebox@ZII RDU2 Board:/ miitool mdio0-phy00: mdio: no link mdio1-phy15: 2188000.ethernet@2188000: 10 Mbit, half duplex, no link mdio1-phy16: 2188000.ethernet@2188000: 10 Mbit, half duplex, no link mdio2-phy00: 2188000.ethernet@2188000:mdio:switch@0: no link mdio2-phy01: 2188000.ethernet@2188000:mdio:switch@0: no link mdio2-phy02: 2188000.ethernet@2188000:mdio:switch@0: no link mdio2-phy03: 2188000.ethernet@2188000:mdio:switch@0: no link mdio2-phy04: 2188000.ethernet@2188000:mdio:switch@0: no link mdio3-phy01: eth1: no link Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | commands: gpio: Allow GPIOs to be specified by labelAndrey Smirnov2018-10-291-4/+7
| | | | | | | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | commands: gpio: Use kstrtoint() instead of simple_strtoul()Andrey Smirnov2018-10-291-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use kstrtoint() instead of simple_strtoul() in order to properly handle invalid arguments. Current code using simple_strtoul() results in following: barebox@ZII RDU2 Board:/ gpio_get_value foo barebox@ZII RDU2 Board:/ echo $? 0 whereas with this patch we get: barebox@ZII RDU2 Board:/ gpio_get_value foo gpio_get_value: Invalid argument Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | commands: gpio: Move argument parsing into a shared functionAndrey Smirnov2018-10-291-19/+29
|/ | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2018-10-092-5/+7
|\
| * environment: Allow default env path to be NULLSascha Hauer2018-09-211-0/+4
| | | | | | | | | | | | | | Several places assume that the default environment path cannot be NULL. Allow NULL here without crashing. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * memtest: Make use of resource_size()Andrey Smirnov2018-09-191-2/+1
| | | | | | | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * memtest: Adjust code for 64-bit architecturesAndrey Smirnov2018-09-191-3/+2
| | | | | | | | | | | | | | | | | | Make use of %pa specifier to avoid warnings when building against 64-bit CPU (specifically AArch64) as well as adjust a number of patterns to be 64-bits wide. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | bbu: command: Make sure specified update handler existsAndrey Smirnov2018-10-081-10/+36
| | | | | | | | | | | | | | | | Add code to verify that update handler specified with either -t or of -d exists before commencing the update procedure. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | bbu: Add "handler" parameter to barebox_update()Andrey Smirnov2018-10-081-1/+10
|/ | | | | | | | | | | | Add "handler" parameter to barebox_update() and remove the code that was respondible for header lookup before. With this change finding appropriate handler is caller's responsibility, which makes it possible to implement custom handler lookup/existence check, chache it, and then re-use it without calling handler_find_by_* functions for the second time. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2018-09-112-12/+30
|\
| * i2c_read: implement support for master receive modeAleksander Morgado2018-08-221-6/+15
| | | | | | | | | | | | | | | | If no start register is explicitly given, receive data in master receive mode. Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * i2c_write: document master send modeAleksander Morgado2018-08-221-3/+7
| | | | | | | | | | | | | | | | When no explicit start register is given, the i2c message is emitted in master send mode. Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * nand command: fix null pointer when adding/deleting a bb deviceOleg.Karfich@wago.com2018-08-171-3/+8
| | | | | | | | | | | | | | | | | | | | | | Commit 40ee300 introduces info option about bad blocks. The open() function call is therefore moved out from mark good/bad block to use the filedescriptor in info option too. If someone tries to add/delete a bb device the optind variable is incremented and the open() call gets a null pointer. Fix this issue by returning when the bb device is added/deleted. Signed-off-by: Oleg Karfich <oleg.karfich@wago.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | commands: dhcp: add parameter for private dataOleg.Karfich@wago.com2018-09-042-5/+10
| | | | | | | | | | Signed-off-by: Oleg Karfich <oleg.karfich@wago.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | commands: of_property: copy value instead of resizingOleg.Karfich@wago.com2018-08-291-2/+1
|/ | | | | | | | | | | | | | Commit 748d1b8 adds the fixup feature to the above command. With this commit an unwanted free(data) on the freshly set property value is done if someone tries to set the value of an already present property (not the case for a new property). Furthermore in fixup mode the pointer fixup->data is freed when the fixup function is called more than once. This leads to a hanging system after calling of_dump -F many times. Fix this issues by copying the data to a new allocated memory area like a new property is created. Signed-off-by: Oleg Karfich <oleg.karfich@wago.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2018-08-131-4/+3
|\
| * of_node: clarify help text and do stricter commandline parsingUwe Kleine-König2018-08-081-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To create an oftree node /path/node I tried after reading the help text of of_node: of_node -c /path node similar to the syntax of of_property. This didnt result in any output but still failed to do what I meant. So clarify the help text to not suggest there are two parameters and return an usage error if still two (or more) names are passed. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | commands: teach commands that write to files to also create themUwe Kleine-König2018-08-103-3/+3
|/ | | | | | | | | | This allows to use the adapted commands on non-existing files which failed before with open: No such file or directory Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2018-07-092-10/+26
|\
| * commands: mmc_extcsd: Make use of devpath_to_name()Andrey Smirnov2018-06-251-3/+2
| | | | | | | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * commands: mount: Make use of devpath_to_name()Andrey Smirnov2018-06-251-4/+1
| | | | | | | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mmc_extcsd command: Add cmd option to set bkops-enableChristoph Fritz2018-06-201-3/+23
| | | | | | | | | | | | | | | | This patch is for convenience to set bkops-enable (EXT_CSD_BKOPS_EN[163]) on devices which have it not yet activated. Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | commands: oftree: kill oftree -fSascha Hauer2018-06-111-16/+1
|/ | | | | | | | | | Being able to free the live device tree seemed like a good idea in the early days of device tree support when the first boards were brought up. It turned out to be illusory that noone stores pointers to the live tree which become invalid when oftree -f is executed. Enough people stumbled upon crashed boards with this option, so remove it finally. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: mmc_extcsd: Add support to write multibyte registersTeresa Remmet2018-06-081-17/+27
| | | | | | | | | It has been possible to write only the first byte of a multibyte register. Updated the command to write the complete value of a multibyte register at once. Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Reviewed-by: Bastian Stender <bst@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands/of_node: add option to apply changes as fixupBaeuerle, Florian2018-05-281-31/+75
| | | | | | | | | | Analogous to the of_property command, add an -f option to the of_node command. This option defers the device tree modification until boot time and thus applies the modification as a fixup on the linux device tree. Signed-off-by: Florian Bäuerle <florian.baeuerle@allegion.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands/of_property: add option to apply changes as fixupBaeuerle, Florian2018-05-281-53/+138
| | | | | | | | | Add an -f option to the of_property command, which defers the device tree modification until boot time and thus applies the modification as a fixup on the linux device tree. Signed-off-by: Florian Bäuerle <florian.baeuerle@allegion.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mw command: add `-x` option descriptionPeter Mamonov2018-05-241-1/+2
| | | | | Signed-off-by: Peter Mamonov <pmamonov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: i2c_write: enable reg == 0 tooAntony Pavlov2018-04-171-1/+1
| | | | | | | | | | | | | This commit fixes the mistake introduced in the commit 34fadb685905 ('commands: i2c_write: enable raw write to address'). The intended behaviour for i2c_write command is "use raw i2c write only if reg address is not defined". Before the commit 34fadb685905 reg address == 0 was acceptable. After the commit 34fadb685905 reg address == 0 became unacceptable ("undefined") and will lead to raw i2c write. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/fs'Sascha Hauer2018-04-064-16/+9
|\
| * loadenv: Do not depend on normalise_path()Sascha Hauer2018-04-061-5/+1
| | | | | | | | | | | | normalise_path() will go away, so do without it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ls: Do not depend on normalise_path()Sascha Hauer2018-04-061-6/+3
| | | | | | | | | | | | | | When we want to show a directory we want to show the path ls is passed, not the normalised one. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * rename file_operations -> cdev_operationsSascha Hauer2018-04-062-5/+5
| | | | | | | | | | | | | | | | Linux also has struct file_operations which are something different. Rename our file_operations to cdev_operations which better matches what we have. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: aarch64: disable 32bit boot commandsSascha Hauer2018-04-041-2/+2
|/ | | | | | | | The 32bit boot support is full of legacy cruft. While it should be possible to merge the aarch64 support there, a fresh start looks more promising. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: i2c_write: enable raw write to addressAntony Pavlov2018-02-091-2/+6
| | | | | | | | | | | | | | | | | | | | Sometimes for communication with a simple I2C devices (e.g. PCF8574 or TM1650) it's necessary to send only one data byte into the I2C device. Current i2c_write command makes this impossible because you can't just pass 'device address' and 'register number' (or 'device address' and 'one data byte') to the command. You always have to pass all three parameters: 'device address', 'register number' and 'data'. This commit fixes the problem. Sample usage: barebox@barebox sandbox:/ i2c_write -a 0x24 0x01 Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/of'Sascha Hauer2018-02-081-0/+1
|\
| * of: Allow for const propertiesSascha Hauer2018-01-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge branch 'for-next/misc'Sascha Hauer2018-02-081-1/+1
|\ \
| * | 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>
* | | bbu: command: create temporary variable holding the pointer to the imageSascha Hauer2018-01-301-3/+5
| |/ |/| | | | | | | | | | | Create variable to hold the pointer to the image so that we can make the data.image pointer const later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | commands/Kconfig: fix copy'n'paste error in CMD_GPIO helpUlrich Ölmann2018-01-251-1/+1
|/ | | | | Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2018-01-222-8/+8
|\
| * mci: drop unused parameter from mci_switch()Uwe Kleine-König2018-01-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SWITCH command has two purposes: a) switch the command set b) Write to the EXT_CSD register If the access field (bits [25:24]) in the argument are b00, we're in case a), otherwise in b). As mci_switch() always passes MMC_SWITCH_MODE_WRITE_BYTE (0b3) in the access field, only case b) is relevant here. According to the eMMC specification[1] the command set field is ignored in case b) and so the respective parameter (that is unused already now) can be dropped. [1] Embedded Multi-Media Card (e•MMC) Electrical Standard (5.1), February 2015; paragraph 6.6.1 Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usbgadget: Update command help textSascha Hauer2018-01-111-7/+7
| | | | | | | | | | | | | | | | | | - Do not use BAREBOX_CMD_HELP_OPT with an empty option to extend the previous option text. It confuses the rst converter - Add a '\t' to the options to align the option help texts in the barebox command help Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | commands/Kconfig: Fix tpyoUwe Kleine-König2018-01-221-1/+1
|/ | | | | | | s/Pring/Print/ Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/net'Sascha Hauer2018-01-056-92/+132
|\