9
0
Fork 0
Commit Graph

96 Commits

Author SHA1 Message Date
Michel Stam 4d94f56c6c common: Allow for I/O mapped I/O
Rework the current framework so that I/O mapped I/O resources are
also possible.

Signed-off-by: Michel Stam <michel@reverze.net>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-08 08:17:55 +02:00
Sascha Hauer ca8edb3b65 add menutree command
Creating menus from the shell using the regular 'menu' command is rather
complicated. This adds a 'menutree' command which creates a menu from
a directory structure. In the directory structure each directory corresponds
to a single menu entry. The directory contains the following files:

title -  A file containing the title of the entry as shown in the menu
box -    If present, the entry is a 'bool' entry. The file contains a variable
         name from which the current state of the bool is taken from and saved
         to.
action - if present this file contains a shell script which is executed when
         when the entry is selected.

If neither 'box' or 'action' are present this entry is considered a submenu
containing more entries.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 09:37:09 +01:00
Sascha Hauer 3b7a102d3e Add readf command
The readf command is useful to read the content of a file into
a shell variable. It should be used for ascii content and thus
stops reading at all nonprintable characters including newline.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-14 16:40:13 +01:00
Sascha Hauer 33c56e21eb Merge branch 'for-next/misc'
Conflicts:
	commands/Makefile
2013-10-07 08:00:25 +02:00
Sascha Hauer 28141f9e5a defenv-2: replace boot script with command
This replaces the 'boot' script in the defaultenv-2 with a command
with the same behaviour. A command gives more flexibility for future
externsions

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-30 07:45:04 +02:00
Sascha Hauer 4a22305307 move devinfo command to its own file
Just like nearly all other commands are in individual files.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-27 11:14:32 +02:00
Alexander Aring 842308e297 commands: add new memtest command
This new memtest can test the whole unused memory. The new memtest
command try to request the whole unused sdram regions on all banks and
run the mem_test routine from common/memtest.c on it.

The memtest command has only two parameters;
  -i	Amount of iterations, default 1, iteration of 0 is endless.
  -b	Set this to skip integrity check.(Do only a fast test for bus lines)

If MMU support is enable, memtest try to run memtest twice. The first with
cache enabled, the second with cache disabled.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-08 15:00:55 +02:00
Alexander Aring 47f9da4380 memtest: remove memtest command
Remove memtest command.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-05 22:54:34 +02:00
Sascha Hauer 95e7982f99 devices: add detect mechanism
We often encounter the situation where slow devices should not be
probed during startup since probing is slow and maybe unnecessary
for unused devices. With MMC we have the 'probe' device parameter,
for ata we have the same, for USB we have the 'usb' command. Overall
this is not very consistent.
With MMC there is the additional problem that the probe parameter
is attached to the logical device when we often have the information
which physical device we want to probe.
This patch adds a 'detect' callback for devices and adds a command
to detect devices and to list the devices which are actually detecable.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-31 12:32:05 +02:00
Sascha Hauer 67c6eeda9e Add memory modify command (mm)
As of now we have no way to manipulate individual bits of registers on the
command line. This introduces a memory modify command which allows this. It
has the syntax:

mm [OPTIONS] <adr> <val> <mask>

With [OPTIONS] being the usual memory command options (-b, -w, -l, -d <file>).

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-17 13:37:14 +02:00
Sascha Hauer e10c1845b2 memory commands: separate into one file per command
Normally in commands we have one file per command which is named like
the command itself. The memory commands are an exception to this. This
patch changes this by separating the memory commands. This also has the
effect that the memory commands can now be selected individually. Along
the way we add some Kconfig help text for the commmands.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-17 13:36:31 +02:00
Sascha Hauer 0b12784089 Merge branch 'for-next/oftree'
Conflicts:
	drivers/of/base.c
2013-02-04 15:49:04 +01:00
Sascha Hauer db63bd8e10 Merge branch 'for-next/commands' 2013-02-04 15:48:45 +01:00
Sascha Hauer db474fe0bb commands: Add of_node command
This command allows to create/delete device nodes.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-19 11:48:17 +01:00
Sascha Hauer 8943b86aa8 commands: Add of_property command
The of_property command allows to modify/add/delete properties.
Parsing user input is based on U-Boot code with some fixes added
for catching invalid input.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-19 11:48:17 +01:00
Jan Luebbe 964893b34b commands: add let command which supports proper arithmetic
This command works like the corresponding Unix shell command and
is used for adding, multiplying and much more.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-09 10:32:54 +01:00
Wolfram Sang 5a29d4aea7 commands: add ubiformat
Imported from mtd-utils and stripped down to needed functionality.
Based on an older version (1.4.5.) since the newer do use MEMWRITE
interfaces which we don't have in barebox (yet).

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-19 10:31:36 +01:00
Sascha Hauer b474168b90 Merge branch 'for-next/ymodem' 2012-11-16 14:02:49 +01:00
Sascha Hauer 0bf6b41cfa Merge branch 'for-next/spi' 2012-11-16 14:02:49 +01:00
Sascha Hauer 856f60dbd1 Merge branch 'for-next/misc'
Conflicts:
	commands/Makefile

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-16 14:01:34 +01:00
Sascha Hauer bf38ac7b89 Merge branch 'for-next/imx'
Conflicts:
	arch/arm/boards/guf-neso/lowlevel.c
	arch/arm/boards/pcm038/lowlevel.c
	commands/Makefile
2012-11-16 14:01:09 +01:00
Robert Jarzmik 818b981bfc commands: remove old Y-Modem implementation
As a new implementation of Y-Modem protocol is available,
switch from old implementation to the new one :
 - remove old xyzModem* files
 - remove old command loady2
 - rename command loady2 to loady

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Tested-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-12 09:35:53 +01:00
Robert Jarzmik 2a38aa83f7 commands: change Y-Modem implementation
The current Y-Modem implementation has some limitations:
 - Y-Modem/G protocol is not supported
 - Multiple files (aka. batch) transfers are not supported
 - Transfer speed over fast lines (USB console) is slow
 - Code is not trivial to maintain (personnal opinion)

This implementation tries to address all these points by
introducing loady2 command.

The effects are :
 - transfer speed for Y-Modem over USB jumps from 2kBytes/s
   to 180kBytes/s
 - transfer speed for Y-Modem/G jumps to 200kBytes/s
 - multiple file transfers are possible

This command was tested on a USB console and UART 9600bps
serial line :
 - NAKs (and retransmissions) were tested for faulty
   serial lines
 - multiple file transfers were tested
 - Y-Modem, Y-Modem/G and X-Modem transfers were tested

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Tested-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-12 09:35:53 +01:00
Jean-Christophe PLAGNIOL-VILLARD 055b31e92e introduce spi command
usefull to debug spi

The command allow to read/write on a spi device

Usage: spi [OPTION] [data to write 0xXX]
write/read spi device.
  -b <bus_num>  spi bus number (default = 0)
  -r <count>    to read
  -c <cs>       chip select (default = 0)
  -m <mode>     spi mode (default = 0)
  -f <hz>       max_speed_hz (default = 1MHz)
  -w <bit>      bits_per_word (default = 8)
  -v            verbose

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-12 08:32:16 +01:00
Sascha Hauer e8018cf5f0 add filetype command support
This adds support for a filetype detection command. It can be
used to print a filename on the console or to set a variable
with the detection result for use in shell scripts.
The command also has an option to print the known filetypes
so that a user knows what to match for.

Based on an earlier version from Jean-Christophe.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-30 15:42:39 +01:00
Antony Pavlov de053ed91c add 'miitool' command to view media-independent interface status
This command is based on the 'mii-diag' and 'mii-tool'
Unix utilities, but it lacks routines to manipulate
MII state (e.g. reset MII, restart autonegotiation
or force MII mode).

This version of the 'miitool' command has no GbE support,
but we can upgrade it in the future. The GbE support
patch for generic 'mii-tool' is here
http://ftp.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz

EXAMPLE:

barebox:/ miitool -vv /dev/phy0
negotiated 100baseTx-FD, link ok
  registers for MII PHY:
    3100 782d 0013 78e2 01e1 45e1 0007 2001
    0000 ffff ffff ffff ffff ffff ffff ffff
    0084 4780 0000 0000 0422 0000 0000 0000
    0000 0000 0080 0000 ffff 0000 0000 3660
  product info: Level One LXT971A rev 2
  basic mode:   autonegotiation enabled
  basic status: autonegotiation complete, link ok
  capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
  advertising:  100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
  link partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-30 10:24:12 +01:00
Sascha Hauer bed8fb6de1 Add in-system barebox update infrastructure
Currently in-system update means to write an arbitrary file to
an arbitrary device. There is no sanity check if the flashed image
is of the right type or will fit onto the device. Furthermore some
SoCs need a special preparation step for their images before
flashing them.

This adds a barebox in-system update infrastructure. Boards can
register update handlers which know how to make the board bootable.
The available handlers can be listed to be able to select one,
different force levels give the user the chance to know it better.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-17 20:23:41 +02:00
Sascha Hauer c797f3c168 commands: Add clk commands
This adds some basic commands to manupulate clocks on the command
line. Right now we have:

- clk_set_parent
- clk_set_rate
- clk_enable
- clk_disable
- clk_dump

The commands work based on the clock name, otherwise they behave like
the Linux Kernel C functions. clk_dump will dump the clocktree to the
console.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-04 15:19:55 +02:00
Sascha Hauer edf068e9cf Merge branch 'for-next/tftp' 2012-10-03 21:17:39 +02:00
Sascha Hauer 4183b9ab58 net: Add tftp command which uses the new tftp code
Traditionally tftp is a command of its own. Since we can
mount tftp as a filesystem we have duplicated the tftp code, the old
code is used by the tftp command, the new by the filesystem support.
This adds a tftp command based on the filesystem support to preserve
backward compatibility. This allows us to remove the old tftp support
in the next step.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-28 16:23:43 +02:00
Jean-Christophe PLAGNIOL-VILLARD a87361dfc3 bmp: rename it to splash
so be can add more format support

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-12 17:16:45 +02:00
Jean-Christophe PLAGNIOL-VILLARD bf32bc1d9a command: add ln support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-09-05 03:22:14 +08:00
Jean-Christophe PLAGNIOL-VILLARD 69a4ea15db command: add readlink support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-09-05 03:22:14 +08:00
Jean-Christophe PLAGNIOL-VILLARD d6a50c915f stddev: make it selectable via Kconfig
enable is by default for simple and hush
we do not need to NO_SHELL

this allow to save 1KiB

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-25 10:06:30 +02:00
Sascha Hauer 4f5862d884 Merge branch 'for-next/poweroff' 2012-07-02 11:04:44 +02:00
Sascha Hauer 62fe47768b Merge branch 'for-next/devnull'
Conflicts:
	commands/mem.c
2012-07-02 11:04:25 +02:00
Sascha Hauer 7f9fc3dbd0 Merge branch 'for-next/watchdog' 2012-07-02 10:59:45 +02:00
Sascha Hauer 6e4b15537b Merge branch 'for-next/misc' 2012-07-02 10:59:30 +02:00
Sascha Hauer c7419bb247 Add dirname command
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 16:53:59 +02:00
Sascha Hauer 814bc438ce Add basename command
The basename command allows to set an environment variable with
the basename of a path.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 16:53:59 +02:00
Antony Pavlov b78f4c986f add 'poweroff' command
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:47:25 +02:00
Steffen Trumtrar bf5eb000b3 commands: add msleep command
Add a command to sleep for n milliseconds.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:47:04 +02:00
Alexander Shiyan 0e4fdcc81b Move /dev/zero to separate unit
This patch allows to present "/dev/zero" always in system and not
depending  of mem-command. Standard files allow to test other memory
devices, not only "mem", such as NOR, NAND, MCI-devices e.t.c.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:01 +02:00
Juergen Beisert 2928591eab Add a simple watchdog framework
This patch adds a simple wd command which can setup, trigger and stop a watchdog
on the platform.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-29 15:16:34 +02:00
Sascha Hauer b8c94a1561 add 'global' command
This implements global shell variable support. This is done by registering
a new device named 'global', so global variables are just plain device
parameters.
Global variables are useful for storing the global state in the environment.
Currently we do this by sourcing scripts instead of executing them which is
quite limiting.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-14 08:57:01 +02:00
Sascha Hauer b5e5b06d8b Add automount support
This patch adds an automount command which makes it possible
to execute a script when a certain directory is first accessed.
It's the commands responsibility to make this directory available
(bringing devices up and mounting it). This results in automount
support which makes sure that from the shell every file can
be accessed without having to care for device bringup. Bringing
up devices may be expensive (USB, dhcp). The automount support
makes it easy for the environment to bringup devices when they
are actually needed.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-03-18 15:03:26 +01:00
Alexander Aring 12fa9c5024 nandtest: add nandtest command
Add nandtest command to test nand devices
and display ecc stats at the end of test.

Signed-off-by: Alexander Aring <a.aring@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-04 14:25:27 +01:00
Eric Bénard f7aaa22493 serial gadget: enable/disable on request
- add a usbserial command to enable/disable the serial gadget
- allow dfu and usbserial to cohexist in the same barebox
- add a timeout in u_serial so that we don't get locked if the user
enable usbserial from a UART console but doesn't consume the data
on the usbserial port created on the PC
- remove debug or verbose printf
- tested on i.MX25 & i.MX35 & usb-a926x

Signed-off-by: Eric Bénard <eric@eukrea.com>
Tested-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-04 14:18:46 +01:00
Sascha Hauer e90f67881e remove now obsolete iminfo command
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-15 11:07:15 +01:00
Sascha Hauer 1d1618a11b add uimage command
The uimage command superseeds the iminfo command. Unlike
the iminfo command the uimage command can also be used
to verify the data crc on demand and to extract uImages
to files.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-15 11:07:15 +01:00