summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2011-04-06 17:18:56 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2011-04-12 10:39:20 +0200
commit6aa0fba45ff3e8cdf10c8e31b9a24d0372edcc9c (patch)
tree6117dc362099c373ef29758e1ad94e561c6a03c2
parentaa2d860dc80a984ddbf6016f65301fb29e76c1b6 (diff)
downloadbarebox-6aa0fba45ff3e8cdf10c8e31b9a24d0372edcc9c.tar.gz
barebox-6aa0fba45ff3e8cdf10c8e31b9a24d0372edcc9c.tar.xz
ARM omap beagle: Add noshell support for booting from MMC
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/boards/omap/board-beagle.c42
-rw-r--r--arch/arm/mach-omap/Kconfig1
2 files changed, 43 insertions, 0 deletions
diff --git a/arch/arm/boards/omap/board-beagle.c b/arch/arm/boards/omap/board-beagle.c
index 17a349c42a..ced3df742d 100644
--- a/arch/arm/boards/omap/board-beagle.c
+++ b/arch/arm/boards/omap/board-beagle.c
@@ -56,6 +56,7 @@
#include <console.h>
#include <init.h>
#include <driver.h>
+#include <sizes.h>
#include <asm/io.h>
#include <ns16550.h>
#include <asm/armlinux.h>
@@ -72,6 +73,7 @@
#include <i2c/i2c.h>
#include <linux/err.h>
#include <usb/ehci.h>
+#include <mach/xload.h>
#include "board.h"
/******************** Board Boot Time *******************/
@@ -313,6 +315,13 @@ static struct i2c_board_info i2c_devices[] = {
},
};
+static struct device_d hsmmc_dev = {
+ .id = -1,
+ .name = "omap-hsmmc",
+ .map_base = 0x4809C000,
+ .size = SZ_4K,
+};
+
static int beagle_devices_init(void)
{
int ret;
@@ -334,6 +343,8 @@ static int beagle_devices_init(void)
#endif
gpmc_generic_nand_devices_init(0, 16, OMAP_ECC_HAMMING_CODE_HW_ROMCODE);
+ register_device(&hsmmc_dev);
+
armlinux_add_dram(&sdram_dev);
armlinux_set_bootparams((void *)0x80000100);
armlinux_set_architecture(MACH_TYPE_OMAP3_BEAGLE);
@@ -341,3 +352,34 @@ failed:
return ret;
}
device_initcall(beagle_devices_init);
+
+#ifdef CONFIG_SHELL_NONE
+
+int run_shell(void)
+{
+ int (*func)(void) = NULL;
+
+ switch (omap3_bootsrc()) {
+ case OMAP_BOOTSRC_MMC1:
+ printf("booting from MMC1\n");
+ func = omap_xload_boot_mmc();
+ break;
+ case OMAP_BOOTSRC_UNKNOWN:
+ printf("unknown boot source. Fall back to nand\n");
+ case OMAP_BOOTSRC_NAND:
+ printf("booting from NAND\n");
+ func = omap_xload_boot_nand(SZ_128K, SZ_256K);
+ break;
+ }
+
+ if (!func) {
+ printf("booting failed\n");
+ while (1);
+ }
+
+ shutdown_barebox();
+ func();
+
+ while (1);
+}
+#endif
diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig
index 13966cf55a..f256310cef 100644
--- a/arch/arm/mach-omap/Kconfig
+++ b/arch/arm/mach-omap/Kconfig
@@ -123,6 +123,7 @@ config MACH_BEAGLE
bool "Texas Instrument's Beagle Board"
select MACH_HAS_LOWLEVEL_INIT
select OMAP_CLOCK_ALL
+ select HAVE_NOSHELL
select HAS_OMAP_NAND
depends on ARCH_OMAP3
help