summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile7
-rw-r--r--README5
-rw-r--r--arch/arm/lib/board.c3
-rw-r--r--config.mk4
-rw-r--r--dts/Makefile13
-rw-r--r--include/configs/tegra2-common.h6
6 files changed, 34 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 4d0d53d748..ebce9398f6 100644
--- a/Makefile
+++ b/Makefile
@@ -225,6 +225,9 @@ endif
ifeq ($(CPU),ixp)
LIBS += arch/arm/cpu/ixp/npe/libnpe.o
endif
+ifdef DEV_TREE_SEPARATE
+ALL += $(obj)u-boot.dtb
+endif
ifeq ($(CONFIG_OF_EMBED),y)
LIBS += dts/dt.o
endif
@@ -378,6 +381,10 @@ $(obj)u-boot-cflags.mk:
echo $(CFLAGS) | \
awk -v RS='[ \t\n]+' -v ORS='' -- '$(AWK_SRC)' >> $@
+$(obj)u-boot.dtb: $(obj)u-boot
+ $(MAKE) -C dts binary
+ mv $(obj)dts/dt.dtb $@
+
$(obj)u-boot.hex: $(obj)u-boot
$(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@
diff --git a/README b/README
index 38a421555c..991010f67e 100644
--- a/README
+++ b/README
@@ -764,6 +764,11 @@ The following options need to be configured:
is then picked up in board_init_f() and made available through
the global data structure as gd->blob.
+ CONFIG_OF_SEPARATE
+ If this variable is defined, U-Boot will build a device tree
+ binary. It will be called u-boot.dtb. Architecture-specific
+ code will locate it at run-time.
+
- Watchdog:
CONFIG_WATCHDOG
If this variable is defined, it enables watchdog
diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 3bb80fc100..2f34677e87 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -297,6 +297,9 @@ void board_init_f (ulong bootflag)
#ifdef CONFIG_OF_EMBED
/* Get a pointer to the FDT */
gd->blob = _binary_dt_dtb_start;
+#elif defined CONFIG_OF_SEPARATE
+ /* FDT is at end of image */
+ gd->blob = (void*)(_end_ofs + _TEXT_BASE);
#endif
for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
diff --git a/config.mk b/config.mk
index 4d035177ee..ae9bbca93a 100644
--- a/config.mk
+++ b/config.mk
@@ -188,6 +188,10 @@ ifdef VBOOT
CPPFLAGS += -I$(VBOOT)/include/vboot
endif
+ifdef DEV_TREE_SEPARATE
+CPPFLAGS += -DCONFIG_OF_SEPARATE
+endif
+
CPPFLAGS += -I$(TOPDIR)/include
CPPFLAGS += -fno-builtin -ffreestanding -nostdinc \
-isystem $(gccincdir) -pipe $(PLATFORM_CPPFLAGS)
diff --git a/dts/Makefile b/dts/Makefile
index b885077f6a..8863c04123 100644
--- a/dts/Makefile
+++ b/dts/Makefile
@@ -24,6 +24,9 @@ include $(TOPDIR)/config.mk
LIB = $(obj)libdts.o
+# We use DEV_TREE_SRC as the name of the device tree, if defined
+# If not, we use CONFIG_DEFAULT_DEVICE_TREE
+
ifeq ($(DEV_TREE_SRC),)
$(if $(CONFIG_DEFAULT_DEVICE_TREE),,\
$(error Please define CONFIG_DEFAULT_DEVICE_TREE in your board header \
@@ -38,9 +41,11 @@ endif
# the filename.
DT_BIN := $(obj)dt.dtb
-# TODO: get arch properly for objcopy line.
-$(obj)dt.o: $(TOPDIR)/board/$(BOARDDIR)/$(DEVICE_TREE).dts
+$(DT_BIN): $(TOPDIR)/board/$(BOARDDIR)/$(DEVICE_TREE).dts
$(DTC) -R 4 -p 0x1000 -O dtb -o ${DT_BIN} $<
+
+# TODO: get arch properly for objcopy line.
+$(obj)dt.o: $(DT_BIN)
cd $(dir ${DT_BIN}) && \
$(OBJCOPY) -B armv5te -I binary -O elf32-littlearm \
$(notdir ${DT_BIN}) $@
@@ -54,7 +59,9 @@ OBJS := $(addprefix $(obj),$(OBJS))
all: $(obj).depend $(LIB)
-$(LIB): $(OBJS)
+binary: $(DT_BIN)
+
+$(LIB): $(OBJS) $(DTB)
$(call cmd_link_o_target, $(OBJS))
clean:
diff --git a/include/configs/tegra2-common.h b/include/configs/tegra2-common.h
index ae5d83fb47..629c8d1924 100644
--- a/include/configs/tegra2-common.h
+++ b/include/configs/tegra2-common.h
@@ -36,7 +36,11 @@
/* FDT support */
#define CONFIG_OF_LIBFDT /* Device tree support */
#define CONFIG_OF_CONTROL /* Use the device tree to set up U-Boot */
-#define CONFIG_OF_EMBED /* Embed the device tree in U-Boot */
+
+/* Embed the device tree in U-Boot, if not otherwise handled */
+#ifndef CONFIG_OF_SEPARATE
+#define CONFIG_OF_EMBED
+#endif
/*
* High Level Configuration Options