summaryrefslogtreecommitdiff
path: root/arch/arm/lib
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2011-08-12 16:11:07 -0700
committerSimon Glass <sjg@chromium.org>2011-08-29 10:59:33 -0700
commit2d0cce869275f5fd0de39ad2c1fca1c1d0779c59 (patch)
tree1a329e70641b6498881d6dcc54a9042f740e2c99 /arch/arm/lib
parent441fed733a2b4cef5d6386b34975cee8b29980f8 (diff)
fdt: Add check that a valid fdt is available
When CONFIG_OF_CONTROL is defined, U-Boot requires a valid fdt. This adds an early check that one is available. BUG=chromium-os:17062 TEST=build and boot U-Boot without valid fdt; see that message appears Change-Id: Iae7decdf09ad16a5f3fc419f530dae7e9d34e93f Reviewed-on: http://gerrit.chromium.org/gerrit/6068 Tested-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/arm/lib')
-rw-r--r--arch/arm/lib/board.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 6a0e3ed384..dbb802241d 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -202,6 +202,17 @@ static int arm_pci_init(void)
}
#endif /* CONFIG_CMD_PCI || CONFIG_PCI */
+#ifdef CONFIG_OF_CONTROL
+static int check_fdt(void)
+{
+ /* We must have an fdt */
+ if (fdt_check_header(gd->blob))
+ panic("No valid fdt found - please append one to U-Boot\n"
+ "binary or define CONFIG_OF_EMBED\n");
+ return 0;
+}
+#endif
+
/*
* Breathe some life into the board...
*
@@ -244,6 +255,9 @@ init_fnc_t *init_sequence[] = {
#if defined(CONFIG_BOARD_EARLY_INIT_F)
board_early_init_f,
#endif
+#ifdef CONFIG_OF_CONTROL
+ check_fdt,
+#endif
timer_init, /* initialize timer */
#ifdef CONFIG_FSL_ESDHC
get_clocks,