9
0
Fork 0
Commit Graph

1040 Commits

Author SHA1 Message Date
Jon Ringle e9831a6817 defaultenv: fix empty CONFIG_DEFAULT_ENVIRONMENT_PATH
if CONFIG_DEFAULT_ENVIRONMENT_PATH="" then
$(DEFAULT_ENVIRONMENT_PATH) expands to 'defaultenv "" '
The "" would cause every single file found in $(srctree) to be included in
$(ENV_FILES). This would then cause scripts/mod/sumversions.c to get
recompiled using $(CC) and fail compilation if $(CC) points to a newlib
cross compiler

Signed-off-by: Jon Ringle <jon@ringle.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-23 09:46:29 +01:00
Sascha Hauer 3e48ef43ed Merge branch 'master' into next 2011-03-10 14:50:25 +01:00
Sascha Hauer f4491d7b04 kallsyms/printk: enable symbol printing support (%pS)
With this kallsyms finally start working at least on ARM. This
enables us resolving addresses into symbols which is particularly
useful in combination with stack unwinding support. As kallsyms
now compile and work we can remove the depends on BROKEN.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-10 14:50:16 +01:00
Sascha Hauer 0ed964589c module: CONFIG_COMMAND does not exist anymore, remove ifdefs
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-10 14:48:49 +01:00
Sascha Hauer 06ea6c135d Merge branch 'next' 2011-02-03 10:49:18 +01:00
Juergen Beisert 76dd3e70a5 Fix default baudrate setting
The menu entry to set the default baudrate (CONFIG_BAUDRATE) makes no sense,
as long as its content is not used. This patch makes barebox using the setting
again.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-18 14:24:09 +01:00
Sascha Hauer 3e892255b3 startup: make debug printing of linker variables work again
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-17 11:05:14 +01:00
Sascha Hauer 2f0109b1bb Merge branch 'master' into next 2011-01-17 09:43:40 +01:00
Marc Reilly 0764c345f7 Init env context a bit earlier in initalization sequence.
Ensures subsequent init functions to export environment variables during
init without having to rely on linking order being correct.

Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-10 20:04:34 +01:00
Sascha Hauer 63100f4e15 device tree: fix printf compiler warnings
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-07 11:36:50 +01:00
Krzysztof Halasa 1b6a3e3634 Silence few warnings.
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-12-21 09:02:40 +01:00
Sascha Hauer 50352ae9d9 Merge branch 'led' into next 2010-12-21 08:25:31 +01:00
Marc Kleine-Budde 0277a663bc Add generic poll infrastructure
Barebox does not have interrupt functionality. Nevertheless it's
sometimes useful to periodically call functions, like for example
a heartbeat LED or watchdog reset. Instead of cluttering the code
with calls to these functions this patch adds a generic polling
infrastructure. Code which might run for longer now can call
poller_call() periodically which in turn will call all registered
pollers.
This patch adds a call to poller_call in two generic pathes. First
of them is getc() which covers waiting for uart input. Second is
ctrlc() which should be called anyway from code which might run
for longer. So instead adding poller_call directly to your code,
consider checking ctrlc instead which also gives additional
convenience to the user.
The poller code is safe against reentrancy which means that it's
safe to call poller_call inside a poller.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-12-20 09:28:21 +01:00
Peter Korsgaard 1945936991 console_simple: add fprintf / console_list for commands/loadb.c
commands/loadb.c doesn't build with CONFIG_CONSOLE_SIMPLE, because it uses
fprintf / for_each_console (which uses console_list).

Fix it by adding trivial implementations of both in console_simple.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-12-12 09:27:40 +01:00
Robert Schwebel c84a37d52b parser: use debug macros
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-01 11:44:48 +01:00
Robert Schwebel bd8db893bb doc: silence doxygen warnings
Silence these warnings:

common/kallsyms.c:8: Warning: documented function `const u8 kallsyms_names' was not declared or defined.
common/kallsyms.c:10: Warning: documented function `const u8 kallsyms_token_table' was not declared or defined.
common/kallsyms.c:11: Warning: documented function `const u16 kallsyms_token_index' was not declared or defined.
common/kallsyms.c:13: Warning: documented function `const unsigned long kallsyms_markers' was not declared or defined.

Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-22 20:47:03 +02:00
Sascha Hauer d32a9273cf common/memsize.c: add missing include
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-21 22:21:25 +02:00
Sascha Hauer 361bb24081 common/environment.c: sparse fixes
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-21 22:21:25 +02:00
Sascha Hauer e2fadcc34a version_string: sparse fixes
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-21 22:21:24 +02:00
Sascha Hauer 6de93941c2 common/env.c: sparse fixes
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-21 22:21:24 +02:00
Sascha Hauer 345d93eb7c hush: sparse fixes
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-21 22:21:24 +02:00
Sascha Hauer f538b46572 console: sparse fixes
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-21 22:21:23 +02:00
Sascha Hauer 5a049d8b5d dlmalloc: sparse fixes
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-21 22:21:23 +02:00
Sascha Hauer a64c756ad9 image: remove confusing image_check_* functions
The function names do not make it clear what return value
is expected and do not save a single line of code. Put
the code inline and unbreak the wrong checks introduced
with a3c1e5d888.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Eric Bénard <eric@eukrea.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-10-13 17:39:49 +02:00
Jean-Christophe PLAGNIOL-VILLARD 3b8942faa0 defaultenv/update: add check crc32 options
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-12 21:32:45 +02:00
Jean-Christophe PLAGNIOL-VILLARD 5c3538f44d defaultenv/update: merge update_rootfs and update_kernel
use getopt to simplify it and prepare for xmodem support

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-12 21:32:44 +02:00
Jean-Christophe PLAGNIOL-VILLARD 4dfd5b5c62 defaultenv: introduce CONFIG_DEFAULT_ENVIRONMENT_GENERIC to enable it
this will we usefull to enable functionnality if used

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-12 21:32:44 +02:00
Sascha Hauer 914e2f8f7f hush: implement getopt builtin
Positional parameters are not nice, so implement a getopt
function. This has to be done as a builtin because otherwise
we have no access to the parents argc/argv.

getopt works as expected, here is a little example:

while getopt "hs:" OPT
do
        if [ $OPT = h ]; then
                echo "usage"
                exit 1
        else
                echo "scr: opt: $OPT optarg: $OPTARG"
	fi
done

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-08 15:30:43 +02:00
Sascha Hauer 97b2a33c50 hush: fix nasty memory leak in hush
Fix memory leak in globbing part of hush. a simple '['
on the command line was enough to trigger it.
We must call globfree() before setting the glob structure
to zero.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-08 14:18:37 +02:00
Sascha Hauer dff63d2399 hush: pass context around in shell
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-08 11:40:09 +02:00
Jean-Christophe PLAGNIOL-VILLARD 24b499f3fe image: factorise image printing contents
Copied from U-Boot

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-10-08 00:06:23 +08:00
Jean-Christophe PLAGNIOL-VILLARD a3c1e5d888 Replace direct header access with the API routines
Copied from U-Boot

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-10-08 00:04:28 +08:00
Jean-Christophe PLAGNIOL-VILLARD 2fbdb02b11 image: rename IH_CPU to IH_ARCH to be more concistant
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-10-08 00:03:56 +08:00
Jean-Christophe PLAGNIOL-VILLARD ad4da3a4a1 image: factorise string helper
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-10-08 00:03:22 +08:00
Sascha Hauer 6d2812b93d Revert "image: factorise string helper"
This reverts commit 7bd7d59e60.
2010-10-07 14:13:21 +02:00
Sascha Hauer 6c4b1b6da0 Revert "image: rename IH_CPU to IH_ARCH to be more concistant"
This reverts commit aba80a2d2d.

Conflicts:

	include/image.h

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-07 14:13:10 +02:00
Sascha Hauer f7403928a9 Revert "Replace direct header access with the API routines"
This reverts commit 0ceafe14be.

Conflicts:

	include/image.h

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-07 14:11:38 +02:00
Sascha Hauer 884f4d47c6 Revert "image: factorise image printing contents"
This reverts commit d424ce77f5.
2010-10-07 14:09:21 +02:00
Jean-Christophe PLAGNIOL-VILLARD 098e9e8f20 console: set device_d id at -1
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-09-24 08:46:41 +02:00
Jean-Christophe PLAGNIOL-VILLARD d424ce77f5 image: factorise image printing contents
before we duplicate it between command/bootm.c and scripts/mkimage.c

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-09-24 08:46:40 +02:00
Jean-Christophe PLAGNIOL-VILLARD 0ceafe14be Replace direct header access with the API routines
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-09-24 08:46:22 +02:00
Jean-Christophe PLAGNIOL-VILLARD aba80a2d2d image: rename IH_CPU to IH_ARCH to be more concistant
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-09-23 09:55:50 +02:00
Jean-Christophe PLAGNIOL-VILLARD 7bd7d59e60 image: factorise string helper
before we duplicate it between common/bootm.c and scripts/mkimage.c

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-09-23 09:55:50 +02:00
Sascha Hauer 2db4aa5c32 rename __initdata to __early_initdata
The __initdata define was present before Jean-Christophe
added it as fake value for Linux compatibility. Rename
the previous define to a different name to avoid
clashes

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-09-20 09:21:31 +02:00
Jean-Christophe PLAGNIOL-VILLARD a47575911d Menu: add box style entry
this will allow you to create a box style entry

via C API by specifying the type as

struct menu_entry me = {
	.display "test",
	.type = MENU_ENTRY_BOX,
	.box_state = 1,
	.action = action_to_run,
}

and via shell
menu -e -a -m <menu> -c <command> [-R] [-b 0|1] -d <description>
menu -e -a -m <menu> -u submenu -d [-b 0|1] <description>

-b with 0 for not selected and 1 for selected
and -c for the command to run when changing state

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-09-20 08:58:53 +02:00
Jean-Christophe PLAGNIOL-VILLARD 7923392c56 menu: add auto select support
this will allow to automaticaly run an entry if the user do no choice

this is usefull for boot menu as example

with menu -s -m boot -A 3 -d "Auto Boot in"

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-09-20 08:58:52 +02:00
Jean-Christophe PLAGNIOL-VILLARD e85c6bb0a7 driver: use id as -1 for auto assigned id
before if you specify id = 0 the next available id will be taken
otherwise fail if already registered now as in linux we use -1

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-09-20 08:58:52 +02:00
Jean-Christophe PLAGNIOL-VILLARD c83ebb95f1 add password framework
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-09-20 08:57:22 +02:00
Jean-Christophe PLAGNIOL-VILLARD 77a57f4cb4 add digest framework
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-09-20 08:57:21 +02:00
Jean-Christophe PLAGNIOL-VILLARD 935cdf5a1e move barebox_default_env.h to include/generated/
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-09-17 10:56:24 +08:00
Jean-Christophe PLAGNIOL-VILLARD 93bd1526aa move utsrelease.h to include/generated/ instead of include/linux
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-09-17 10:56:24 +08:00
Sascha Hauer 0d35c3c8a0 menu: simplify usage for clients
Clients now only have to call menu_add_submenu or menu_add_command_entry
instead of allocating many strings.
This also fixes some problems in the menu code. The priv field in struct
menu_entry was a pointer to struct menu or a pointer to an allocated string.
It was never freed, only had to be freed when it was an allocated string.
The reference to a submenu is now kept as a string and not to the menu
itself. The code checked the existence of the submenu when creating it, but
crashed when the submenu was removed and referenced afterwards. Now the
code hapily allows references to nonexistant menus but complains during
runtime when the menu is not there.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-30 21:06:02 +02:00
Sascha Hauer f50d2063cb menu: use an initialized struct list as menu list
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-30 20:57:20 +02:00
Sascha Hauer 417e2d45fe menu: use list_for_each_entry where appropriate
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-30 20:57:20 +02:00
Sascha Hauer b11b88de64 menu: remove superfluous struct menu_entry member from struct menu
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-30 20:57:20 +02:00
Sascha Hauer a75d6dacc3 menu: simplify menu_free with list_for_each_entry_safe
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-30 20:57:20 +02:00
Sascha Hauer 86086c5faa menu: initialize entries list in menu_alloc
Otherwise menu_free fails when menu_add failed.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-30 20:57:20 +02:00
Jean-Christophe PLAGNIOL-VILLARD 6ce1c664de Menu/cmd: add sub menu entry command support
this will simplify the creation of navigation link

as this

menu -a -m boot -d "Boot Menu"
menu -a -m network -d "Network settings"
menu -e -a -m network -u boot -d "Back"
menu -e -a -m boot -u network -d "Network settings ->"
menu -e -a -m boot -c reset -R -d "Reset"
menu -e -a -m boot -c clear -d "Exit"
menu -s -m boot

in C

struct menu m_boot = {
	.name = "boot",
	.display = "Boot Menu",
};

struct menu m_network = {
	.name = "network",
	.display = "Network settings",
};

struct menu_entry e_to_network = {
	.display = "Network settings ->",
	.action = menu_action_show,
	.priv = &m_network,
};

struct menu_entry e_to_boot = {
	.display = "Back",
	.action = menu_action_show,
	.priv = &m_boot,
};

struct menu_entry e_reset = {
	.display = "Reset",
	.action = menu_action_run,
	.priv = "reset",
};

struct menu_entry e_exit = {
	.display = "Exit",
	.action = menu_action_run,
	.non_re_ent = 1,
	.priv = "clear",
};

void menu_test(void)
{
	menu_add(&m_boot);
	menu_add(&m_network);
	menu_add_entry(&m_boot, &e_to_network);
	menu_add_entry(&m_boot, &e_reset);
	menu_add_entry(&m_boot, &e_exit);
	menu_add_entry(&m_network, &e_to_boot);
	menu_show(&m_boot);
}

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-30 20:57:20 +02:00
Jean-Christophe PLAGNIOL-VILLARD b712b26632 Add Menu Framework
Introduce a menu framework that allow us to create list menu to simplify
barebox and make it more user-frendly

This kind of menu is very usefull when you do not have a keyboard or a
serial console attached to your board to allow you to interract with
barebox

For the develloper part,
The framework introduce two API

1) C
that allow you to create menu, submenu, entry and complex menu action

2) Command
that allow you as the C API to create menu, submenu, entry and complex
menu action but this time the actions will be store in a function and
then be evaluated and excecuted at runtime.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-30 20:57:20 +02:00
Jean-Christophe PLAGNIOL-VILLARD 7167eb8c0b Kconfig: sync with linux kernel v2.6.36-rc1-168-ge36c886
this will add also the support of the new ncurse interface nconfig

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-08-22 13:12:27 +08:00
Jean-Christophe PLAGNIOL-VILLARD d879de38e8 barebox_default_env: fix out of tree build
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-07-22 15:49:02 +02:00
Sascha Hauer 600c0e987e Allow to merge default environment from more than one directory
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-22 15:44:40 +02:00
Sascha Hauer 56d0e7f274 errno: add strings for network related error messages
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-17 08:28:29 +02:00
Sascha Hauer c3789cd49b rework device parameters
Change device parameters so that the memory management is in generic
code. This also removes the need of storing statically initialized
parameters as they are stored in a struct list_head for each device.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-17 08:28:25 +02:00
Luotao Fu f498576cb6 fix error return value while loading environment
Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-05-03 15:01:28 +02:00
Uwe Kleine-König 3a1617d96f clock: fix possible error on overflow in is_timeout
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-04-22 13:29:22 +02:00
Sascha Hauer edf4e51a82 introduce a arch_shutdown call and call it from shutdown_barebox
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-03-30 14:15:03 +02:00
Sascha Hauer e723f79cb7 make panic and hang __noreturn functions
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-03-30 14:15:03 +02:00
Sascha Hauer 6eb741a2e1 hush: allow fancy prompts
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-03-30 14:15:03 +02:00
Sascha Hauer 66e4e9242b hush: only remove backslashes introduced from glob
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-03-30 14:15:03 +02:00
Sascha Hauer 2477fb12e9 hush: Fix return code when calling 'exit' inside loops
v2: Do not exit from all scripts but only the current one

This fixes the case:

barebox:/ cat /test
if [ 0 = 0 ]; then
	exit 1
fi
barebox:/ /test
barebox:/ echo $?
0
barebox:/

Also, remove code to not allow exit from main shell. The for(;;) loop
in common/startup.c will bring us back anyway.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-03-30 12:51:44 +02:00
Sascha Hauer 922bb41a47 remove typedef cmd_tbl_t and replace it with struct command
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-02-01 17:25:32 +01:00
Sascha Hauer 085e30b4b0 remove unused file common/flash.c
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-02-01 17:25:31 +01:00
Robert P. J. Day 06c5d3d9fa Remove/adjust erroneous references to CONFIG_MODULE.
The correct config variable is CONFIG_MODULES, so tweak any references
to the incorrect CONFIG_MODULE.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-12-21 14:21:45 +01:00
Sascha Hauer a3ffa97f40 rename U-Boot-v2 project to barebox
This has been done with the following script:

find -path ./.git -prune -o -type f -print0 | xargs -0 -r sed -i \
	-e 's/u2boot/barebox/g' \
	-e 's/U2Boot/barebox/g' \
	-e 's/U-boot V2/barebox/g' \
	-e 's/u-boot v2/barebox/g' \
	-e 's/U-Boot V2/barebox/g' \
	-e 's/U-Boot-v2/barebox/g' \
	-e 's/U_BOOT/BAREBOX/g' \
	-e 's/UBOOT/BAREBOX/g' \
	-e 's/uboot/barebox/g' \
	-e 's/u-boot/barebox/g' \
	-e 's/u_boot/barebox/g' \
	-e 's/U-Boot/barebox/g' \
	-e 's/U-boot/barebox/g' \
	-e 's/U-BOOT/barebox/g'

find -path ./.git -prune -o \( -name "*u-boot*" -o -name "*uboot*" -o -name "*u_boot*" \) -print0 | \
	xargs -0 -r rename 's/u[-_]?boot/barebox/'

It needs some manual fixup following in the next patch

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-12-15 10:18:30 +01:00
Juergen Beisert 8c187839ee Re-format the file
Re-format the file with 'indent' and some manual corrections.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
2009-12-10 13:09:02 +01:00
Juergen Beisert 5ed894e9a6 Combine memory initialization with the main memory functions.
Memory allocation is very simple in u-boot-v2. So, it makes also sense to
add the "operating system" emulation layer into the main memory management
source file, to keep them at one place and simple.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
2009-12-10 13:09:02 +01:00
Juergen Beisert e0a2f39561 Use the global string functions
Don't try to be smarter than GCC. There are various better optimizations
available than to write our own. So, use the globaly available string
functions instead.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
2009-12-10 13:09:02 +01:00
Juergen Beisert a9dda0de1e Remove win32 support
Remove never used code.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
2009-12-10 13:09:02 +01:00
Juergen Beisert e70f5a92a9 Remove debug code
When assert() is always defined to do nothing, the debug functions makes no
sense, because they also do nothing. Removing them shrinks the code.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
2009-12-10 13:09:02 +01:00
Juergen Beisert 86e3217dde Use nowadays function prototypes
Use a function prototype style as used in all other u-boot-v2 sources, too.
Also remove C++ support. We do not use C++ in this project.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
2009-12-10 13:09:02 +01:00
Juergen Beisert 7fd641558b After moving all declarations to the C source, do the same with the doc
Done in preparation to provide this documentation for doxygen.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
2009-12-10 13:09:02 +01:00
Juergen Beisert e954ee0647 Remove confusing macros that hide the real functions names
This feature is provided, to support more than u-boot-v2. But its more
confusing than helpful. Remove it and do it straight forward like all other
sources in this tree, too.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
2009-12-10 13:09:02 +01:00
Juergen Beisert c35e17dc26 Use the native 'void' instead of 'Void_t'
We are in the *NIX world, so keep a 'void' as is.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
2009-12-10 13:09:02 +01:00
Juergen Beisert 6f1327ad3f Move private settings and configuration into the C source
Include the board config first to be able to configure the memory management
in the documented way. If not used, the defaults are used.
On the other hand, there is no need to pollute the other source files with
these local management settings. So, move them from the header into the
C source file.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
2009-12-10 13:09:02 +01:00
Juergen Beisert bbc84cabe8 Move variables to bss
There is no need to init variables with 0. So, move them to the bss and let
the C runtime does this job for us.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
2009-12-10 13:09:02 +01:00
Sascha Hauer 8ad5fe6ca4 introduce GENERIC_GPIO label
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-12-10 12:15:01 +01:00
Marc Kleine-Budde c762cdbb02 clock.c: use USECOND and MSECOND
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-12-03 11:12:46 +01:00
Juergen Beisert b00a6d357e Remove deadlock message
Any wrong or unknown command will result into the output:

 Unknown command '<some text>' - try 'help'

If the command 'help' is disabled, this will end up in:

 Unknown command 'help' - try 'help'

which is for blondes. Suppress the "try 'help'" for the case the 'help'
command is disabled.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-11-19 09:41:44 +01:00
Juergen Beisert fc0bb9ea2d ENV_HANDLING requires CRC32
ENV_HANDLUNG requires CRC32 to make the linker happy.

Signed-off by: Juergen Beisert <jbe@pengutronix.de>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-11-19 09:41:19 +01:00
Sascha Hauer 73d57b1d35 list: remove duplicated list.h
We accidently have two list implementations in the tree:
include/list.h and include/linux/list.h. This patch moves
the latter (newer one) to include/linux/list.h.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-11-03 09:48:53 +01:00
Sascha Hauer 14eb082606 hush: remove include/hush.h
Everything in include/hush.h is only used in hush.c, so remove
the header file.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-10-22 11:17:25 +02:00
Jean-Christophe PLAGNIOL-VILLARD 998f9ee2f3 uboot_default_env: fix out of tree build
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2009-10-20 15:02:30 +02:00
Sascha Hauer 420a3173f0 commands: remove maxargs
No need to check for maximum argument counts. The commands are
safe to be called with more arguments, so lets safe some bytes.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-10-19 16:18:33 +02:00
Sascha Hauer 63e01b4969 call getopt_reset only once
instead of calling getopt_reset in each command,
call it only once before calling the command.

Signed-off-by: Sascha Hauer <sha@pengutronix.de>
2009-10-19 10:18:52 +02:00
Sascha Hauer 87e01f28cc commands: return COMMAND_ERROR_USAGE
instead of calling u_boot_cmd_usage in each command to safe
space.

Signed-off-by: Sascha Hauer <sha@pengutronix.de>
2009-10-19 10:18:52 +02:00
Sascha Hauer 0ecf7f1aeb commands: add defines for command errors/success
This allows us to return COMMAND_ERROR_USAGE for
a failed command which will then print the usage,
a very common case for commands.

Signed-off-by: Sascha Hauer <sha@pengutronix.de>
2009-10-19 10:18:52 +02:00
Sascha Hauer ef7ff70ca4 consolidate command calling in execute_command
Signed-off-by: Sascha Hauer <sha@pengutronix.de>
2009-10-19 10:18:51 +02:00
Sascha Hauer 0217e514cf console: partly revert 84688dfdb4
Some unrelated code leaked in in this commit

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-09-25 14:13:17 +02:00
Sascha Hauer d81251712c hush: pass return code from exit command
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-09-25 13:34:27 +02:00
Sascha Hauer 4596d2b6f9 hush: Only run list if it's not empty
Running empty lists lead to the wrong return status

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-09-25 13:34:22 +02:00
Sascha Hauer 84688dfdb4 console: make locally used function static
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-09-25 13:34:15 +02:00
Sascha Hauer e2c8e8a180 Add MMU support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-08-19 10:51:30 +02:00
Sascha Hauer 0bf2410e85 console: Fix line endings
use \r\n instead of \n\r

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-08-13 10:43:12 +02:00
Juergen Beisert b8b205c72b Improve or fix various parameter documentation
Signed-off-by: Juergen Beisert <j.beisert@pengutronix.de>
2009-07-31 13:24:43 +02:00
Sascha Hauer 02ba8a0542 get rid of device ids
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-07-21 16:41:47 +02:00
Sascha Hauer db0d705898 move some init work into initcalls
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-07-21 16:41:46 +02:00
Sascha Hauer a2b7cd183b introduce cdev
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-07-21 16:41:44 +02:00
Juergen Beisert fbf95dfc21 Change return type of function part_remove to void, otherwise the compiler
complains:

common/partition.c:245: warning: initialization from incompatible pointer type

Signed-off-by: Juergen Beisert <j.beisert@pengutronix.de>
2009-07-01 11:19:22 +02:00
Sascha Hauer 0f64e5c39d add strerror function
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-05-25 16:52:35 +02:00
Sascha Hauer e536d48f60 simple console: implement console_flush
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-05-18 12:15:43 +02:00
Sascha Hauer 49321a5cd3 console: buffer characters before console is initialized
instead of throwing all output away when the console
is not initialized, buffer it in a kfifo and print
it later when the first console gets initialized.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-05-13 16:23:09 +02:00
Sascha Hauer 2e8254e387 console: rename console_buffer to console_input_buffer
...as we want to add an output buffer, too

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-05-13 16:11:24 +02:00
Sascha Hauer 98c68ca413 fix errno_str without text error messages
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-04-06 11:08:34 +02:00
Sascha Hauer 8a2e721fc5 Flush consoles before exiting
We use FIFOs on some devices, so flush them before exiting so
we do not get funny characters in the output.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-03-19 12:21:24 +01:00
Sascha Hauer 0b5a776c1e Shutdown U-Boot before starting an OS
Some devices, especially the ones doing DMA should be disabled before
giving control to an OS. We take the simple approach here: Just shutdown
the devices in the reverse order they were activated.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-03-19 12:21:18 +01:00
Sascha Hauer 4e2fe88944 Console: Fix baudrate switching
When waiting for the user to confirm the new baudrate, wait
for '\n' and '\r' instead of only '\r'

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-02-06 14:44:46 +01:00
Sascha Hauer c09d002eca update .gitignore files for linker scripts
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-01-21 23:28:14 +01:00
Nishanth Menon 2af143fcf2 common:environment: fix mode requirement
Issue:
Compiling on Ubuntu 8.10 Fails:
inlined from 'envfs_save' at scripts/../common/environment.c:135:
/usr/include/bits/fcntl2.h:51: error: call to '_open_missing_mod'
declared with attribute error: open with O_CREAT in second argument
needs 3 arguments

Usage: open(filename, O_WRONLY | O_CREAT)

Fix:
When using open with O_CREAT, it requires
mode to be defined.

Signed-off-by: Nishanth Menon <nm@ti.com>
2008-12-09 11:25:54 +01:00
Sascha Hauer 8d36379153 hush: Fix quoting
This patch removes adding of an additional \ when doing

echo "\""

which gives \" instead of just "

I checked in latest busybox hush and this code is still present there,
but it behaves correctly in busybox due to some other code pathes I
didn't investigate.
If this change has any unwanted side effects feel free to flame on me

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-11-10 17:54:15 +01:00
Sascha Hauer 54ec87f0cb Print error number
When we do not have the appropriate error string compiled in, print
at least the number

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-11-10 17:40:09 +01:00
Sascha Hauer 262aea2524 partition: route through MEMSETBADBLOCK ioctl
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-09-02 17:21:02 +02:00
Sascha Hauer 21d5fc40df Build system: Use setlocalversion from kernel
Autogenerate a local version from git.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-09-02 15:48:06 +02:00
Sascha Hauer 2b729e45b4 hush: fix compiler warning
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-26 11:40:51 +02:00
Sascha Hauer 66a936fa64 setenv: Fix warning introduced with last commit
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-20 17:46:54 +02:00
Nishanth Menon 584f9990a8 Common: expose calloc
calloc is not exported by default. This patch
exposes the same.

Signed-off-by: Nishanth Menon <x0nishan@ti.com>
2008-08-15 08:47:50 +02:00
Sascha Hauer 65778b63d2 Partition: Add an own device id for partitions
Add an own device id for partitions. This is necessary to allow
the partition layer to check if the given device is really a partition.
Also, check for readonly flag in erase.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-14 09:28:10 +02:00
Sascha Hauer 9e64db6342 Partition layer updates
- route MEMGETINFO through partition layer
- use dev_erase/dev_protect instead of direct pointers

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-13 16:52:15 +02:00
Sascha Hauer 4c01ac2e0e clocK: Add ndelay function
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-13 16:41:22 +02:00
Sascha Hauer 77218fb7a3 Add help texts for Shell options
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-13 16:29:30 +02:00
Sascha Hauer 9ed399627d arm: dump stack space on startup
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-13 16:29:30 +02:00
Sascha Hauer 932b57873d move several commands into extra files
move false, true, help, insmod, lsmod, version into extra files

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-13 16:29:17 +02:00
Sascha Hauer aca52174a9 console: add a simple console for saving space
Add a simple console layer which is not able to handle multiple
consoles for those who don't need it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-01 11:47:10 +02:00
Sascha Hauer ee6d36a540 - introduce ioctl call
- pass open/close/lseek through to drivers
2008-06-06 09:30:48 +02:00
Nishanth Menon deaf6db172 007-partitions
[Patch 07/17] U-Boot-V2:Common Make partitions configurable

Not all configurations of Uboot require partitions. This patch modifies partition compilation as configurable param

Signed-off-by: Nishanth Menon<x0nishan@ti.com>
2008-06-05 19:45:19 +02:00
Nishanth Menon eb208c746d 002-clock-overflow
[Patch 02/17] U-Boot-V2: Handle case of clock rollover for get_time_ns

get_time_ns does a simplistic delta = cycle_now - cycle_last. It is possible that the h/w counter reached max and reset back to 0.
This patch addresses this issue by checking for rollover condition.

NOTE 1: This does not guarentee that you cannot confuse get_time_ns. You could possibly wait for two reset cycles and then get a messed up value.
To fix that we may need interrupt mode timer tick - something on the lines of jiffies on linux.
NOTE 2: the question of cs->mask is not clear. if the mask is for the tick, then it is better done with (cycle_now & cs->mask) - (cs->cycle_last & cs->mask).

Signed-off-by: Nishanth Menon<x0nishan@ti.com>
2008-06-05 19:45:08 +02:00
Nishanth Menon 9a364f5157 001-arch-config
[Patch 01/17][Try 3] U-Boot-V2: ARM: Add ARCH lowlevel Init

This Patch adds CONFIG_ARCH_HAS_LOWLEVEL_INIT as discussed in thread
http://www.nabble.com/-Patch--U-Boot-V2%3A-Introduce-CONFIG_ARCH_HAS_INIT_LOWLEVEL-to17134638.html#a17188894

Signed-off-by: Nishanth Menon<x0nishan@ti.com>
2008-06-05 19:45:03 +02:00
Sascha Hauer 596c845072 [memory layout]: streamline memory layout
Memory layout can now be specified via kconfig options. Two
possibilities exist: default layout means the layout is stack
/ malloc heap / U-Boot. The user can also specify fixed addresses
for each TEXT_BASE / stack / malloc heap.
2008-06-04 11:54:03 +02:00
Sascha Hauer aa2111e257 fix warnings in malloc code introduced by last commits 2008-06-03 13:30:38 +02:00
Menon, Nishanth d005435609 Remove part #ifdefed with #if (CONFIG_COMMANDS & CFG_CMD_BOOTD) which is
false everytime
2008-05-12 15:55:55 +02:00
Menon, Nishanth cb73b0c227 Change CONFIG_SKIP_LOWLEVEL_INIT to CONFIG_MACH_DO_LOWLEVEL_INIT
as we rather use positive logic. Make it dependent on boards that
have it rather than on ARM

Signed-off-by: Nishanth Menon <x0nishan@ti.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-05-12 11:35:15 +02:00
Sascha Hauer c228b2b84b Trivial comment fix 2008-04-04 14:45:04 +02:00
Sascha Hauer 50cc8c5412 Subject: [PATCH] [general] Fixed constant strings in data section issue
For practical reasons I changed all string literals assumed to be constant
to reside in .rodata subsection at end of .text section.

Signed-off-by: Carsten Schlote <schlote@vahanus.net>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-04-04 14:45:04 +02:00
Sascha Hauer f5a9246875 use newly introduced stringlist functions for tab completion 2008-03-11 21:40:40 +01:00
Sascha Hauer 8759e68de2 Add the possibility to have an architecture specific ctrlc() function.
This allows us to return immediately in ctrlc() on sandbox and thus
not slow down network througput.
2008-03-11 00:00:37 +01:00
Sascha Hauer f0aa2fcd09 replace debug_printf with debug in hush.c 2008-03-09 23:06:20 +01:00
Sascha Hauer 187847b2b4 add globbing support 2008-03-09 22:35:38 +01:00
Sascha Hauer df31bb46be implement TAB completion 2008-03-01 21:08:14 +01:00
Sascha Hauer a26eca758e Make the early console device/baudrate configurable instead of using
hardcoded values
2008-02-21 13:05:19 +01:00
Carsten Schlote 7538c06300 [general] Fixed crash in memory allocator
Fixed a bug in sbrk(). When the new mem_brk value returned by
sbrk_no_zero() returns NULL to indicate 'out of memory', sbrk()
still memset()s innocent memory at address NULL.

For some architectures this memory might be empty, so this never
causes a problem. Anyway on Coldfire I still have my vector table
there. Nuking them isn't really a good idea :-)

Signed-off-by: Carsten Schlote <c.schlote@konzeptpark.de>
2008-02-20 20:41:57 +01:00