Commit graph

996 commits

Author SHA1 Message Date
Daniel Schultz
319d5c1ffc commands: Add MMC ext. CSD register tool
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>
2015-09-24 19:33:27 +02:00
Sascha Hauer
67e0a30e77 Merge branch 'for-next/restart' 2015-09-01 09:43:55 +02:00
Sascha Hauer
69dccb494a Merge branch 'for-next/misc' 2015-09-01 09:43:54 +02:00
Sascha Hauer
049fb66d21 Merge branch 'for-next/login' 2015-09-01 09:43:54 +02:00
Sascha Hauer
b6b7203aca Merge branch 'for-next/fb' 2015-09-01 09:43:53 +02:00
Sascha Hauer
dfd536eb32 commands: ubiformat: Document -y option
This was missing in the help text.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-28 12:04:41 +02:00
Sascha Hauer
fe36276112 boot command: Allow to enable watchdog
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>
2015-08-28 12:04:41 +02:00
Sascha Hauer
2b5bdb47cf crypto: fix selecting of digests
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>
2015-08-28 08:00:30 +02:00
Sascha Hauer
90e766a78f login: rework login mechanism
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>
2015-08-28 08:00:27 +02:00
Sascha Hauer
83b0a5ae05 restart: replace reset_cpu with registered restart handlers
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>
2015-08-27 21:37:03 +02:00
Sascha Hauer
f38ba32965 dhrystone: Fix documentation
BAREBOX_CMD_HELP_TEXT may not contain a linebreak.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-20 15:10:34 +02:00
Sascha Hauer
7c5937d245 gui: Use fb provided shadowfb for offscreen rendering
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>
2015-08-20 12:57:08 +02:00
Sascha Hauer
38a71cde8f splash command: simplify offscreen rendering
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-20 12:57:08 +02:00
Sascha Hauer
960a6feb9a splash command: depend on CONFIG_VIDEO
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>
2015-08-20 12:57:07 +02:00
Sascha Hauer
fd58dc84cb Merge branch 'for-next/spd' 2015-08-06 12:33:24 +02:00
Sascha Hauer
4ee01d2b46 Merge branch 'for-next/misc' 2015-08-06 12:33:15 +02:00
Daniel Schultz
99b03a709d commands: Add dhrystone
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>
2015-08-06 12:30:17 +02:00
Sascha Hauer
cfec57d898 graphics_utils: Let fb_open allocate the screen
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>
2015-07-20 07:11:21 +02:00
Sascha Hauer
592ae690f5 graphic_utils: Add a common namespace to functions
This adds a common namespace to the graphic functions. We use
gu_ for graphic_utils.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-15 07:25:00 +02:00
Alexander Smirnov
5a7deee7d5 commands: add spd_decode command
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>
2015-07-14 07:09:19 +02:00
Philippe Leduc
d46b6785c4 digest: digest doesn't return an error if the signature length is incorrect
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>
2015-07-06 13:29:35 +02:00
Sascha Hauer
7b4e61bbf9 Merge branch 'for-next/mtd'
Conflicts:
	drivers/mtd/core.c
2015-07-03 08:37:52 +02:00
Sascha Hauer
f2a2894c27 Merge branch 'for-next/misc' 2015-07-03 08:37:40 +02:00
Antony Pavlov
177cab00ce treewide: fix 'new blank line at EOF' formatting error
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-02 09:39:58 +02:00
Lucas Stach
f2d31f6f6d commands: digest: fix harmless warning
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>
2015-06-29 07:22:37 +02:00
Sascha Hauer
fc34ff801b commands: mount: detect the device to be mounted
Before mounting a device try to detect it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-26 09:21:41 +02:00
Sascha Hauer
39ca74057d commands: detect: use device_detect_by_name
Instead of looking up the device ourselves let device_detect_by_name
do the work.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-26 09:19:35 +02:00
Sascha Hauer
54d78652c1 devinfo: fix return value
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>
2015-06-23 08:38:31 +02:00
Hubert Feurstein
cd09bf8f51 login: fix broken login command
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>
2015-06-18 09:44:37 +02:00
Renaud Barbier
c83950aa03 memtest: skip memory region smaller than one page
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>
2015-06-16 15:59:04 +02:00
Sascha Hauer
7a429bfb3b Merge branch 'for-next/misc' 2015-06-09 09:26:44 +02:00
Sascha Hauer
0c3bb48db9 Merge branch 'for-next/mem64' 2015-06-09 09:26:43 +02:00
Sascha Hauer
d036dd5a66 Merge branch 'for-next/console' 2015-06-09 09:26:43 +02:00
Sascha Hauer
ee2ac17df0 Merge branch 'for-next/am33xx' 2015-06-09 09:26:43 +02:00
Sascha Hauer
b4d5c8a039 loadb: ignore -c option
And always create the file if necessary. No need to have an extra flag for
this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-09 09:22:14 +02:00
Sascha Hauer
e8b94fdfb6 loadb: Use console_set_baudrate
No Need to do this manually

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-09 09:22:14 +02:00
Sascha Hauer
7cf221db7c loadb: use console_get_baudrate
No need to fiddle with device parameters anymore.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-09 09:22:14 +02:00
Sascha Hauer
230c22252a loadxy: use console_set_baudrate
No need to do this manually

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-09 09:22:14 +02:00
Sascha Hauer
3894344053 loadx: ignore -c option
And always create the file if necessary. No need to have an extra flag for
this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-09 09:22:14 +02:00
Sascha Hauer
d2a53a56b9 loadxy: use console_get_baudrate
No need to fiddle with device parameters anymore.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-09 09:22:14 +02:00
Sascha Hauer
c6fe3cd6be loadxy: Use console_get_by_name
Use console_get_by_name rather than iterating over the console list in the
loadxy code. The code in loadxy.c used to test whether a console is active
before using it. This check is dropped along the way since there's no reason
to not being able to use a disabled console for loadxy.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-09 09:22:14 +02:00
Wadim Egorov
e9bd26c7a7 net: dhcp: Split dhcp funcionality & add dhcp command
dhcp/bootp was bound to the command functionality.
This patch splits the dhcp command.
We are now able to use bootp without a shell.

This patch adds also a check for environment variables and globalvar.
So only when ENVIRONMENT_VARIABLES and GLOBALVAR is set, all received
dhcp data will be stored.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-05 13:32:39 +02:00
Sascha Hauer
d7050d1a9d mw command: Add 64bit support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-28 12:32:59 +02:00
Sascha Hauer
14221b676d mm command: Add 64bit support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-28 12:32:59 +02:00
Sascha Hauer
ab194d11c1 memset command: Add 64bit support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-28 12:32:58 +02:00
Sascha Hauer
97f5098201 memcpy command: Add 64bit support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-28 12:32:58 +02:00
Sascha Hauer
3878611a44 memcmp command: Add 64bit support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-28 12:32:58 +02:00
Sascha Hauer
a27d43a794 md command: Add 64bit support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-28 12:32:54 +02:00
Sascha Hauer
8141d2956e mem commands: suppport parsing 'q' option
Add 64bit ('q', for quad) support to mem_parse_options

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-28 12:29:49 +02:00
Sascha Hauer
6792d94a4b md: use memmap when possible
This adds the missing pieces for:

d8a6e1c ARM/mem: handle data aborts gracefully for md

When possible use memmap and directly and dereference the input pointer
directly in memory_display() so that the data abort occurs where we expect
it and not in the md command. With this d8a6e1c can work as expected.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-28 12:26:33 +02:00