diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-01-20 13:59:47 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-01-20 16:30:20 +0100 |
commit | 7b4d66ab28fdd3c7bfd4e427a1f7ccddbffd355c (patch) | |
tree | 10f4995ddfb779d5c80392986359a0ee6f4fdba7 /arch/arm | |
parent | 3de3b677ee3adc4e10235b623a8e0aa45be48893 (diff) | |
download | barebox-7b4d66ab28fdd3c7bfd4e427a1f7ccddbffd355c.tar.gz barebox-7b4d66ab28fdd3c7bfd4e427a1f7ccddbffd355c.tar.xz |
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>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap/Kconfig | 9 | ||||
-rw-r--r-- | arch/arm/mach-omap/xload.c | 11 |
2 files changed, 10 insertions, 10 deletions
diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig index 6611a65a9c..f659184826 100644 --- a/arch/arm/mach-omap/Kconfig +++ b/arch/arm/mach-omap/Kconfig @@ -128,7 +128,6 @@ config MACH_OMAP343xSDP config MACH_BEAGLE bool "Texas Instrument's Beagle Board" - select HAVE_NOSHELL select HAVE_DEFAULT_ENVIRONMENT_NEW depends on ARCH_OMAP3 help @@ -137,21 +136,18 @@ config MACH_BEAGLE config MACH_BEAGLEBONE bool "Texas Instrument's Beagle Bone" select OMAP_CLOCK_ALL - select HAVE_NOSHELL depends on ARCH_AM33XX help Say Y here if you are using Beagle Bone config MACH_OMAP3EVM bool "Texas Instrument's OMAP3 EVM" - select HAVE_NOSHELL depends on ARCH_OMAP3 help Say Y here if you are using OMAP3EVM config MACH_PANDA bool "Texas Instrument's Panda Board" - select HAVE_NOSHELL select MACH_HAS_LOWLEVEL_INIT select HAVE_DEFAULT_ENVIRONMENT_NEW depends on ARCH_OMAP4 @@ -160,7 +156,6 @@ config MACH_PANDA config MACH_ARCHOSG9 bool "Archos G9 tablets" - select HAVE_NOSHELL select MACH_HAS_LOWLEVEL_INIT depends on ARCH_OMAP4 help @@ -168,7 +163,6 @@ config MACH_ARCHOSG9 config MACH_PCM049 bool "Phytec phyCORE pcm049" - select HAVE_NOSHELL depends on ARCH_OMAP4 select MACH_HAS_LOWLEVEL_INIT help @@ -177,14 +171,12 @@ config MACH_PCM049 config MACH_PCAAL1 bool "Phytec phyCARD-A-L1" - select HAVE_NOSHELL depends on ARCH_OMAP3 help Say Y here if you are using a phyCARD-A-L1 PCA-A-L1 config MACH_PCAAXL2 bool "Phytec phyCARD XL2" - select HAVE_NOSHELL select MACH_HAS_LOWLEVEL_INIT depends on ARCH_OMAP4 help @@ -193,7 +185,6 @@ config MACH_PCAAXL2 config MACH_PCM051 bool "Phytec phyCORE pcm051" select OMAP_CLOCK_ALL - select HAVE_NOSHELL select HAVE_DEFAULT_ENVIRONMENT_NEW depends on ARCH_AM33XX help diff --git a/arch/arm/mach-omap/xload.c b/arch/arm/mach-omap/xload.c index 47c5d9840e..41533a9680 100644 --- a/arch/arm/mach-omap/xload.c +++ b/arch/arm/mach-omap/xload.c @@ -1,6 +1,7 @@ #include <common.h> #include <partition.h> #include <nand.h> +#include <init.h> #include <driver.h> #include <linux/mtd/mtd.h> #include <fs.h> @@ -171,7 +172,7 @@ enum omap_boot_src omap_bootsrc(void) /* * Replaces the default shell in xload configuration */ -int run_shell(void) +static __noreturn int omap_xload(void) { int (*func)(void) = NULL; @@ -211,3 +212,11 @@ int run_shell(void) while (1); } + +static int omap_set_xload(void) +{ + barebox_main = omap_xload; + + return 0; +} +late_initcall(omap_set_xload); |