9
0
Fork 0
Commit Graph

841 Commits

Author SHA1 Message Date
Steffen Trumtrar bbe01fedf5 of: property: fix error message
At least in standard oxford english one not is enough.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-26 07:27:37 +02:00
Alexander Shiyan 43f9a96a74 ubimkvol: Typo fix
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-22 09:15:07 +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 81c118aa9e memory commands: make rw_buf global
The rw_buf is used by several memory commands. Make it global since
we want to split the memory commands into separate files. Also rename
it to mem_rw_buf.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-17 13:36:31 +02:00
Sascha Hauer c065be27a1 memory commands: cleanup initialization
- return -ENOMEM instead of -1
- return the result of platform_driver_register

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-17 13:36:31 +02:00
Sascha Hauer 4e3ce28973 Use a common define for RW_BUF_SIZE
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-17 13:36:31 +02:00
Sascha Hauer 255e5b4c42 memory commands: move memory_display to separate file
memory_display is a function which should generally be available.
Currently it depends on memory command support being compiled in,
so move the function to a separate file.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-17 13:35:17 +02:00
Sascha Hauer d91b7772c4 memory commands: export common functions
The memory commands all use open_and_lseek and mem_parse_options. Export
them to be able to split the memory commands into separate files.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-17 12:56:44 +02:00
Jan Luebbe b6404068f1 commands: the crc command is actually called crc32
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-16 15:19:26 +02:00
Jan Luebbe 062a2fc2ea commands: i2c: change 0X to 0x
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-09 09:01:28 +02:00
Sascha Hauer c4da77611c Merge branch 'for-next/oftree' 2013-04-04 14:20:32 +02:00
Sascha Hauer 70867916a7 Merge branch 'for-next/mtd' 2013-04-04 14:20:32 +02:00
Sascha Hauer 8f2c6a3d2b Merge branch 'for-next/misc' 2013-04-04 14:20:32 +02:00
Hubert Feurstein 50a9cadb0c commands/tftp: use debug() for debug output
Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-03 17:22:11 +02:00
Jan Weitzel 01cc0084d9 ubiformat: get buffer from malloc
There was a erase block sized (here 131072) char buf array on the stack.
Changed this to get the space from malloc preventing stack overflows.
Also fix a wrong return without clean up.

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-03 17:22:11 +02:00
Jean-Christophe PLAGNIOL-VILLARD a38b236759 splash: fix background color support
the fb info is stored in struct screen by fb_open

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-14 07:16:20 +01:00
Sascha Hauer a51d06d679 of: remove unused libfdt
Now that we are completely independent of libfdt remove the unused
code.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-06 11:41:29 +01:00
Sascha Hauer 6d6edfcf53 bootm: Pass unflattened devicetree to handlers
This makes it possible to modify the tree in the handlers.
This is necessary because the initrd addresses are only
known inside the handlers, but not to the generic bootm
code.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-06 11:41:29 +01:00
Sascha Hauer 5d6c8ac4b4 of_property command: Fix crash with empty property value
the of_property command crashes when an empty property value
was given. This is because xrealloc is called with a length
argument of 0. Fix this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-06 11:41:29 +01:00
Sascha Hauer c932896af9 of_* commands: print usage when insufficient arguments are given
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-06 11:41:29 +01:00
Sascha Hauer 025b5394bd bootm: Use of_print_nodes instead of fdt_print
Now that we use the unflattened tree in bootm we can use of_print_nodes
instead of printing the flattened tree.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-06 11:41:28 +01:00
Sascha Hauer 64c199dd29 of: Pass barebox internal format devicetree to of_get_fixed_tree
With this every devicetree is first converted to the barebox internal
format before it's converted back to dtb again.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-06 11:41:28 +01:00
Sascha Hauer 04a26f678d oftree command: retire CMD_OFTREE_PROBE Kconfig option
Whether or not the user wishes devicetree probe support can
now be decided indepentently of the oftree command, so retire
the CMD_OFTREE_PROBE option and use OFDEVICE in the code instead.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-06 11:41:28 +01:00
Sascha Hauer b6a2800537 of: make OFDEVICE a user selectable option
OFDEVICE decides whether or not we compile in support for probing
devices from the devicetree. Let the user decide this explicitly.
This makes the oftree, of_node and of_property commands independent
of devicetree device support since being able to manipulate
devicetrees has nothing to do with probing devices from the devicetree.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-06 11:41:28 +01:00
Sascha Hauer 983686fc1f oftree command: Use of_print_nodes
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-06 11:41:28 +01:00
Sascha Hauer b26b7ef0f0 of: Add root node argument to of_find_node_by_path
This makes of_find_node_by_path usable with multiple trees.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-06 11:41:28 +01:00
Sascha Hauer 8a185a4ff2 of: let of_unflatten_dtb return the unflattened tree
In order to be able to handle multiple devicetrees, do not assume
the tree to be unflattened is the barebox internal one. Instead,
just return a pointer to it and assign the barebox internal root_node
external to the unflatten function.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-06 11:41:27 +01:00
Sascha Hauer dbaf66d8f7 of_node command: use of_create_node
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-06 11:41:27 +01:00
Sascha Hauer 68bd6e9309 nand command: check for <dev> directly after option parsing
Allo subcommands need at least one nonopt arg, so check for
it right after parsing the options and drop the check in the
MARKBAD command.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-04 11:00:33 +01:00
Sascha Hauer 938f748103 nand command: use enumeration for command instead of bitmask
A command can only be one of NAND_*, so use an enumeration instead
of a bitmask.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-04 11:00:33 +01:00
Sascha Hauer 29c589c8dc nand command: use loff_t for block offset
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-04 11:00:33 +01:00
Sascha Hauer 62ee96bd3b Merge branch 'for-next/mtd'
Conflicts:
	arch/arm/configs/eukrea_cpuimx27_defconfig
	drivers/mtd/core.c
2013-03-04 09:21:49 +01:00
Sascha Hauer 13408877f4 Merge branch 'for-next/misc' 2013-03-04 09:21:37 +01:00
Sascha Hauer 06bf4ad55b ubiformat: open flash image readonly
ubiformat only needs readonly access to the image to flash, so
open it readonly. Opening r/w may fail for example on tftp servers.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-21 08:58:59 +01:00
Alexander Aring 6b005a6098 nandtest: fix length calculation
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-20 08:23:30 +01:00
Alexander Aring 9d8a20592f fs: add pread and pwrite functions
Add pread and pwrite functions.

Split read and write functions to save some space.
The functions pread and pwrite saves and sets the file
position to a given offset and restore them afterwards.

This also makes the nandtest command use these function
which is necessary to not break compilation for the nandtest
command.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-20 08:22:42 +01:00
Alexander Shiyan aa377106d1 commands: automount: Added help string about "-d" option
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-18 09:19:05 +01:00
Sascha Hauer 3930f38028 libmtd: rename functions from mtd_* to libmtd_*
The kernel nowadays has mtd_read/write and other functions. In
barebox we also have these functions, but with a different prototype,
namely they correspond to the libmtd userspace functions. Rename
these functions to libmtd_* to avoid name clashes with future mtd
updates.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-14 10:16:17 +01:00
Jean-Christophe PLAGNIOL-VILLARD 6e9eb68de5 oftree: fix probe support
in commit e118761c5f
oftree command: refactor

the Kconfig CMD_OFTREE_PROBE was remove

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-11 21:11:25 +01:00
Sascha Hauer 0b12784089 Merge branch 'for-next/oftree'
Conflicts:
	drivers/of/base.c
2013-02-04 15:49:04 +01:00
Sascha Hauer da5fe0ba47 Merge branch 'for-next/misc' 2013-02-04 15:49:00 +01:00
Sascha Hauer db63bd8e10 Merge branch 'for-next/commands' 2013-02-04 15:48:45 +01:00
Antony Pavlov 263e454f7f commands: reset: add shutdown_barebox() before reset_cpu()
Some of controlled by barebox peripheral devices may be
not affected by CPU reset, so we need call shutdown_barebox()
to stop them.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-30 16:03:51 +01:00
Jean-Christophe PLAGNIOL-VILLARD b1da925c8a introduce console none support
this will allow to have no console support

Use full for bootstrap as we can save 6.5 KiB (barebox.bin) and
3.8 KiB (zbarebox.bin lzo) on at91sam9263 as example vs console simple

As on bootstrap we have often very limited size.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-23 20:34:16 +01:00
Sascha Hauer 0c97dd0061 move prototypes for envfs_* to envfs.h
environment.h is for environment variables, not for the environment
storage (envfs), so move the prototypes to envfs.h

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-20 16:31:51 +01:00
Sascha Hauer 9a554f8ff2 oftree command: Add -s option to save internal oftree to file
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-19 11:48:17 +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
Sascha Hauer e118761c5f oftree command: refactor
This has several improvements for the oftree command:

- loading a devicetree (-l) and actually probing (-p) it now is separated
- the command now can dump the internal devicetree or a dtb given on the
  command line.
- The -f option now actually frees the internal devicetree

With this the usage pattern for this command is:

oftree -l /env/oftree

oftree -d -n /sound

oftree -d /env/oftree

oftree -f

oftree -p

oftree -l -p /env/oftree

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-19 11:48:17 +01:00
Sascha Hauer 4979d8e9d5 of: remove unused barebox_fdt
barebox_fdt should once become the pointer to the barebox internal
devicetree. Since barebox has its own internal devicetree format
this was never used. remove it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-19 11:48:17 +01:00
Sascha Hauer 525d82f33e bootm: move printing of file locations outside verbose mode
The location of files that are booted is a precious information, so print
it by default and not only in verbose mode.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Michael Olbrich <m.olbrich@pengutronix.de>
2013-01-18 11:56:53 +01:00
Sascha Hauer 86e787e845 of: rename of_parse_dtb to of_unflatten_dtb
The process of unflatten the device tree is known from the kernel,
so rename the function, because that's what it does.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-11 14:10:02 +01:00
Sascha Hauer f30b191e36 of: make of_get_fixed_tree more universally usable
Currently the bootm code uses of_fix_tree to apply the fixups
to the devicetree given on the command line. This function assumes
that there is enough space for the fixups available. Also on ARM
we have to make sure the tree does not cross 1Mib boundaries.

This patch moves the space allocation and alignment ensurance
to of_get_fixed_tree and uses it in bootm. This is the first
step for making of_get_fixed_tree the single point of devicetree
handling in barebox.
of_get_fixed_tree now takes an argument of the input fdt. If it is
given, this one is used, otherwise an internal oftree is used which
will be created in subsequent patches.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-11 14:08:30 +01:00
Sascha Hauer dbdd533232 fixup! commands: add ubiformat
This adds the missing ubiformat.c file missing from:

commit 5a29d4aea7
Author: Wolfram Sang <w.sang@pengutronix.de>
Date:   Mon Dec 17 16:48:33 2012 +0100

    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>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-09 18:22:35 +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
Wolfram Sang 52e60618d6 ubi: consolidate ubi-media.h
We have two versions in the tree. Use the newer one, and put it into the
mtd directory while we are at it.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-19 10:30:56 +01:00
Wolfram Sang b6accb5e56 commands: flash: add missing newlines to error messages
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-14 08:43:44 +01:00
Sascha Hauer 8030ab24fa Merge branch 'kconfig' 2012-12-08 12:22:21 +01:00
Alexander Shiyan 4c20f9af97 Cleanup Kconfig files
This patch provides a global cleanup barebox Kconfig files. This includes
replacing spaces to tabs, formatting in accordance format, removing
extraneous lines and spaces. No functional changes.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-08 12:22:12 +01:00
Sascha Hauer 116c24e99e Merge branch 'for-next/mem-commands' 2012-12-07 16:43:15 +01:00
Sascha Hauer c3a84a3f76 Merge branch 'for-next/ext4' 2012-12-07 16:42:04 +01:00
Sascha Hauer 5e74263762 filetype: Pass bufsize
Pass the buffer size to the file detection code. This makes sure we do not
read past the buffer. This is especially useful for ext filesystem detection
as the magic is at byte offset 1080. Also introduce a FILE_TYPE_SAFE_BUFSIZE
define which is set to the minimum bufsize the detection code needs to detect
all known filetypes.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-03 11:23:25 +01:00
Sascha Hauer 3207dc4608 ls command: call stat() only when necessary
When calling ls in short mode we do not have to call stat()
for additional informations because we do not use them. This
speeds up ls on filesystems on which stat() is expensive
because the barebox filesystem support always has to iterate
over the directory tree.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-03 11:23:25 +01:00
Sascha Hauer 1533521bff loadenv: allow more fine grained environment loading
This implements two new options for the loadenv command:

-s: removes (scrubs) old directory contents to be able to
    create a fresh environment from for example /dev/defaultenv
-n: no overwrite. Do not overwrite existing files. This allows
    to keep parts of the old environment.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-29 20:23:04 +01:00
Sascha Hauer 5a9d53c47e rm: implement -r
To recursively remove files and directories.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-29 20:21:29 +01:00
Antony Pavlov 019d2474e8 commands: mw: add the '-x' option (swap bytes)
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-26 11:14:40 +01:00
Antony Pavlov 6552d2991f commands: md: add the '-x' option (swap bytes)
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-26 11:14:40 +01:00
Antony Pavlov f23198905c mem: add the swab (swap bytes) option to memory_display()
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-26 11:14:40 +01:00
Jean-Christophe PLAGNIOL-VILLARD d179981b2d splash: init struct allocated the stack to 0
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-21 11:53:37 +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 8134a15b0d Merge branch 'for-next/nand-test' 2012-11-16 14:02:36 +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
Sascha Hauer ea30283ba0 Merge branch 'for-next/filetype-command' 2012-11-16 14:00:45 +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 d74bef2b04 mount: add compatibility to old mount command
the mount command used to have the syntax 'mount <dev> <type> <mountpoint>'.
This was changed to the more Linux like behaviour which specifies the
type with the -t <type> option. If a newer barebox is run on a device
with an older environment the mount command no longer works. This patch
adds compatibility to the old behaviour.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-02 21:26:29 +01:00
Sascha Hauer b8d7c3a95c bootm: Do not cross 1MiB sections for the devicetree
ARM Linux only maps a single 1MiB section for the devicetree. This has
a 1Mib alignment, so we are not allowed to cross such a boundary. Align
the devicetree to the next power of two so that this never happens.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-01 16:27:21 +01:00
Sascha Hauer da7d19b9d8 bootm: Add a define for the additional devicetree size
The fixed devicetree may need more space than the original one.
We used to use 0x8000 here. Add a define for it to have the
space defined at a single place.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-01 16:27:17 +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
Sascha Hauer 87feda4eb1 environment variables: use linux list
This switches environment variables to use linux list. This is easier
to read. An additional plus is that the environment variables no longer
need an initcall, so malloc is the only requirement for them.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-30 10:24:12 +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
Antony Pavlov 735775a7c4 commands/Kconfig: move 'ln' to the 'file commands' section
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 f849039dd2 wd: Provide default value for watchdog timeout
Otherwise barebox can't be built if the user did not specify a value.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-26 08:54:44 +02:00
Alexander Aring b63fe60bef nandtest: add another constraints check
Add check if writesize is a multiple of erasesize.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-23 08:27:33 +02:00
Alexander Aring bbc7a434e6 nandtest: use loff_t instead off_t
Use the same offset type like mtd interface.
Replace modulo operation with IS_ALIGNED macro.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-23 08:27:33 +02:00
Alexander Aring be96dc98b3 nandtest: clean up code
Clean up code:

	- change 'i+i' to 'i + i'.
	- change counter variable to unsigned int.
	- use spaces instead of tabs in help text.
	- remove __test_ofs variable.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-23 08:27:33 +02:00
Alexander Aring c4f2e01df3 nandtest: use get_random_bytes instead of for loop
Use already builtin get_random_bytes instead of for loop.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-23 08:27:33 +02:00
Alexander Aring bada8f57a6 nandtest: change flash length variable type
Change flash 'length' variable type to off_t instead of int.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-23 08:27:33 +02:00
Alexander Aring f221939b5d nandtest: rename command argument p to i
Rename command argument p for 'passes' to 'i' iteration.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-23 08:27:33 +02:00
Alexander Aring 1c3d312b51 nandtest: add progressbar instead of offset print
Add progressbar and remove other outputs of current flash offset.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-23 08:27:33 +02:00
Alexander Aring f3781cb7b3 nandtest: stat ecc per page not per eraseblock
Collect ecc statistics per page not per eraseblock.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-23 08:27:33 +02: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
Carlo Caione 7423f13ff7 cosmetic: extra new line in automount usage command
Signed-off-by: Carlo Caione <carlo.caione@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-13 20:20:17 +02:00
Carlo Caione 27b77dc415 cosmetic: improve command list display
Following from the Frank Jullien's patch, here is the same cosmetic correction
when the list of commands is printed (the problem was that the commands for
gpio_* were too long for the %10s alignment)

Signed-off-by: Carlo Caione <carlo.caione@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-12 10:52:53 +02:00
Vicente 8083e2e024 bootm: close open files
Signed-off-by: Vicente <vicencb@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-10 09:29:58 +02:00
Jean-Christophe PLAGNIOL-VILLARD 5eb89cea2a gui: blit the surface on demand
Do not blit the surface everytime we write an image
As we want to able to render multiple image this will cause 1 blit per image;

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-04 17:22:09 +02:00
Jean-Christophe PLAGNIOL-VILLARD 9a048064e4 graphic_utils: introduce common fb_open/close
To open, memmap, get the fb_info and if needed allocate the offscreen buffer

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-04 17:22:09 +02:00
Jean-Christophe PLAGNIOL-VILLARD 3fa8d74abe gui: introduce screen and surface to factorize and simplify code
Instead of passing hundreds of parameter, just pass the right structure.

struct screen represent the screen with a without double buffering.
struct surface represent the part of the screen we want to render.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-04 17:22:09 +02:00
Jean-Christophe PLAGNIOL-VILLARD da0d61770a gui: move gui file to include/gui and lib/gui
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-04 17:22:09 +02:00
Sascha Hauer 47d237e58a Merge branch 'for-next/fixes' 2012-10-04 15:25:12 +02:00
Sascha Hauer 94de405d8f Merge branch 'for-next/imx-clk' 2012-10-04 15:24:57 +02:00
Jan Luebbe 468fababe0 commands/mount: fix typo and wording in help message
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-04 15:21:04 +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
Jean-Christophe PLAGNIOL-VILLARD 3c5327e660 switch all platform_bus device/driver registering to platform_driver/device_register
now register_driver and register_device are for bus only usage.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-10-04 15:19:12 +02:00
Sascha Hauer edf068e9cf Merge branch 'for-next/tftp' 2012-10-03 21:17:39 +02:00
Sascha Hauer 2385424e30 Merge branch 'for-next/testing-menu' 2012-10-03 21:13:11 +02:00
Sascha Hauer d1e65d2a7b Merge branch 'for-next/remove-fsf-address'
Conflicts:
	drivers/net/miidev.c
	include/miidev.h
2012-10-03 21:12:48 +02:00
Sascha Hauer cd323c0224 Merge branch 'for-next/png'
Conflicts:
	common/filetype.c
	include/filetype.h
2012-10-03 21:12:19 +02:00
Sascha Hauer ed4645cf13 Merge branch 'for-next/boot-sequence-dhcp'
Conflicts:
	drivers/net/miidev.c
2012-10-03 21:10:30 +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
Sascha Hauer 77322aa896 Treewide: remove address of the Free Software Foundation
The FSF address has changed in the past. Instead of updating it
each time the address changes, just drop it completely treewide.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-17 10:57:41 +02:00
Sascha Hauer f4eb950535 oftree command: Add devicetree probe support
With this the -p option is no longer for parse, but for probe instead.
Using this parses a devicetree given on the command line and probes
the devices found in this tree. Devices which already exist are not
probed again, but instead their device_node is attached to the existing
device.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-14 11:47:42 +02:00
Jean-Christophe PLAGNIOL-VILLARD 4732c27030 globalvar: add support to set a value to of all globalvars beginning with 'match'
via c global_set_match and global -r

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-09-14 00:46:00 +08:00
Jean-Christophe PLAGNIOL-VILLARD 39cc6c9cbd echo: always allow to pass -e option
This will allow to do not taint if not enabled

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-14 00:45:35 +08:00
Jean-Christophe PLAGNIOL-VILLARD 1f16f058e4 add PNG support
use LodePNG version 20120729 from http://lodev.org/lodepng/

The original coding style is keeped to simplify update.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-12 17:23:38 +02:00
Jean-Christophe PLAGNIOL-VILLARD a60803de67 splash: add support to set a background color
This will allow to reset the screen to a default color when using transparent
PNG.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-12 17:22:47 +02:00
Jean-Christophe PLAGNIOL-VILLARD 2dbdd40d57 splash/bmp: switch to image_renderer
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-12 17:22:47 +02:00
Jean-Christophe PLAGNIOL-VILLARD 6ce5bc4624 bmp: Move bmp rendering to lib/bmp.c
So we can add other 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:21:10 +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
Alexander Aring 5b10582696 commands: move memtest to testing
Move memtest to testing commands menu.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-11 09:46:13 +02:00
Alexander Aring 126f9f0482 commands: move nandtest to testing
Move nandtest in commands menu.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-11 09:46:05 +02:00
Alexander Aring 5603b48dfa commands: add testing menu
Add command menu for testing utilities.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-11 09:45:58 +02:00
Sascha Hauer d7257236a7 Merge branch 'for-next/misc' 2012-09-05 12:59:29 +02:00
Sascha Hauer e5a927883e Merge branch 'for-next/link' 2012-09-05 12:59:29 +02:00
Sascha Hauer 40126ad7f8 Merge branch 'for-next/fs' 2012-09-05 12:59:29 +02:00
Jean-Christophe PLAGNIOL-VILLARD dccdc2ed88 dirname: add -V option to return only path related to the mountpoint
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-09-05 03:22:14 +08:00
Jean-Christophe PLAGNIOL-VILLARD 0939b7c549 ls: add symlink support to -l
barebox:/ ls -l /env/init.d/
drwxrwxrwx          0 .
drwxrwxrwx          0 ..
lrwxrwxrwx         11 net -> ../boot/net

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-09-05 03:22:14 +08: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 f26472f2d1 test: add -L support to test if it's a symbolic link
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-09-05 03:22:14 +08:00
Jean-Christophe PLAGNIOL-VILLARD 94fd74dda7 command/mount: add autodetection support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-09-04 09:08:39 +02:00
Antony Pavlov 7039368327 commands/digest: don't print checksum for non-existing files
This fixes the case:

  barebox:/ md5sum non-existing-file
  non-existing-file: No such file or directory
  00000000000000000000000000000000  non-existing-file     0x00000000 ... 0xffffffffffffffff
  barebox:/

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-04 09:08:39 +02:00
Steffen Trumtrar f64bd3d932 trivial: bootm: correct grammar in error message
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-08-31 09:26:39 +02:00
Steffen Trumtrar af23372773 trivial: fix spelling in usb code
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-08-31 09:26:39 +02:00
Jean-Christophe PLAGNIOL-VILLARD 9812795873 arm: do not enable the previous bootz command
as we now support via bootm

on ixp4xx we still need it so keep it so far.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-08-28 09:51:31 +02:00
Antony Pavlov 0d6aa9a82b commands/digest: don't print checksum for non-existing files
This fixes the case:

  barebox:/ md5sum non-existing-file
  non-existing-file: No such file or directory
  00000000000000000000000000000000  non-existing-file     0x00000000 ... 0xffffffffffffffff
  barebox:/

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-08-28 08:48:46 +02:00
Jean-Christophe PLAGNIOL-VILLARD 73918efe1a bootm: do not load the initrd in the common code
This need to be handled by the arch bootm as the address can be invalid and
provided at arch level.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-08-13 14:48:13 +08:00
Antony Pavlov 58713d3274 commands: memset: fix help message
memset has no '-s' option so remove related help string.
Also this patch makes the command's description more clear.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-08-09 08:44:38 +02:00
Sascha Hauer 88107f6e12 Merge branch 'for-next/randconfig' 2012-08-01 17:49:27 +02:00
Sascha Hauer 9204bf87d6 Merge branch 'for-next/misc' 2012-08-01 17:49:27 +02:00
Sascha Hauer 239fa8cc9b mem md: make md -s /dev/something work again
Since

|commit d22b85a203
|Author: Sascha Hauer <s.hauer@pengutronix.de>
|Date:   Wed Jul 4 23:41:13 2012 +0200
|
|    mem md: bail out without arguments
|
|    Without arguments the 'md' command defaults to show address 0 which
|    likely results in a NULL pointer exception, so only three keystrokes
|    are necessary to crash barebox. Show usage instead if 'md' is invoked
|    without arguments, so that it at least requires an address to be given
|    to crash barebox. This increases the stability of barebox by 66%. Hurray!

barebox does not crash any longer when a plain 'md' without additional arguments
is exectuted. However, doing a 'md -s /dev/nor0' was a standard usecase which now
does not work anymore.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-08-01 08:36:39 +02: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 ed71cd5c82 loadb: fix compilation
'ofd' is always needed, even if LOADB is not selected.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-25 09:27:27 +02:00
Sascha Hauer f8f570ea88 exec command: Fix compilation
read_file and run_command take an additional argument now.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-25 09:27:27 +02:00
Sascha Hauer a6ce65b121 uimage: introduce UIMAGE Kconfig symbol
Both the uimage command and the bootm command need uImage support, so
add a Kconfig symbol for it to be able to select it properly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-25 09:27:27 +02:00
Uwe Kleine-König b78e5fe9f3 commands/crc: assert newline after output with big offsets
This fixes

	barebox@Very long board name:/ crc32 -f /dev/mem 0x83f00000+0xfff
	CRC32 for /dev/mem 0x83fff000 ... 0x83fffffe ==> 0xa080584bbarebox@Very long board name:/

The problem here was that the return value of
lseek(fd, 0x83f00000, SEEK_SET) (which is 0x83f00000) was casted to an
int (which is -2081423360), returned to do_crc and interpreted as
error there without yielding another error message.

This also makes

	crc32 -f /dev/mem 0xffffffff+0x1

die on a NULL pointer exception instead of reporting:

	lseek: No error

:-)

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-17 20:41:17 +02:00
Sascha Hauer 4987f61ee2 mtd: fix bad block ioctls
Since this commit we interpret the argument to the bad block ioctls
as a pointer to a 64bit number:

|commit e71c343668
|Author: Sascha Hauer <s.hauer@pengutronix.de>
|Date:   Fri Oct 14 11:57:55 2011 +0200
|
|    mtd: fix arguments to bad block ioctls
|
|    In the Kernel the mtd ioctls expect a pointer to the offset, whereas
|    barebox interprets the pointer itself as an offset. Since we want
|    to add 64bit support for file sizes a pointer may not be sufficient,
|    so align with the kernel and convert it to a pointer to the offset.
|
|    Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

This missed some places, fix them aswell.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-10 19:07:33 +02:00
Sascha Hauer d22b85a203 mem md: bail out without arguments
Without arguments the 'md' command defaults to show address 0 which
likely results in a NULL pointer exception, so only three keystrokes
are necessary to crash barebox. Show usage instead if 'md' is invoked
without arguments, so that it at least requires an address to be given
to crash barebox. This increases the stability of barebox by 66%. Hurray!

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-05 20:49:02 +02:00
Sascha Hauer 8d064097eb fs: fix standard zero, full devices
The standard devices are currently broken since they have
the size ~0. As now files use loff_t as file size which is a signed
type the read implementation gets confused and now returns -1.

The current implementation also has the (somewhat theorical) problem
that we do not have real streaming devices, so /dev/zero went out
of zeroes after reading 4GB (or now LLONG_MAX).

This patch introduces a new cdev flag DEVFS_IS_CHARACTER_DEV and a new
file size flag FILE_SIZE_STREAM which makes it possible to create
real stream devices instead.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-04 08:38:22 +02:00
Sascha Hauer 1510c57e93 Merge branch 'for-next/resource-size'
Conflicts:
	drivers/base/resource.c
	fs/fs.c
2012-07-02 11:05:57 +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 7242eb7605 Merge branch 'for-next/basename-dirname' 2012-07-02 10:58:52 +02:00
Sascha Hauer a3251562db Merge branch 'for-next/64bit' 2012-07-02 10:58:32 +02:00
Sascha Hauer 5f03074ea9 resource: store 'end' instead of 'size' in struct resource
Storing the size instead of the resource end in struct resource was
a mistake. 'size' ranges from 0 to UINT[32|64]_MAX + 1 which obviously
leads to problems. 'end' on the other hand will never exceed
UINT[32|64]_MAX. Also this way we can express a iomem region covering
the whole address space.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-01 08:18:53 +02:00
Alexander Shiyan 20addb80f6 commands: uncompress: fix description
Command "uncompress" can handle not only with LZO-format, so we just
changed description for command.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 22:10:21 +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
Sascha Hauer aece3fb42c memory commands: Make 64bit capable
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 16:53:25 +02:00
Sascha Hauer 849ce2df7a make st_size in struct stat 64 bit
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 16:53:24 +02:00
Sascha Hauer 7b65cb7567 make memory display 64bit capable
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 16:53:24 +02:00
Sascha Hauer efa379f224 make parse_area_spec arguments loff_t
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 16:53:24 +02:00
Sascha Hauer 3e503822c7 use loff_t for file offsets
This is a first step for 64bit file support: Make the file sizes/offsets
64bit.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 16:53:24 +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
Sascha Hauer a0b0611477 remove dead rarpboot command
This code is unused, remove it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:47:04 +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
Steffen Trumtrar f2bfcf98a1 common: fix typo cammand_var_complete
Change function name to command_var_complete in all calls and its declaration.

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 488dc91f93 Added "/dev/full" and "/dev/null" devices
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
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 fd4c51aa28 Merge branch 'pu/sandbox-fixes' 2012-06-25 19:19:52 +02:00
Sascha Hauer 2ca512e592 print out resource_size_t correctly
resource_size_t can be 32bit or 64bit depending on the architecture.
Add a define for it to be able to printf a resource_size_t correctly

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-25 14:45:43 +02:00
Sascha Hauer 8ee6700a4c x86 linux16 command: Add missing include
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-25 14:38:30 +02:00
Sascha Hauer b3377b07f6 bootm: Add default images variables
It turns out useful to be able to configure bootm before its usage.
This allows us to overwrite bootm settings on an individual base.
This patch adds global variables to configure the kernel image, the
initrd image and the devicetree image. These values will be used
unless overwritten explicitely with command line switches.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-18 12:26:52 +02:00
Sascha Hauer 831be2ecee lseek: return -1 instead of -errno
The patch making errno a positive value has another bug:
lseek was switched to return -errno instead of -1. This does not
work since we can lseek we can address the whole 4G address space,
have of which has a negative offset when interpreted as a signed
integer. Let lseek return -1 on failure again instead.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-18 11:19:04 +02:00
Sascha Hauer e741110f5a Merge branch 'master' into next 2012-05-16 20:23:44 +02:00
Sascha Hauer 4cfc3ab0e9 edit: Add a status line
When invoked from a skript it's useful to know which file is edited. Also
Add information how to exit the editor to the status line.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-16 08:51:05 +02:00
Sascha Hauer ee4cab9e58 booting: more flexible Linux bootargs generation
We currently use the environment variable 'bootargs' to get the
Linux bootargs. This patch allows for a more flexible bootargs
generation using global variables. With it the Linux bootargs
are concatenated from multiple variables. This allows to replace
parts of the bootargs string without having to reconstruct it
completely.
With this bootargs can be constructed like:

global linux.bootargs.base="console=ttyS0,115200"
global linux.bootargs.ip="ip=dhcp"
global linux.mtdparts="physmap-flash.0:512K(nor0.barebox),-(root)"

This will then automatically be combined into a kernel bootargs
string during boot.

If the 'linux.bootargs.' variables are all empty the old standard
'bootargs' way will be used.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-14 09:16:31 +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 9b42dfff0f timeout: allow to set a variable with the key pressed
Useful if we want to know which key caused the timeout.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-14 08:37:39 +02:00
Sascha Hauer 6188685091 Make errno a positive value
Normally errno contains a positive error value. A certain unnamed developer
mixed this up while implementing U-Boot-v2. Also, normally errno is never
set to zero by any library function.
This patch fixes this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-14 08:35:54 +02:00
Sascha Hauer 89eb305e49 echo: Fix help
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-14 08:35:19 +02:00
Alexander Shiyan 714c20c568 Removed duplicate definition for DEVFS_PARTITION_xxx
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-13 21:58:19 +02:00
Alexander Shiyan f49387add0 i2c: Added switch for allowing usage 16bit register addresses
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-13 11:01:08 +02:00
Alexander Shiyan c7c32736bc i2c: Fix barebox crash when 'count' is not set for i2c_read command
Running i2c_read without the 'count' setting causes an error and reboots.

barebox@Phytec phyCORE-i.MX27:/ i2c_read -b 1 -a 0x4a -r 0x00
ERROR: out of memory
no stack data available

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-11 20:12:19 +02:00
Sascha Hauer e4e3fbd22b improve complete support
The following patch serie improve the complete support
 by adding a complete framework to aalow commands complete support.
 
 The add also car complete support for eval and setting and executable
 file support
 
 This also include an update of the stringlist API to support asprintf
 API
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJPnohsAAoJEOrjwV5ZMRf2qeIQAIC7WrIao0mB2pIB+51MqeU+
 sof7GLxUl0MWXFFc3OFEHDcY5grC867mBmB9+uDG1mvcxa/bUpw+jMRMrki5j4Kg
 mjaHQ2UCvDjMHqQi7ISc/WTyJb09mtduFIceP0EftAmG8Mb5n9XOMaKwL9r/UQHB
 ps9MijnI/QeFqbrmBZcuaCp59QsPvipYw8NMJITBu2VvWrpKTIox33qPfNATDuEV
 SzMoLwz+uD7W7dEAM/A1uFdo4K5fLyZruDVGQoQ8CRS+zW3E6rr/EakpN5mhr/66
 dVZYO1xWppBaefIJQ1RD6bvwlFvesuuvQmMtDxsCsp07fyBolEWfFzblrwdkbueY
 NPwWExV5nzbRdAKKSyhU/nHiQ2edOQQZtHDAbnM4zh5e6lK7YLrzVklzT4Dfhzn0
 GRdnjCmiQiaZdmAEHe8wte2nr3Lc01fTsj/EFVA+LYP3a9by1iG2Zn3/ChieVcN4
 R+o/2lMBdhxsTszcmwMOemdqVPlt/0VmEXrKGtjTIZEViuQyyhY8ZtEaf4C0zeln
 Jf60t0ZvkehAJc0Lo4UOygjzvErqcKoHMk7utAjP+bi1KcMgF3Q+HmtCnJJs2FHw
 c40FZj1WcLPStEiS1way7miBakxOy2zPumKi1OXx+140L25C1nvQPYu8ilOZHEyU
 opNlo+wQ8h5sG/054kYL
 =rYfw
 -----END PGP SIGNATURE-----

Merge tag 'complete_update_support' of git://git.jcrosoft.org/barebox into next

improve complete support

The following patch serie improve the complete support
by adding a complete framework to allow commands complete support.

The add also car complete support for eval and setting and executable
file support

This also include an update of the stringlist API to support asprintf
API
2012-05-01 21:41:59 +02:00
Sascha Hauer 61269bd7c6 bootm: fix initrd handling
bootm_initrd tests for data->initrd, but this never becomes true because
the settingof data->initrd is inside a if(bootm_initrd()). Fix this. Also,
do not support the initrd options when initrd is disabled.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-01 21:40:41 +02:00
Jean-Christophe PLAGNIOL-VILLARD 7e3a16ef14 complete: add delpart complete support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-30 20:37:40 +08:00
Jean-Christophe PLAGNIOL-VILLARD c43a087718 complete: add go and sleep support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-30 20:37:40 +08:00
Jean-Christophe PLAGNIOL-VILLARD b7fc51bd79 complete: add eth interface complete support
use it on ethact

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-30 20:37:40 +08:00
Jean-Christophe PLAGNIOL-VILLARD 8e6f45f54f complete: add empty complete support
for cpuinfo, clear, dhcp, false, login, lsmod, meminfo, passwd, pwd, reginfo,
reset, true, usb, version

for mach-imx and mach-mxs: dump_clocks
for u_serial: mycdev

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-30 20:37:40 +08:00
Jean-Christophe PLAGNIOL-VILLARD 8aa463f785 complete: add help complete support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-30 20:37:39 +08:00
Sascha Hauer b2c48771cb edit: Add proper screen size handling
We used to have a quite slow algorithm to detect the screen size
which was unused for long time. This patch changes this to first
set the cursor to x=999, y=999 and the read back the actual cursor
position. Since I am not confident that this works on all terminals
this is only used when edit is called as 'sedit'.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-30 13:24:47 +02:00
Jean-Christophe PLAGNIOL-VILLARD d18fef5a63 menu: fix non command management support
the auto select is always available

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-23 19:51:06 +08:00
Sascha Hauer a7ddbc4086 Merge branch 'binfmt' of git://git.jcrosoft.org/barebox into next 2012-04-18 20:42:17 +02:00
Steffen Trumtrar 030b5a1ba5 bootm: Align oftree
Arm needs 64-Bit alignment of the oftree as mentioned in the documentation
Documentation/arm/Booting.

Other architectures may need a bigger alignment so align to 4K.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-18 20:38:24 +02:00
Steffen Trumtrar 89c2c5cff8 bootm: Fix check for ret-value
The intention of this code was to check the return value of fdt_open_into. Fix
this.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-18 20:38:24 +02:00
Jean-Christophe PLAGNIOL-VILLARD 7ae2c6261b bootm: add uimage binfmt support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-18 20:14:58 +08:00
Sascha Hauer 3170433558 Merge branch 'master' into next 2012-04-17 22:05:37 +02:00
Sascha Hauer eeb3440419 automount: optionally make directory
Add an option to create the mount path to make using this command easier.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-15 16:50:54 +02:00
Sascha Hauer b3aea10890 automount: fix argument parsing
With getopt we have to use argv[optind] instead of hardcoded argv[0]

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-15 16:50:23 +02:00
Sascha Hauer ff879a2d4c bootm: be more informative with oftrees
- print error message when the specified oftree cannot be opened
- move verbose info to top of function so that the information is
  printed before something else fails.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-14 15:32:45 +02:00
Sascha Hauer 6a0ab1d787 addpart: remove duplicate line in help text
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-14 15:28:32 +02:00
Jean-Christophe PLAGNIOL-VILLARD 5efbed3b27 arm: add Android boot image support
The Android Image contains 3 components and params

 - kernel
 - initrd
 - second stage (optional)

 - tags addr
 - bootargs

In fast boot the initrd is mandatory, in barebox we are less restrictive
use the initrd only if present

add to env params:
aimage_noverwrite_bootargs
	Disable overwrite of the bootargs with the one present in aimage

aimage_noverwrite_tags
	Disable overwrite of the tags addr with the one present in aimage

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-13 12:08:42 +02:00
Uwe Hermann c13477bbdb Remove EXPERIMENTAL flag from loady.
From bd6c5c884337ae2d4ef41d85d59c2d5ec525f8a5 Mon Sep 17 00:00:00 2001
From: Uwe Hermann <uwe@hermann-uwe.de>
Date: Fri, 6 Apr 2012 17:30:01 +0200

The loady command seems to work just fine (tested on an S3C2440 target).

Also, mark it as TRISTATE like loadb and loads.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-10 09:59:28 +02:00
Sascha Hauer b3c1fda092 partition command: optionally do not automatically prepend the device name
We used to automatically prepend the device name before the partition
name. So when we added a partition named 'barebox' to a device named
'nor0' the partition was named 'nor0.barebox'.

The Kernel can mount its rootfs based on the mtd name, for example with
root=mtd:root. If for example we have multiple mtd devices (nor and nand)
'root' is a bad name for the partition, it should better be 'nor0.root'

This patch adds an additional commandline switch to addpart to optionally
skip the automatic device name adding. This makes it possible to define
our mtd partitions like this:

nor_parts="512k(nor0.barebox)ro,128k(nor0.bareboxenv),2M(nor0.kernel),-(nor0.root)"

This way the barebox partition names stay the same, but we can now
pass the exact name to the kernel (root=mtd:nor0.root).

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-03-18 15:03:31 +01:00
Sascha Hauer 7e614c143d usb command: by default scan only once for USB devices
We normally do not expect USB devices to be hotplugged. Instead of
rescanning each time the usb command is called, scan only once.
This makes the usb command safe for being called multiple times
without making already registered USB devices reinitialized. To
really scan multiple times a '-f' option is introduced.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-03-18 15:03:31 +01: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
Sascha Hauer b55fbf7f5f fs: drop struct mtab_entry
every struct fs_device_d contains a struct mtab_entry, so they
have a 1:1 relationship. Instead of having to use container_of
to get from a struct mtab_entry to a struct fs_device_d we can
better embed the members of struct mtab_entry into struct fs_device_d
directly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-03-17 18:16:03 +01:00
Sascha Hauer beb36c510b Merge branch 'work/thumb2' into next 2012-03-06 09:39:59 +01:00
Sascha Hauer 104a6a7ccf ARM: Allow to compile in thumb-2 mode
This shrinks the resulting binary size by ~25%. Exceptions
are still handled in arm mode, so we have to explicitely
put .arm directives into the exception code. Thumb-2 mode
has been tested on i.MX51 Babbage board.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-03-06 09:37:59 +01:00
Sascha Hauer 33d1cc4bf2 commands: remove struct command pointer from commands
This is unused in all commands and thus can be removed.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-27 20:28:07 +01:00
Sascha Hauer 7a61f5db46 cp: fix memory leak
dst is an allocated string, we have to free it also when
copy_file fails.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-27 19:53:52 +01:00
Sascha Hauer 2546c5a514 Merge branch 'pu/device-cleanup' into next 2012-02-17 10:27:31 +01:00
Sascha Hauer 8a81eab846 fs: Store mtab entries in list
To make the code a bit easier to read. Also, do not allow
to umount / when something else is mounted.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-17 10:27:15 +01:00
Sascha Hauer c20952a621 Merge branch 'master' into next 2012-02-15 12:59:10 +01:00
Jean-Christophe PLAGNIOL-VILLARD 9f5c1f2a99 dfu: add description how to specify the "description" to the long help
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-14 15:01:52 +01:00
Sascha Hauer 238b7b1d99 uimage: Fix error message
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-13 09:51:20 +01:00
Jean-Christophe PLAGNIOL-VILLARD f4147cd621 CMD_UNCOMPRESS: select UNCOMPRESS
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-16 09:36:01 +01:00
Sascha Hauer 8742816771 Merge branch 'pu/jean-codesize' into next 2012-01-13 09:33:36 +01:00
Jean-Christophe PLAGNIOL-VILLARD 507319e13b filetype: add config to disable it
remove 160 bytes

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-01-11 21:22:34 +08:00
Jean-Christophe PLAGNIOL-VILLARD e7aa252938 uncompress: add config to disable it
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-01-11 21:22:34 +08:00
Jean-Christophe PLAGNIOL-VILLARD b7498fdb82 banner: add config to disable it
this will allow to save 144 bytes

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-01-11 21:22:34 +08:00
Alexander Aring 58ad6c152a nandtest: add missing select.
Add select PARTITION_NEED_MTD in nandtest.

Signed-off-by: Alexander Aring <a.aring@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-06 09:49:37 +01:00
Alexander Aring 75a646755c nandtest: fix typo
Fix typo nand -> nandtest.

Signed-off-by: Alexander Aring <a.aring@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-06 09:49:37 +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
Wolfram Sang 3fada2bced command: flash: remove broken filename check
It makes no sense to check the filename pointer here, because a) we have
already been using it and b) argc has been tested against 1 already, so
argv[1] should not be NULL. So, drop the checks.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-22 10:08:09 +01:00
Alexander Aring 84f0a81899 commands/ls: add to use sorted-insert
Added sorted insert to ls command.

Signed-off-by: Alexander Aring <a.aring@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-21 12:38:14 +01:00
Sascha Hauer abeea4d7f3 bootm: Add missing Kconfig dependency
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-17 16:37:14 +01:00
Sascha Hauer 146a7fe4a2 Merge branch 'work/uimage' into next
Conflicts:
	arch/ppc/lib/ppclinux.c
	commands/bootm.c
	include/boot.h

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-17 16:33:57 +01:00
Sascha Hauer 84fd8a956c Merge branch 'pu/ppc-oftree' into next 2011-12-15 20:12:32 +01:00
Sascha Hauer 609c4a988c ppc: switch to libfdt based oftree implementation
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-15 20:11:47 +01:00
Sascha Hauer 40c9e6b22b Merge branch 'pu/misc' into next 2011-12-15 20:03:17 +01:00
Sascha Hauer 467a675626 Merge branch 'master' into next
Conflicts:
	arch/arm/boards/usb-a926x/init.c
	arch/arm/mach-pxa/include/mach/clock.h
	arch/arm/mach-pxa/speed-pxa27x.c

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-15 19:58:56 +01:00
Sascha Hauer fc72640247 remove unused watchdog header
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-15 11:46:50 +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
Sascha Hauer d4e5c6b8a0 bootm: use new uimage code
This switches the bootm code to the new uimage code. Also
bootm can now handle other types of images than uImages.
Currently the only architecture making use of this is
arm which allows to boot zImages, raw images and barebox
images.
I intended to make a more bisectable series from this but
I failed becuase there are many dependencies and no matter
how I tried the patches grew bigger and and bigger. So I
decided to put this all in a single patch.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-15 11:07:11 +01:00
Sascha Hauer a46098b1d1 ppc: switch to libfdt based oftree implementation
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-14 13:40:17 +01:00
Sascha Hauer ce66d6da75 Add missing code from linux_exec command
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-13 09:52:18 +01:00
Sascha Hauer 0e43141403 time command: Fix needed string length
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-08 13:46:36 +01:00
Sascha Hauer 3180d4b3e3 bootm: factor out initrd code from option parser
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-07 17:47:43 +01:00