9
0
Fork 0
Commit Graph

104 Commits

Author SHA1 Message Date
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
Sascha Hauer 6021818e3d Merge branch 'for-next/arm-remove-arch-init-ll'
Conflicts:
	arch/arm/include/asm/barebox-arm.h
2012-10-03 21:13:31 +02:00
Sascha Hauer 4517b5980f Merge branch 'for-next/misc' 2012-10-03 21:10:57 +02:00
Jean-Christophe PLAGNIOL-VILLARD 4676721b30 defaultenv: enable glovalvar support
This will allow to do not have 2 set of var for defaultenv and the new
defaultenv-2.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-10-02 08:57:07 +02:00
Sascha Hauer fd5cd6084a ARM: remove ARCH_HAS_LOWLEVEL_INIT
This is unused now and not needed. We have a board_init_lowlevel. If a
board needs some architecture setup it can always call it from its
board_init_lowlevel.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-25 09:40:55 +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
Jean-Christophe PLAGNIOL-VILLARD 104c39fe82 compressed image: add gzip support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-08-03 18:09:15 +08:00
Jean-Christophe PLAGNIOL-VILLARD 5c3db111da Add compressed image support
This allows for creating a lzo compressed binary unsing the pbl.

Only copy the piggydata if needed.

Add CONFIG_PBL_FORCE_PIGGYDATA_COPY option
In some case we need to copy the PIGGYDATA as the link address
as example we run from SRAM and shutdown the SDRAM/DDR for
reconfiguration but most of the time we just need to copy the
executable code.

based on Sascha Hauer
Add compressed image support

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-08-03 18:09:15 +08:00
Jean-Christophe PLAGNIOL-VILLARD 78867e2bbd Add pre-bootloader (pbl) image support
This allows for creating a pre-bootloader binary for
 - nand boot
 - mmc boot
 - compressed image

The pbl will be incharge of the lowlevel init if needed.
The barebox will skip it.

Import string functions from linux 3.4 (arch/arm/boot/compressed/string.c) and
implement a dummy panic.

For now on introduce dummy zbarebox* targets and c code that will contain later
the decompressor. This only implemeted on ARM.

This patch is based on Sascha Hauer <s.hauer@pengutronix.de>
Add compressed image support patch

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-08-03 18:09:13 +08:00
Sascha Hauer 2935411dea Merge branch 'for-next/reset-source' 2012-08-01 17:49:27 +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
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 0daaf9e4c4 uimage: select uncompress and crc32 support
uImage support needs both.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-25 09:27:28 +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
Juergen Beisert 1069567830 Enable a way to provide the reason for "being here"
Many architectures support a way to detect why the bootloader is running.
This patch adds a global variable to be able to use the cause in some kind of
shell code to do special things on demand. For example to do an emergency boot,
when the last boot fails and the watchdog reactivate the hanging system.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-18 16:21:43 +02:00
Sascha Hauer 4604923f0c defenv-2: improve boot script
- add usage information
- add option parsing:
  -v verbose
  -v -v more verbose
  -l list b´possible boot sources
  -d dryrun

The dryrun option sets the global variables necessary for booting
but does not actually boot the system. This way it is possible to
make additional adjustments to the boot variables and then invoke
bootm manually.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-05 20:50:45 +02:00
Alan Ott a9eef6a7b9 common: Make MENU depend on PROCESS_ESCAPE_SEQUENCE
print_menu_entry() in common/menu.c depeneds on process_escape_sequence().

Signed-off-by: Alan Ott <alan@signal11.us>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-21 22:03:50 +02:00
Sascha Hauer 0e8155229a Add next generation default environment template
This adds a new environment template which aims to be more flexible
and configurable. Instead of having mainly two scripts (a config script
and a boot script) this template uses initscripts which control the
startup behaviour and configuration. Also we have boot scripts in
/env/boot which configure a single boot configuration. Additional
boot entries can be added by board specific entries or during runtime
by copying and editing a template entry.

Some more helpers handle for example network interfaces which can now
be brought up with 'ifup'. We use the automount feature to configure
mountpoints together with the commands to bring up the devices behind
these mountpoints.

Optionally menu support is available which hides many details behind
a nice looking interface.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-18 12:26:52 +02:00
Sascha Hauer 91c38de28f glob: Add sorted output support
This allows us for example to execute init scripts in the correct
order.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-14 20:16:44 +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
Jean-Christophe PLAGNIOL-VILLARD 071ceba1e3 Introduce binfmt support
This will allow to execute any file and detect it's type to handle it.
This will allow to use shell for bootp bootfile or dfu.

You can register multiple hook for the same filetype. They will be execute
in the invert order of register. If a hook does not handle the file you just
return -ERESTARTNOHAND;

This is only available with hush parser.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-18 20:14:12 +08:00
Sascha Hauer afb03d7a55 make building of bareboxenv-target optional
The bareboxenv script build for the target does not work on
all architectures, so make it optional.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-13 12:36:38 +02: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
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 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
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
Sascha Hauer 14aac3f197 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-15 20:11:48 +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
Juergen Beisert 967a2675ba DISK: Add common partition handling for disk like media
This covers disk like media like SD card, CF cards, regular hard disks and also
USB mass storage devices. Most common used partition table is still of DOS type.
This implementation is prepared to support more partition types in the future.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-28 09:23:24 +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
Jan Weitzel 22f7370d2b add option LOCALVERSION to common/Kconfig
Add Kconfig option LOCALVERSION so you can set a customizable suffix
to the barebox version string.

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-20 08:54:04 +02:00
Sascha Hauer 43ebdba64a remove now unnecessary HAVE_MMU from Kconfig
MMU now can be enabled on every ARM board, so remove
the dependency.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-08-03 09:12:16 +02:00
Antony Pavlov 7e3f76437c Add option DEBUG_LL to common/Kconfig
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-27 10:55:41 +02:00
Sascha Hauer 523daf675a add dummy_malloc functions
For some environments the dummy malloc functions offer a very small
alternative implementation. malloc will get its memory from sbrk()
and never frees memory again.
This of course is not suitable for interactive environments and thus
depends on CONFIG_SHELL_NONE

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-11 15:57:51 +02:00
Sascha Hauer 5b85da326a add noshell support
Some scenarios like initial bootloaders do not need interactive shell
support, so make this optional. Without a shell a board must provide
its own run_shell function.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-11 15:57:51 +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 71a4899e18 env: Make environment variable support optional
Environment variables are only useful in interactive environments.
Make it optional on our way to support a noninteractive barebox.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-11 15:57:51 +02:00
Sascha Hauer 61f41e3c54 add block support
This adds a simple block layer to barebox. Reading and writing
to block devices can be painfully slow without caching, so
add a simple caching layer here.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-11 15:57:51 +02: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
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
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
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