9
0
Fork 0
Commit Graph

1040 Commits

Author SHA1 Message Date
Sascha Hauer d94579abaf hush source: expand $PATH
The behaviour of other shells suggest that with source or '.'
the path should be resolved using the PATH environment variable. Do
the same in barebox.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-03-18 15:03:31 +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 d59925b8fb command: do not allow abbreviated commands anymore
abbreviated commands are derived from U-Boot and are only
partly useful. Noone expects from a shell to support this,
also we have tab completion. They also have some funny
side effects. For example we have a 'time' command. If this
command is not compiled in, the time command is interpreted
as an abbreviated version of the 'timeout' command. So remove
support for abbreviated commands and safe the binary space.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-27 20:08:09 +01: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 a9236dd6b5 console: use container_of instead of type_data
This reduces the usage of type_data.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-25 15:16:14 +01:00
Sascha Hauer 16babe2c7f add string for -ETIMEDOUT
-ETIMEDOUT is a common error value, so print the string rather
than just the number.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-19 18:51:03 +01:00
Sascha Hauer 3ac63c6388 make uimages work on tftpfs
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-19 18:51:03 +01:00
Sascha Hauer 2546c5a514 Merge branch 'pu/device-cleanup' into next 2012-02-17 10:27:31 +01:00
Sascha Hauer 80b767748b dos partitions: Do not register as fixed partitions
A fixed partition means that we can't remove it. This is only suitable
for our vital /dev/self0 and /dev/env0 partitions, so remove the fixed
flag.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-17 10:27:15 +01:00
Sascha Hauer 06f66dc054 Merge branch 'pu/block' into next 2012-02-17 10:25:24 +01:00
Jean-Christophe PLAGNIOL-VILLARD 1f22d10f15 readkey: add define for Ascii keys
this will simplify the usage of gpio keyboard

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-02-16 18:17:32 +08:00
Sascha Hauer e3a9e1fd62 block: reimplement caching
The current caching layer only has a single buffer for
writing and reading. The FAT driver often accesses the
fat and then data again, which currently can't be cached.
Reimplement this with a list of cached chunks. The number
of chunks and their sizes are currently hardcoded, but
that could be easily made configurable.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-15 08:21:43 +01:00
Sanjeev Premi 21ea9e0f54 Select CMD_LOADENV with DEFAULT_ENVIRONMENT
The environment isn't loaded until this command is
is selected - even if compiled in.

This patch makes the dependency explicit.

Signed-off-by: Sanjeev Premi <premi@ti.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-07 23:17:43 +01:00
Sascha Hauer 192d6fe9be Merge branch 'pu/debug' into next 2012-01-27 09:31:13 +01:00
Sascha Hauer 641dfaa3a8 startup: use regular debug statements in initcall debugging
Now that we don't need malloc for the console anymore it's
safe to call printf anytime, so switch the initcall debugging
to regular debug() statements..

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-26 14:12:04 +01:00
Sascha Hauer 6d2ac13be0 initcalls: do not hang if an initcall fails
Currently we just hang when an initcall fails. This resulted
in most initcalls just returning 0 unconditionally. Instead
of hanging which usually leaves the user without a clue what
happened just continue and hope for the best.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-26 14:05:28 +01:00
Sascha Hauer 64a46e2217 console: make it work without malloc
This changes the dynamically allocated kfifos to statically initialized
ones. This makes the console work without malloc and thus safe to be
called before malloc is initialized.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-26 13:59:20 +01:00
Jean-Christophe PLAGNIOL-VILLARD 463229490e introduce barebox_bare_init_size to known the bare_init size and check it
this allow to check we do not exceed the size of the SRAM as example

introduce BAREBOX_MAX_BARE_INIT_SIZE the maximum size of bare_init
this will allow your bare_init will fit in SRAM as example
ARCH can overwrite it via ARCH_BAREBOX_MAX_BARE_INIT_SIZE

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-23 09:43:28 +01:00
Jean-Christophe PLAGNIOL-VILLARD 064beaa73b add config to check if the size of barebox exceed the target size
CONFIG_BAREBOX_MAX_IMAGE_SIZE will allow to detected silent oversize result

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-17 18:48:54 +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 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
Jean-Christophe PLAGNIOL-VILLARD 77b1e27530 dummy_malloc: add calloc support
needed to use menu framework

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-11 09:36:30 +01:00
Jean-Christophe PLAGNIOL-VILLARD 4c4fae147d poller_call: move from getc to is_timeout
this will allow to always call poller_call even durring timeout
and still the case in getc

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-04 14:10:13 +01:00
Sascha Hauer 2071c5dcfb Merge branch 'pu/tlsf' into next 2012-01-03 09:39:16 +01:00
Jean-Christophe PLAGNIOL-VILLARD 26927bafde defaultenv: use a compressed version when embedded in barebox
enable it only if a compression is enabled
support gzip, bzip2 and lzo

you will be able to choose which compression to use

-rw-r--r--  1 root root    8436 Dec 15 01:35 barebox_default_env
-rw-r--r--  1 root root    2782 Dec 15 01:35 barebox_default_env.bz2
-rw-r--r--  1 root root    2691 Dec 15 01:38 barebox_default_env.gz
-rw-r--r--  1 root root    3262 Dec 15 01:38 barebox_default_env.lzo

with using gzip and the default env we can save 5.6KiB (5,745 bytes)
with using bzip2 and the default env we can save 5.5KiB (5,654 bytes)
with using lzo and the default env we can save 5.1KiB (5,174 bytes)

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-02 11:47:49 +01:00
Sascha Hauer c09fdea2c0 tlsf: remove unused stuff from tlsfbits.h
Also, as this file is locally used by the tlsf implementation,
move this file to common.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-23 11:29:10 +01:00
Sascha Hauer 5d96cda944 tlsf: implement malloc_stats
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-23 11:29:10 +01:00
Sascha Hauer 2467c61b3b tlsf: enable assertions
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-23 11:29:10 +01:00
Antony Pavlov b25bb1f072 add tlsf-based malloc implementation
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-23 11:26:42 +01:00
Antony Pavlov 282af094a6 adapt tlsf for barebox
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-23 11:26:42 +01:00
Antony Pavlov d5b733a644 import TLSF 2.0 from http://tlsf.baisoku.org/tlsf-2.0.zip
TLSF: Two Level Segregated Fit memory allocator implementation.
Written by Matthew Conte (matt@baisoku.org).
Public Domain, no restrictions.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-23 11:26:42 +01:00
Alexander Aring 56d0d5012f auto-completion: add auto-completion for path files
Add auto-completion for path files.

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 d9d9c41f77 move code now only used in mkimage to mkimage
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-15 11:07:15 +01:00
Sascha Hauer cbf041c630 remove now unused uImage code
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-15 11:07:15 +01:00
Sascha Hauer 390249968c reimplement uImage code
Provide a new API for accessing uImages which makes it easy
for commands to open images, verify them, load to (free) sdram
regions and show information about uImages.

- We now do not load the image to malloced space anymore.
- The data in the header is now stored in cpu native endianess
  after uimage_open which makes it easy to access the header data.
- uImage can be loaded to dynamically allocated sdram regions.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-15 10:59:35 +01:00
Sascha Hauer 9c11a31ce2 filetype: Add oftree detection
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-15 10:20:09 +01:00
Sascha Hauer 56442bb101 oftree: add of_fix_tree()
Currently we have of_get_fixed_tree() which assumes that
there is a global variable holding a oftree. This seems
not very flexible, so for now introduce a of_fix_tree()
which takes an fdt_header as argument and walks the
list of registered of fixup functions.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-15 10:18:14 +01:00
Sascha Hauer a746f4685a remove old ft_build support
This is unused now as its only user (ppc) is switched to
libfdt based oftree support"

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-14 13:40:17 +01:00
Antony Pavlov f17b9efcf7 fix "no previous prototype for 'sbrk'" warning
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-09 10:43:25 +01:00
Sascha Hauer 083b3bd52a make dos partition support default yes if we have disk partition support
DOS partitions are the only partitions we handle at the moment
and without it most MMC/SD enabled configs are useless, so make
it default yes. Also, use 'depends on' instead of 'if'

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Juergen Beisert <jbe@pengutronix.de>
2011-12-07 17:46:17 +01:00
Sascha Hauer 9792a4302b ft_build: temporarily disable bootm oftree support
We do not have any command line parser support for bootm anymore.
Disable it for now to at least be able to compile it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-07 13:07:46 +01:00
Sascha Hauer 4430b1a6fc console_simple: fix compiler warning
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-07 13:05:54 +01:00
Sascha Hauer 7e3a33198a memory: do not try to reserve iomem on sandbox
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-07 13:04:25 +01:00
Sascha Hauer 0ee6847f7b Merge branch 'next' 2011-12-07 12:03:13 +01:00
Sascha Hauer a2792b03ff fprintf: remove unused variable
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-07 11:44:37 +01:00
Sascha Hauer ab6dc1d297 console_simple: Fix compilation
Since fprintf and console_puts now return the number of
character written the prototypes have changes. We forgot
to fix console_simple which now fails to compile with:

common/console_simple.c:48:6: error: conflicting types for 'fprintf'
include/stdio.h:57:5: note: previous declaration of 'fprintf' was here
common/console_simple.c:67:6: error: conflicting types for 'console_puts'
include/stdio.h:20:5: note: previous declaration of 'console_puts' was here

Fix this by returning the proper numbers of characters written.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-07 10:55:19 +01:00
Robert Jarzmik ea8314d19f console: add console unregistering
Some console are transient, like the USB connected serial
console which should be removed when the USB connection is
severed.

Enable console removal for such devices.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-05 17:59:02 +01:00