summaryrefslogtreecommitdiffstats
path: root/commands
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* | | Merge branch 'for-next/login'Sascha Hauer2015-09-013-74/+11
|\ \ \
| * | | crypto: fix selecting of digestsSascha Hauer2015-08-281-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SHA1 is meant as a boolean option which is true when sha1 support is available. This works because the providers (DIGEST_SHA1_GENERIC and DIGEST_SHA1_ARM) have a 'select SHA1'. However, consumers like the sha1sum command do a 'select SHA1' to enable SHA1 support. This of course does not work; selecting SHA1 will not select any of the SHA1 providers. This is broken for all digest consumers. We have to explicitly select a digest provider, that is DIGEST_*_GENERIC to enable the corresponding digest. This means now we will always have the generic digest in the binary, even when an optimized one is enabled. There is no sane way in Kconfig to "select provider for feature xy", so let's live with the overhead in the binary. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | login: rework login mechanismSascha Hauer2015-08-282-68/+5
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to have the login functionality in the /env/bin/init script. This is hard to review and it's too easy to break the login functionality with changes to this script. Move the places to ask for a password to C code where we have only a few places where we have to ask for a password. Mainly these are run_shell() and the menutree command. This patch introduces a login() function which will only return if the correct password has been entered. Following calls will return immediately without asking for a password again. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/fb'Sascha Hauer2015-09-012-14/+8
|\ \ \ | |/ / |/| |
| * | gui: Use fb provided shadowfb for offscreen renderingSascha Hauer2015-08-201-5/+1
| | | | | | | | | | | | | | | | | | | | | The fb core now has builtin support for offscreen rendering, use this and drop offscreen handling in the gui code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | splash command: simplify offscreen renderingSascha Hauer2015-08-201-9/+6
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | splash command: depend on CONFIG_VIDEOSascha Hauer2015-08-201-0/+1
| |/ | | | | | | | | | | | | The splash command only makes sense with framebuffer support enabled, so add the corresponding dependency to Kconfig. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / dhrystone: Fix documentationSascha Hauer2015-08-201-2/+1
|/ | | | | | BAREBOX_CMD_HELP_TEXT may not contain a linebreak. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/spd'Sascha Hauer2015-08-063-0/+71
|\
| * commands: add spd_decode commandAlexander Smirnov2015-07-143-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | spd_decode command is used for decoding and printing in human-readable format the information found in memory module SPD EEPROMs. There is the decode-dimms program from i2c-tools linux package (see http://www.lm-sensors.org/wiki/I2CTools) just for the same purpose. Though spd_decode source code is based on decode-dimms perl code there is a difference. Signed-off-by: Alexander Smirnov <alllecs@yandex.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2015-08-063-0/+452
|\ \
| * | commands: Add dhrystoneDaniel Schultz2015-08-063-0/+452
| |/ | | | | | | | | | | | | | | | | | | This tool will help to measure the system performance. Some SoCs haven't the possibility to route their clocks to the output pins. So you can use dhrystone to get a feedback about the clock speed. Signed-off-by: Daniel Schultz <d.schultz@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | graphics_utils: Let fb_open allocate the screenSascha Hauer2015-07-201-14/+13
| | | | | | | | | | | | | | | | | | Allocate the screen dynamically in fb_open. This opens the way to create a fb_create_screen function which takes a struct fb_info * instead of a filename. This is suitable for the framebuffer console which already has a struct fb_info *. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | graphic_utils: Add a common namespace to functionsSascha Hauer2015-07-151-3/+3
|/ | | | | | | This adds a common namespace to the graphic functions. We use gu_ for graphic_utils. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* digest: digest doesn't return an error if the signature length is incorrectPhilippe Leduc2015-07-061-2/+3
| | | | | | | | fix: digest return no error even if the digest length is wrong fix: documentation error (-v -> -s / -V -> -S) Signed-off-by: Philippe Leduc <ledphilippe@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mtd'Sascha Hauer2015-07-032-4/+3
|\ | | | | | | | | Conflicts: drivers/mtd/core.c
| * commands: mount: detect the device to be mountedSascha Hauer2015-06-261-0/+2
| | | | | | | | | | | | Before mounting a device try to detect it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * commands: detect: use device_detect_by_nameSascha Hauer2015-06-261-4/+1
| | | | | | | | | | | | | | Instead of looking up the device ourselves let device_detect_by_name do the work. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2015-07-0312-12/+1
|\ \ | |/ |/|
| * treewide: fix 'new blank line at EOF' formatting errorAntony Pavlov2015-07-0211-11/+0
| | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * commands: digest: fix harmless warningLucas Stach2015-06-291-1/+1
| | | | | | | | | | | | | | | | | | Fixes with !CONFIG_LONGHELP: commands/digest.c:71:13: warning: 'prints_algo_help' defined but not used [-Wunused-function] Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | devinfo: fix return valueSascha Hauer2015-06-231-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | devinfo on a non existing device prints: no such device: blah devinfo: Operation not permitted The second message comes because devinfo returns -1 which is -EPERM. Just return -ENODEV which will print: devinfo: No such device Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | login: fix broken login commandHubert Feurstein2015-06-181-1/+1
|/ | | | | | | | | | It was possible to login with ctrl-c or an empty password. This bug was introduced by the recent digest changes in common/password.c (e49a47fb). The function check_passwd returns now also negative error codes which were not correctly handled in do_login. Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* memtest: skip memory region smaller than one pageRenaud Barbier2015-06-161-4/+8
| | | | | | | | | If the size between memory regions is smaller than one page, the size is rounded down to 0. This results in a region request failure. This commit skips the memory region whose size is smaller than a page. Signed-off-by: Renaud Barbier <renaud.barbier@ge.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2015-06-091-1/+1
|\
| * ubiformat: fix argument parserAlexander Richter2015-05-201-1/+1
| | | | | | | | | | | | | | | | - remove duplicate 'y' option - add missing 'Q' option Signed-off-by: Alexander Richter <alexander.richter@atsonline.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mem64'Sascha Hauer2015-06-097-9/+36
|\ \
| * | mw command: Add 64bit supportSascha Hauer2015-05-281-1/+9
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>