9
0
Fork 0
Commit Graph

1156 Commits

Author SHA1 Message Date
Sascha Hauer 97d2da3d98 Merge branch 'for-next/video' 2017-03-13 08:16:53 +01:00
Sascha Hauer 6b926567c0 Merge branch 'for-next/usb' 2017-03-13 08:16:44 +01:00
Sascha Hauer e0093dcf23 Merge branch 'for-next/misc' 2017-03-13 08:16:44 +01:00
Sascha Hauer 93c55ce098 Merge branch 'for-next/efi' 2017-03-13 08:16:43 +01:00
Marc Kleine-Budde e3dda8553e console_countdown: add possibility to abort countdown by external commands
This patch makes it possible to abort a console countdown by an external
command, for example when fastboot is used. This requires additional
modifications in the external commands, a call to "console_countdown_abort()"
has to be inserted.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-10 08:43:27 +01:00
Sascha Hauer 2b9bcff79a usb: gadget: properly release f_multi_opts
The usbgadget commands uses statically allocated f_multi_opts and passes
this to usb_multi_register(). These f_multi_opts are of course no
longer valid when we leave the usbgadget command. Luckily we do not use
the data after we left the usbgadget command, so this never has been a
problem. However, f_multi_opts has some allocated members which we can
not free anymore on gadget unregistration because we no longer have the
pointer to them.

Fix this by adding a release function to struct f_multi_opts. This way
we can allocate all memory dynamically and properly free it when not
used anymore.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-09 09:37:03 +01:00
Uwe Kleine-König e0ff988ad8 memcmp: fix comparison on short read
read() might return less than $count bytes which is only an upper limit.
The user is supposed to repeat the command to fill a buffer completely.

So use the convenience wrapper read_full in memcmp.

This fixes memcmp on /dev/nand0 on an Armada XP.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-02 08:39:58 +01:00
Sascha Hauer 019606ddc3 commands/mmc_extcsd: Relicense under GPLv2+
GPLv3 is incompatible with the projects license. Relicense file
under GPLv2+

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Daniel Schultz <d.schultz@phytec.de>
2017-03-01 08:04:06 +01:00
Bastian Stender b9cf45f00c fb: introduce flush for virtual framebuffer
Some drivers need an explicit sync method to flush the virtual
framebuffer to the display. It is called fb_flush().

fb_flush() gets called on fbc_putc, on fb_close and in the pattern cycle
in the fbtest command.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-28 15:52:53 +01:00
Jean-Christophe PLAGNIOL-VILLARD 4c29a9511b efi: move x86 efi boot support to x86 arch
prepare to drop the efi arch as efi boot up is not arch sepecific

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-27 08:33:14 +01:00
Michael Olbrich 39db674c45 output: use '[0m' to reset colors
'[m' is supposed to have the same effect as '[0m'. However, some EFI
implementations seem to ignore '[m', so use '[0m' everywhere to avoid
rendering issues.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-24 09:34:11 +01:00
Jan Luebbe 4f836c3c3c bootchooser: fix help message
The descriptions of -a and -p were mismatched.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-13 08:28:32 +01:00
Sascha Hauer 08c62ae2fa Merge branch 'for-next/truncate' 2017-01-11 19:00:04 +01:00
Teresa Remmet 4448dbb2e8 commands: ubi: ubiupdatevol: Open device with O_TRUNC
Static ubi volumes should be opend with O_TRUNC as the device file
size equals the content.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-11 08:06:48 +01:00
Sascha Hauer c757c67642 menu: sanitize menu_add_title
passing a string to menu_add_title() which then gets free by this
function is just plain ugly. Pass it a const char * which gets
duplicated in menu_add_title() when necessary.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-10 08:27:33 +01:00
Moritz Warning b68e25415a docs: fix typos in memcmp help text
Signed-off-by: Moritz Warning <moritzwarning@web.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-10 08:27:33 +01:00
Andrey Smirnov 883fa87397 commands: i2c: Listen for CTRL-C when probing
Allow I2C bus probing to be interrupted early by sending CTRL-C. This is
usefull when calling the tool without any arguments and one of the busses
is misconfigured (waiting for 100+ failures is pretty inconvenient).

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-10 08:27:33 +01:00
Sascha Hauer ee69c58841 clk: add clock command completion
This adds tab completion for the clk_* commands.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-11-08 18:34:23 +01:00
Stefan Lengfeld 7649dc9ec9 commands: spi: fix chip select validation
The chip selects are numbered 0..(max chip selects - 1). Chip select
with number <max chip selects> is invalid. Fix the check for that. Using
the out of bound chip select may hang your board.

Signed-off-by: Stefan Lengfeld <s.lengfeld@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-11-08 08:55:48 +01:00
Sascha Hauer eca7871bce complete: Add completion for nv and globalvar commands
The 'nv' command is often used to create a nv variable
for an existing global variable, so add a command completion
function for this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-10-18 22:45:32 +02:00
Yegor Yefremov ee5e6c0115 boot: add '-w' parameter to usage help text
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-10-12 08:47:57 +02:00
Sascha Hauer 385c95c60b Merge branch 'for-next/ubi' 2016-10-10 08:31:08 +02:00
Sascha Hauer bfdb14c7da Merge branch 'for-next/misc' 2016-10-10 08:31:07 +02:00
Giorgio Dal Molin fed9b1ba3f mtd: ubi: commands: added the new command 'ubirename'.
Signed-off-by: Giorgio Dal Molin <iw3gtf@arcor.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-27 08:20:40 +02:00
Sascha Hauer 520226a014 mtd: ubi: commands: use function API to access ubi volumes
We have a function API to manipulate ubi volumes, use it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-27 08:15:29 +02:00
Marc Kleine-Budde cc532a3f73 boot: add framework for redundant boot scenarios
There are several use cases where a redundant Linux system is needed. The
barebox bootchooser framework provides the building blocks to model different
use cases without the need to start from the scratch over and over again.

The bootchooser works on abstract boot targets, each with a set of properties
and implements an algorithm which selects the highest priority target to boot.

See the documentation contained in this patch for more information.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-22 11:44:23 +02:00
Sascha Hauer 62ae0274df global: Make 'global' command behaviour consistent to 'nv'
The 'nv' command can add/remove multiple variables. Implement that
for the 'global' command aswell. Also with the 'nv' command the -r
option is for removal of variables, not for "set match". Looking at
the users of "global -r" the only user uses the command for removal
of variables and not for "Setting multiple variables to the same value"
as stated in the command help text. Let "global -r" remove variables
aswell.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-22 11:31:21 +02:00
Sascha Hauer d60230bded convert users to %pI4
Convert users of ip_to_string() and print_IPaddr() to %pI4 and
remove the now unused functions.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-22 11:30:38 +02:00
Enrico Jorns 9cd9d98300 commands: exit on invalid option
Barebox commands should not perform any action and return 0 if an
invalid parameter was given. This might cause undetected unintended
behvaior when calling commands with wrong options, either manually or
from a script.

Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-16 09:36:26 +02:00
Sascha Hauer dd534571bd Merge branch 'for-next/misc' 2016-09-13 14:56:05 +02:00
Sascha Hauer 6b8ae8f2e1 Merge branch 'for-next/menu' 2016-09-13 14:56:05 +02:00
Ulrich Ölmann fbdfa76ccf commands: ubiupdatevol: confirm success with return value 0
Treat the write() case analogously to the read() case and do not return the
number of most recently written bytes as the status of sucessful command
execution.

Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-06 16:21:22 +02:00
Ulrich Ölmann 90494c6f7e commands: ubiupdatevol: store return value of read() in a signed int
With an unsigned int test for errors from read() can never become true.

Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-06 16:20:53 +02:00
Enrico Jorns 958b3a5201 commands: saveenv: exit on invalid option
Saveenv should not perform any actions if an invalid parameter was
given.

Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-05 08:53:24 +02:00
Aleksey Kuleshov bf2abf9050 rework menu so that it can support multiline titles
Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-05 08:26:47 +02:00
Sascha Hauer 438956c6e0 commands: usbgadget: Fix -d option help text
The -d option disables any currently active gadget, it does not
necessarily have to be a serial gadget.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-29 17:36:58 +02:00
Christian Hemp e37faaf185 commands/Kconfig: fix typo in CMD_OF_FIXUP_STATUS help
The command is of_fixup_status and not of_fixup_node.

Signed-off-by: Christian Hemp <c.hemp@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-22 07:48:30 +02:00
Sascha Hauer 94b1e5a321 Merge branch 'for-next/nv' 2016-08-03 08:08:23 +02:00
Sascha Hauer 94e7bdcd9a Merge branch 'for-next/boot' 2016-08-03 08:08:22 +02:00
Sascha Hauer eeaed6eee3 boot: Print a message when a boot target string does not lead to a boot target
When doing a 'boot friesel net' one expects a message when 'friesel'
does not give any bootable results and thus 'net' is booted. This patch
adds this message.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-26 08:31:36 +02:00
Sascha Hauer 13daf78f1f boot command: Explicitly complain when boot target list is empty
When no targets to boot are found it can happen that the boot command
just returns silently. Explicitly print a message in this case to give
a clue what might went wrong.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-26 08:31:36 +02:00
Sascha Hauer 89c8ac578f boot: Move code to common/
Normally code in commands/ shall only do the option parsing whereas the
functionality shall be in common/ to make the code usable from C aswell.
Do this in the boot code aswell, move it to common/boot.c and add the
function prototypes to include/boot.h

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-26 08:31:35 +02:00
Sascha Hauer ed71dfbbc5 boot: Use struct bootentries to pass around data
We have a struct bootentries type to collect different boot entries,
so use this to pass around data between functions rather than using
an array of strings. With this we also no longer have to convert a
string to a boot entry multiple times.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-26 08:31:35 +02:00
Sascha Hauer 3ab18b3cd0 bootentries: Move menu display string allocation to bootentries_alloc()
bootentries_alloc() is the place where the struct bootentries container
is allocated, so allocate the menu entry there aswell.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-26 08:31:35 +02:00
Sascha Hauer e113fa5f1d blspec: separate bootentries from blspec entries
This completes the separation of the blspec code from the boot
code. With this the boot code only handles generic boot entries
of type struct bootentry which are embedded into the type
(blspec/bootscript) specific structs.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-26 08:31:35 +02:00
Sascha Hauer ff6bc08801 bootentries: Add title/description
We currently have to special case blspec entries vs. boot scripts
in the common boot code since we want to print different informations
about them. This adds a 'title' and 'description' which can be filled
in with different information by bootscripts and blspec entries and
so we get rid of the special handling.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-26 08:31:35 +02:00
Sascha Hauer 0d054f3303 blspec: factor out a struct bootentry
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-26 08:31:35 +02:00
Sascha Hauer dbc1894b42 blpec: rename struct lspec -> bootentries
The code in common/boot.c collects the different boot entries in
lists of type struct blspec, eventhough many of them may not be
bootloader spec entries but for example boot scripts. This is the first
step of separating the data structures from boot entries and bootloader
spec: As struct blspec is merely a container for collecting boot entries
We simply rename struct blspec to struct bootentries. No functional change.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-26 08:31:34 +02:00
Sascha Hauer 4d85cb974a include: Move bulk of boot.h to bootm.h
The majority of the stuff currently in include/boot.h is about bootm
code implemented common/bootm.c. To be more consistent move it to a
new file include/bootm.h.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-26 08:31:31 +02:00
Lucas Stach c77af5e5cb commands: fbtest: select IMAGE_RENDERER
2D_PRIMITIVES needs IMAGE_RENDERER.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-25 10:21:16 +02:00