summaryrefslogtreecommitdiff
path: root/arch/arm/lib/board.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2011-10-24 19:15:33 +0000
committerWolfgang Denk <wd@denx.de>2011-10-26 21:39:57 +0200
commitf5437ad141e13ff03dccb24707e8100d2b0295fd (patch)
tree79ba9113784b715db0d5c22e33f1c64a79caf3c5 /arch/arm/lib/board.c
parentb5220bc6ed6e6a197adf4926958dca1df4b420b0 (diff)
downloadu-boot-imx-f5437ad141e13ff03dccb24707e8100d2b0295fd.zip
u-boot-imx-f5437ad141e13ff03dccb24707e8100d2b0295fd.tar.gz
u-boot-imx-f5437ad141e13ff03dccb24707e8100d2b0295fd.tar.bz2
fdt: ARM: Implement and verify embedded and separate device tree
This locates the device tree either embedded within U-Boot or attached to the end as a separate binary. When CONFIG_OF_CONTROL is defined, U-Boot requires a valid fdt. A check is provided for this early in initialisation. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/arm/lib/board.c')
-rw-r--r--arch/arm/lib/board.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 7434b34..bd6d4e3 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -48,6 +48,8 @@
#include <nand.h>
#include <onenand_uboot.h>
#include <mmc.h>
+#include <libfdt.h>
+#include <fdtdec.h>
#include <post.h>
#include <logbuff.h>
@@ -234,6 +236,9 @@ init_fnc_t *init_sequence[] = {
#if defined(CONFIG_BOARD_EARLY_INIT_F)
board_early_init_f,
#endif
+#ifdef CONFIG_OF_CONTROL
+ fdtdec_check_fdt,
+#endif
timer_init, /* initialize timer */
#ifdef CONFIG_FSL_ESDHC
get_clocks,
@@ -274,6 +279,13 @@ void board_init_f(ulong bootflag)
memset((void *)gd, 0, sizeof(gd_t));
gd->mon_len = _bss_end_ofs;
+#ifdef CONFIG_OF_EMBED
+ /* Get a pointer to the FDT */
+ gd->fdt_blob = _binary_dt_dtb_start;
+#elif defined CONFIG_OF_SEPARATE
+ /* FDT is at end of image */
+ gd->fdt_blob = (void *)(_end_ofs + _TEXT_BASE);
+#endif
for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
if ((*init_fnc_ptr)() != 0) {