9
0
Fork 0
Commit Graph

68 Commits

Author SHA1 Message Date
Sascha Hauer b67b2671c2 treewide: Add missing includes
A lot of files rely on include/driver.h including include/of.h (and
this including include/errno.h. include the files explicitly so we can
eventually get rid of including of.h from driver.h

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-08 15:42:04 +01:00
Sascha Hauer ebf9022f2e Merge branch 'for-next/rs485'
Conflicts:
	common/console_common.c
2013-10-07 08:02:14 +02:00
Jean-Christophe PLAGNIOL-VILLARD 14e8e0a421 shutdown: add board call back
so if we need to do something switch in the board we can fill this function
pointer (as example on Animeo IP shutdown some rs232 & rs485)

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-24 09:21:40 +02:00
Jean-Christophe PLAGNIOL-VILLARD bb89ea62a0 login: disable input console if password wrong
so we guarantee that barebox is secured again user interaction

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-19 08:49:47 +02:00
Sascha Hauer 4674fd7b6c startup: Add initcall tracing debug option
Being able to trace initcall is very useful when trying to
find out where startup hangs. This adds a kconfig option for
it to make it easier to access.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-25 11:52:36 +02:00
Jean-Christophe PLAGNIOL-VILLARD 42459443b6 startup: switch to pr_xxx
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-09 11:18:08 +01:00
Jean-Christophe PLAGNIOL-VILLARD 50c9df4899 startup: switch to pr_xxx
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-09 11:16:17 +01:00
Sascha Hauer 0e18d5ae7f defaultenv loading: rework to use less ifdefs/defines
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-20 16:33:03 +01:00
Sascha Hauer 0bbb021b48 startup: add __noreturn to start_barebox
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-20 16:33:03 +01:00
Sascha Hauer 7ed52f8870 startup: Use IS_ENABLED for loading environment
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-20 16:33:03 +01:00
Sascha Hauer a32ba93239 startup: use IS_ENABLED instead of ifdef
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-20 16:33:02 +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 7b4d66ab28 startup: call a barebox_main function pointer at the end of the startup
Currently Kconfig dependencies are used to allow non-interactive builds.
This leads to problems in Kconfig getting the dependencies right.

This patch adds a barebox_main function pointer which is called at the
end of the startup process. This defaults to run_shell when a shell is
enabled.

With this the HAVE_NOSHELL Kconfig variable can be removed. Non interactive
builds can now be enabled for every board allowing to compile a binary
without further Kconfig dependencies. This also allows for more flexibility,
for example boards may decide to try non-interactive startup first and
call run_shell if that fails.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-20 16:30:20 +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 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 68e3e14a64 defaultenv: dependencies fixes
When a build with a compressed default environment is done and then
environment compression is disabled, barebox_default_env.h is not
regenerated because its dependency (now barebox_default_env) is still
up to date. This results in a corrupt default environment.

This patch fixes this by adding a cmd_env_h and changing barebox_default_env.h
to FORCE. As a side effect barebox_default_env.h is no longer generated in
include/generated/ but in common/ as we have to add barebox_default_env.h to
$(targets) (extra-y).

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-12 18:40:02 +02:00
Sascha Hauer f562646dc8 startup: Print error message when initcall fails
There was a time when we used to panic when initcalls failed. Then
it was changed to totally ignore the return value. Instead, print
an error message now so that the user can get a clue when something
bad happened. So initcalls are now recommended to actually return
negative error codes when something fails.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-09 08:59:44 +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 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
Jan Luebbe ef01e97f6c common: split out meminfo output and make it optional
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-06 12:43:36 +02: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
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 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
Sascha Hauer 0fc7fb6b4f rename include/mem_malloc.h to include/memory.h
Which is a better name and also better to collect other
things.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-23 16:32:48 +02:00
Sascha Hauer f928efa818 add a add_mem_device function
Add a helper function for boards to register their memory
devices. This makes the board code smaller and also helps
getting rid of map_base and struct memory_platform_data.

And switch all of the memory to it

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-07-18 20:32:45 +08:00
Antony Pavlov 7530c82c3d startup.c: make DEBUG_LL output more useful
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-18 23:04:18 +02:00
Sascha Hauer 9640c2b4a5 environment: make default env path configurable
Normally the default path to save the environment is /dev/env0. However,
we can't map a file in a fat filesystem to /dev/env0. So if we want to
store the environment in a file in fat we have to make it configurable.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-12 09:54:56 +02:00
Sascha Hauer 3c702a58c7 make command support optional
In a noninveractive environment we do not need commands. So make
them optional.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-11 15:57:51 +02:00
Sascha Hauer 4b935522de startup: we can only mount root and devfs when compiled in
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-11 12:36:08 +02: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
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
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 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
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 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 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 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
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 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 a26eca758e Make the early console device/baudrate configurable instead of using
hardcoded values
2008-02-21 13:05:19 +01:00
Juergen Beisert 981499dd40 enabling envrionment's autoload at startup
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
2007-11-16 10:58:08 +01:00
sascha ceac76ffce Move display_banner() to console.c. This helps us to show
the banner as first message.
2007-10-19 11:04:33 +02:00
Sascha Hauer 8b8c95b9fc add missing whitespace in printf output 2007-10-01 10:16:04 +02:00
Sascha Hauer 811acbb52d indention 2007-09-27 12:21:12 +02:00
Sascha Hauer 52473038dc display malloc space on startup 2007-09-26 15:24:51 +02:00
Sascha Hauer 2a286ea208 execute /env/bin/init instead of /env/init 2007-09-25 14:32:32 +02:00
Sascha Hauer 14b5c2a647 - teach hush to honour PATH variable
- remove common/main.c. This is now handled in the different shells.
2007-09-24 01:40:06 +02:00