9
0
Fork 0
Commit Graph

183 Commits

Author SHA1 Message Date
Sascha Hauer d3cb611fc6 string: remove unused bcopy function
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-05 08:47:49 +02:00
Sascha Hauer aed0e6ba03 getopt: save and restore context
execute_command is the single point where commands are executed and thus a new
getopt context is needed. currently we call getopt_reset here to reset the
context. This breaks though when a command tries to run a command itself by
calling execute_command or run_command.  In this case we have to store the
context and restore it afterwards. The same is necessary in builtin_getopt.
Currently noone does this so this one shouldn't fix a bug, but merely allows
us to do such things later.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-27 19:53:47 +01:00
Sascha Hauer 2034ee47b1 getopt: turn commented out printf into debug()
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-27 19:53:42 +01:00
Sascha Hauer 74c70b3980 copy_file: limit progress bar to sensible limits
When copying in verbose mode from a tftp server we might
not know the size of the file being transfered. In this
case print one progress item per 16k instead of one for
each single byte.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-19 18:51:03 +01:00
Sascha Hauer 192d6fe9be Merge branch 'pu/debug' into next 2012-01-27 09:31:13 +01:00
Sascha Hauer 79c2f03aee Add dump_stack function
At least ARM allows us to dump the stack, but we currently
have no prototype for this. Add a dump_stack prototype and
provide a static inline function for architectures without
stack dump support. Also, call dump_stack() in panic() to
provide more information in the case of a panic.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-26 14:12:08 +01:00
Sascha Hauer 178c4978b3 kfifo: change kfifo_init to work with a preallocated fifo
kfifo currently only works with dynamically allocated fifos.
Change the currently unused kfifo_init to take a preallocated
fifo. This allows for statically initialized fifos.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-26 13:57:43 +01:00
Marc Kleine-Budde 957535c66f show_progress: fix progress bar for files > 32 MiB
The next limit with the current code will probably 2GiB.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-25 18:11:45 +01:00
Jean-Christophe PLAGNIOL-VILLARD 971d164f62 param: add config to disable it
this will allow to save 992 Bytes for TI xlaoder or AT91 bootstrap

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-01-11 21:22:34 +08: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
Sascha Hauer 0d22025084 Merge branch 'next' 2012-01-05 10:25:17 +01:00
Robert Jarzmik fa4d33d146 lib: add bitrev utility
Add bit reversing utility, taken from the linux kernel.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-02 12:34:58 +01:00
Robert Jarzmik 1bfde3cea9 lib: add BCH encoding/decoding
As flash memories need BCH correcting codes, add the BCH
library, taken from the linux kernel.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-02 12:34:58 +01:00
Antony Pavlov 0c5310075b decompress_inflate.c: fix "no previous prototype for 'gunzip'" warning
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-02 12:33:52 +01:00
Alexander Aring 049100fe37 stringlist-functions: add sorted insert
Add sorted insert in stringlist functions.
Also added function to checked if string is already
in string list.

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 c7dad7bc16 remove undefined WATCHDOG_RESET
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-19 14:38:21 +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 fc72640247 remove unused watchdog header
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-15 11:46:50 +01:00
Sascha Hauer 4c41e245cf libbb: add read_full/write_full functions
These functions read/write all data or return with an error.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-15 10:20:09 +01:00
Sascha Hauer 90d036d62c uncompress: implement uncompress_fd_to_buf
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-15 10:20:09 +01:00
Sascha Hauer 4bc6ff2f65 uncompress: fix uncompress_buf usage
uncompress_buf is used each time uncompress is called, so
make sure it is initialized correctly so that we do not
call free() on an already free pointer.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-08 13:46:32 +01:00
Sascha Hauer 0ee6847f7b Merge branch 'next' 2011-12-07 12:03:13 +01:00
Sascha Hauer d24e4fcb99 lib: remove nonexistest files from Makefile
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-01 15:11:15 +01:00
Sascha Hauer 62493a5fe1 remove now unused unlzo function
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 21:12:42 +01:00
Sascha Hauer eb1c2e7de6 Add generic uncompress function
uncompress() has the same prototype as the various kernel decompress
functions. It automatically detects the compression type and selects
the correct uncompress function.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 21:12:42 +01:00
Sascha Hauer 83d0904980 lzo: export decompress_unlzo function
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 21:12:42 +01:00
Sascha Hauer 1aac831cca lib: prompt for uncompression functions
Allow the user to manually select the uncompression support
he wants to have so that we have a single point where a user
can see which uncompression support will be compiled in.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 21:12:42 +01:00
Sascha Hauer e3394a7010 remove old zlib
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 21:12:42 +01:00
Sascha Hauer 4b09cdc798 add kernel gunzip implementation
The kernel uncompression functions have a unified API so use this
implementation to get it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 21:12:42 +01:00
Sascha Hauer 15fcc719ab remove old bzlib
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 21:12:42 +01:00
Sascha Hauer 5930f100aa use kernel bunzip implementation
The kernel uncompression functions have a unified API. Switch
to the kernel implementation to unify the different uncompression
APIs. As a bonus the kernel implementation is much smaller.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 21:12:27 +01:00
Sascha Hauer 248e5f1cbe compile in simple_strtoull
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 20:55:50 +01:00
Sascha Hauer e0f4fb2c98 Merge branch 'master' into next
Conflicts:
	drivers/ata/disk_drive.c

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 20:45:23 +01:00
Jan Weitzel e26c1c52ba readkey: Use ARRAY_SIZE
Update to commit:

6df16cb readkey: force return from while true

Use ARRAY_SIZE instead of hardcoded value

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-25 13:50:20 +01:00
Jan Weitzel 6df16cb90d readkey: force return from while true
If read_key is feeded by STRG + KEY_LEFT you run into the while(1)
loop and corrupt memory through esc array.
Force return if index gets too high.

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-22 21:14:28 +01:00
Hubert Feurstein 7bb009c744 commands/cp: add verbose mode which displays progress bar
Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-22 21:13:05 +01:00
Sascha Hauer cf0599f933 Merge branch 'pu/unlzo' 2011-11-22 21:08:45 +01:00
Sascha Hauer 689d9762bb fix unlzo support
unlzo support is broken for files > 256k (more than one block)
since commit a3463cc128
(lib/decompress_unlzo: use fill and full to read and write data)
This patch updates unlzo support to the latest version of the kernel
plus a small buffer free fix.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-17 22:31:56 +01:00
Sascha Hauer c0f9d1bad2 initial oftree command support
This adds basic device tree command support. So far we can
parse a flat device tree (-p), which also stores the tree
in memory, dump it (-d) and free (-f) the internally stored tree.

The chosen node can be updated with barebox bootargs, no other
device tree manipulation is implemented yet.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-10-19 10:09:48 +02:00
Sascha Hauer 9135dd5f67 initial libfdt support
vanilla libfdt 1.3.0 from the dtc git:

git://git.jdl.com/software/dtc.git

Only small adjustments to compile with barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-10-19 10:08:48 +02:00
Jean-Christophe PLAGNIOL-VILLARD 4ac3a1f9e0 move digest to crypto/
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-10-12 08:52:48 +02:00
Sascha Hauer d01070c8af remove EARLY_INIT and EARLY_CONSOLE support
Bitrotted over time and nearly unused, so remove it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-27 10:27:18 +02:00
Jean-Christophe PLAGNIOL-VILLARD 85283965dc drivers/bus: move to drivers/base
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-07-21 13:44:04 +08:00
Sascha Hauer d5b96bdca9 device: Add a dev_request_mem_region function
We might want to add real resource tracking later. Also
The first resource may not be a IORESOURCE_MEM at all.
For these reasons introduce a wrapper function for
driver so that they do not have to fiddle with resources
directly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-07-18 20:20:04 +08:00
Sascha Hauer 56fe623bfe register_device: Add IORESOURCE_MEM flag
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-18 20:17:19 +08:00
Jean-Christophe PLAGNIOL-VILLARD 126c9b69cf device: introduce resource structure to simplify resource declaration
and add multi resource per device support

for now we keep the old map_base and size temporary but will switch all of
the used step by step to them resource way

and mirror the first resource to the map_base and size if available

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-07-18 07:57:49 +08:00
Antony Pavlov d93a20734d lib/readline.c: fix unused-but-set-variable gcc warning
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-04 08:59:39 +02:00
Sascha Hauer 583fe4fc0e copy_file: handle write return value correctly
write() does not necessarily consume all input, handle this
case correctly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-12 09:54:56 +02:00
Sascha Hauer d354cee3d0 kfifo: kfifo_put takes a const buffer
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-12 09:54:56 +02:00