diff mbox

[U-Boot,4/5] spl: add possibility to force boot device

Message ID 1356971563-23478-5-git-send-email-ilya.yanok@cogentembedded.com
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Ilya Yanok Dec. 31, 2012, 4:32 p.m. UTC
Sometimes (for debugging purposes mostly but also to overcome some
hardware limitations) it's desirable to be able to force boot device to
some fixed value. This patch adds this possibility via
CONFIG_SPL_FORCE_BOOT_DEVICE option.

Signed-off-by: Ilya Yanok <ilya.yanok@cogentembedded.com>
---
 common/spl/spl.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Tom Rini Feb. 5, 2013, 4:29 p.m. UTC | #1
On Mon, Dec 31, 2012 at 06:32:42AM -0000, Ilya Yanok wrote:

> Sometimes (for debugging purposes mostly but also to overcome some
> hardware limitations) it's desirable to be able to force boot device to
> some fixed value. This patch adds this possibility via
> CONFIG_SPL_FORCE_BOOT_DEVICE option.
> 
> Signed-off-by: Ilya Yanok <ilya.yanok@cogentembedded.com>

I don't like this, so I'm going to drop it.  It does provide a proof of
concept to allow earlier testing of USB SPL support, but fixed hardware
exists now.
diff mbox

Patch

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 6a5a136..37f4d38 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -177,7 +177,11 @@  void board_init_r(gd_t *dummy1, ulong dummy2)
 	spl_board_init();
 #endif
 
+#ifdef CONFIG_SPL_FORCE_BOOT_DEVICE
+	boot_device = CONFIG_SPL_FORCE_BOOT_DEVICE;
+#else
 	boot_device = spl_boot_device();
+#endif
 	debug("boot device - %d\n", boot_device);
 	switch (boot_device) {
 #ifdef CONFIG_SPL_RAM_DEVICE