summaryrefslogtreecommitdiffstats
path: root/commands
Commit message (Collapse)AuthorAgeFilesLines
...
| * | 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>
| * | loadb: Allow to specify device to useSascha Hauer2015-11-171-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | The port we want to have the console on may not necessarily be the port we want to transfer files on. Make the port configurable with a commandline option. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | loadb: deactivate console before using it for loadbSascha Hauer2015-11-171-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | Remove the console device we are about using for loadb from the console layer by deactivating it. This makes sure that no printf output disturbs the current file transfer. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | loadb: Use local cdevSascha Hauer2015-11-171-17/+26
| |/ | | | | | | | | | | | | | | We already retrieve a console_device using console_get_first_active(). Use this one also to send/receive characters instead of the combined input/output of all console devices with putc/getc. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / ARM: Remove do_execute and thumb2_executeTrent Piepho2015-12-071-4/+1
|/ | | | | | | | | | | | | | | | | | | | In commit 104a6a7ccfb7928ca5dc28c8cbe0ea231ffc45ee support was added for Thumb2. It added do_execute() as a way to provide arch dependent calling veneers for use in "go" and thumb2_execute() as the thumb2 to arm veneer. But thumb2_execute() isn't necessary as gcc generates a proper calling sequence from a standard function pointer call. Thumb2 barebox is compiled with the AAPCS ABI which requires this. It also had a bug and didn't pass the arguments properly, but code execute via "go" rarely uses arguments so this wasn't very noticeable. Since thumb2 was always the only user of do_execute(), go ahead and delete that too. Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2015-11-065-12/+97
|\
| * edit: return error when save_file failedEnrico Jorns2015-11-051-2/+3
| | | | | | | | | | | | | | | | | | When writing a file failed (e.g. due to a read-only file system), no error was reported by the 'edit' tool. To be valid (and to not confuse the poor user) at least '1' should be returned to indicate an error. Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * edit: handle write() call errors in save_file()Enrico Jorns2015-11-051-3/+12
| | | | | | | | | | | | | | | | | | | | | | save_file() did ignore possible errors of its write() calls. Now the error code is used as return code for save_file(). write_full() is used instead of write() as it does not perform partial writes which would require to check for returned size, too. Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * loadb: add missing brackets in helpAlexander Aring2015-10-271-2/+2
| | | | | | | | | | | | | | This patch adds missing brackets in the help text of loadb command. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * of_dump: Add option to print node names onlySascha Hauer2015-10-261-2/+19
| | | | | | | | | | | | | | | | | | | | | | Devicetrees tend to become very long and it is hard to find the interesting nodes in a full tree output. This patch adds the -n option to the of_node command. With this option only the names of the nodes are printed, but not the properties. The resulting output is much shorter and the node one is interested in can be copy/pasted to a second call to of_node. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * commands: clk_dump: use COMMAND_SUCCESS instead of 0 return codeAntony Pavlov2015-10-261-2/+2
| | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * commands: add clk_get_rate commandAntony Pavlov2015-10-221-0/+55
| | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * memtest.c: Print iterations count if -i is 0Andrey Smirnov2015-10-151-1/+5
| | | | | | | | | | | | | | | | Even if memtest is started in endless mode it is still useful to see current iteration count. Add the code to print that. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | memtest: Make cached/uncached test configurableSascha Hauer2015-11-041-5/+21
| | | | | | | | | | | | | | | | Add options to explicitly test cached/uncached tests. Without these options still both cached and uncached is tested if remapping is supported. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | memtest: By default only test biggest regionSascha Hauer2015-11-041-27/+55
| | | | | | | | | | | | | | | | | | Often enough the biggest free region spans most free RAM, so it doesn't add much value to test the remaining free regions. This patch changes the default behaviour to only test the biggest free region and adds the -t option to test all regions. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | memtest: split tests in separate functionsSascha Hauer2015-11-031-1/+8
| | | | | | | | | | | | | | | | The memtest does a bus integrity check and a moving inversions test. Split the tests into two separate functions so that the can be called separately. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | rework remap_rangeSascha Hauer2015-11-031-22/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | remap_range is for remapping regions with different cache attributes. It is implemented for ARM and PowerPC only, the other architectures only provide stubs. Currently the new cache attributes are passed in an architecture specific way and the attributes have to be retrieved by calls to mmu_get_pte_cached_flags() and mmu_get_pte_uncached_flags(). Make this simpler by providing architecture independent flags which can be directly passed to remap_range() Also provide a MAP_ARCH_DEFAULT flag and a arch_can_remap() function. The MAP_ARCH_DEFAULT defaults to whatever caching type the architecture has as default. the arch_can_remap() function returns true if the architecture can change the cache attributes, false otherwise. This allows the memtest code to better find out what it has to do. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | memtest: move request/release regions to common/Sascha Hauer2015-10-271-105/+2
|/ | | | | | | | Normally code providing a feature should be implemented in common/ which is then called from the command code. Follow this rule and move some more of the memtest code to common/. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2015-10-072-6/+3
|\
| * commands: ls: use 14 digits for filesizeAntony Pavlov2015-10-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 10 digits are not enough for modern SATA/USB storages. E.g.: barebox> ls -l /dev/ cr-------- 500107862016 ata0 cr-------- 33554432 ata0.0 cr-------- 500073258496 ata0.1 cr-------- 32224837632 disk0 cr-------- 67108864 disk0.0 cr-------- 32156680192 disk0.1 14 digits look much better. E.g.: barebox> ls -l /dev/ cr-------- 500107862016 ata0 cr-------- 33554432 ata0.0 cr-------- 500073258496 ata0.1 cr-------- 32224837632 disk0 cr-------- 67108864 disk0.0 cr-------- 32156680192 disk0.1 Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ubiformat: remove dead codeJan Remmet2015-09-291-5/+2
| | | | | | | | | | | | | | divisor isn't used. Signed-off-by: Jan Remmet <j.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | commands: Add MMC ext. CSD register toolDaniel Schultz2015-09-243-0/+2059
|/ | | | | | | This tools can read/write to the extended CSD register of MMC devices. Signed-off-by: Daniel Schultz <d.schultz@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/restart'Sascha Hauer2015-09-011-1/+2
|\
| * restart: replace reset_cpu with registered restart handlersSascha Hauer2015-08-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the reset_cpu() function which every SoC or board must provide with registered handlers. This makes it possible to have multiple reset functions for boards which have multiple ways to reset the machine. Also boards which have no way at all to reset the machine no longer have to provide a dummy reset_cpu() function. The problem this solves is that some machines have external PMICs or similar to reset the system which have to be preferred over the internal SoC reset, because the PMIC can reset not only the SoC but also the external devices. To pick the right way to reset a machine each handler has a priority. The default priority is 100 and all currently existing restart handlers are registered with this priority. of_get_restart_priority() allows to retrieve the priority from the device tree which makes it possible for boards to give certain restart handlers a higher priority in order to use this one instead of the default one. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2015-09-012-1/+26
|\ \
| * | commands: ubiformat: Document -y optionSascha Hauer2015-08-281-0/+1
| | | | | | | | | | | | | | | | | | This was missing in the help text. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | boot command: Allow to enable watchdogSascha Hauer2015-08-281-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | Enabling the watchdog before booting the kernel is a common usecase. Add an option to the boot command and also add a global variable for it to make it configurable easily. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>