From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 10/12] ARM omap beagle: Add noshell support for booting from MMC
Date: Mon, 11 Apr 2011 16:39:49 +0200 [thread overview]
Message-ID: <1302532791-20664-11-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1302532791-20664-1-git-send-email-s.hauer@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/boards/omap/board-beagle.c | 42 +++++++++++++++++++++++++++++++++++
arch/arm/mach-omap/Kconfig | 1 +
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 17a349c..ced3df7 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 13966cf..f256310 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
--
1.7.2.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2011-04-11 14:40 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-11 14:39 OMAP4 support Sascha Hauer
2011-04-11 14:39 ` [PATCH 01/12] ARM omap: Add omap signGP tool and possibility to build ift images Sascha Hauer
2011-04-11 14:39 ` [PATCH 02/12] mci omap: hsmmc is also found on the omap3 Sascha Hauer
2011-04-11 14:39 ` [PATCH 03/12] ARM omap: make sr32 a static inline function Sascha Hauer
2011-04-11 14:39 ` [PATCH 04/12] ARM omap: Add omap4 support Sascha Hauer
2011-04-11 14:39 ` [PATCH 05/12] ARM omap: add xload helper functions Sascha Hauer
2011-04-11 14:39 ` [PATCH 06/12] ARM omap4: panda board support Sascha Hauer
2011-04-12 8:18 ` Marc Kleine-Budde
2011-04-11 14:39 ` [PATCH 07/12] add panda defconfigs Sascha Hauer
2011-04-11 14:39 ` [PATCH 08/12] ARM omap4: Add pcm049 board support Sascha Hauer
2011-04-12 8:16 ` Marc Kleine-Budde
2011-04-11 14:39 ` [PATCH 09/12] ARM: add pcm049 defconfigs Sascha Hauer
2011-04-11 14:39 ` Sascha Hauer [this message]
2011-04-11 14:39 ` [PATCH 11/12] ARM omap beagle: update defconfig Sascha Hauer
2011-04-11 14:39 ` [PATCH 12/12] ARM beagle board: add xload defconfig Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1302532791-20664-11-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox