summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-01-31 18:10:51 -0700
committerTom Rini <trini@konsulko.com>2016-02-01 20:55:38 -0500
commit03c25bcd263a47322294654b5e97f360f666ef17 (patch)
tree112b6a074016c571097f8e2a1f22cd3c52236f6e
parentad1ecd2063dae55ccfca994a7c9fdec2462b18ab (diff)
downloadu-boot-imx-03c25bcd263a47322294654b5e97f360f666ef17.zip
u-boot-imx-03c25bcd263a47322294654b5e97f360f666ef17.tar.gz
u-boot-imx-03c25bcd263a47322294654b5e97f360f666ef17.tar.bz2
fdt: Build an SPL binary without device tree
At present u-boot-spl.bin holds the plain SPL binary without the device tree. This is somewhat annoying since you need either u-boot-spl.bin or u-boot-spl-dtb.bin depending on whether device tree is used. Adjust the build such that u-boot-spl.bin includes a device tree (if enabled), and the plain binary is in u-boot-spl-nodtb.bin. For now u-boot-spl-dtb.bin remains the same. Tested-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r--scripts/Makefile.spl25
1 files changed, 16 insertions, 9 deletions
diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index dff16b9..bc6a330 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -131,16 +131,12 @@ boot.bin: $(obj)/u-boot-spl.bin
else
MKIMAGEFLAGS_boot.bin = -T zynqimage
-spl/boot.bin: $(obj)/u-boot-spl-dtb.bin
+spl/boot.bin: $(obj)/u-boot-spl.bin
$(call if_changed,mkimage)
endif
ALL-y += $(obj)/$(SPL_BIN).bin $(obj)/$(SPL_BIN).cfg
-ifdef CONFIG_SPL_OF_CONTROL
-ALL-$(CONFIG_OF_SEPARATE) += $(obj)/$(SPL_BIN)-pad.bin $(obj)/$(SPL_BIN)-dtb.bin
-endif
-
ifdef CONFIG_SAMSUNG
ALL-y += $(obj)/$(BOARD)-spl.bin
endif
@@ -166,11 +162,22 @@ all: $(ALL-y)
quiet_cmd_cat = CAT $@
cmd_cat = cat $(filter-out $(PHONY), $^) > $@
-$(obj)/$(SPL_BIN)-dtb.bin: $(obj)/$(SPL_BIN).bin $(obj)/$(SPL_BIN)-pad.bin \
+quiet_cmd_copy = COPY $@
+ cmd_copy = cp $< $@
+
+ifeq ($(CONFIG_SPL_OF_CONTROL),y)
+$(obj)/$(SPL_BIN)-dtb.bin: $(obj)/$(SPL_BIN)-nodtb.bin $(obj)/$(SPL_BIN)-pad.bin \
$(obj)/$(SPL_BIN).dtb FORCE
$(call if_changed,cat)
-# Create a file that pads from the end of u-boot-spl.bin to bss_end
+$(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN)-dtb.bin FORCE
+ $(call if_changed,copy)
+else
+$(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN)-nodtb.bin FORCE
+ $(call if_changed,copy)
+endif
+
+# Create a file that pads from the end of u-boot-spl-nodtb.bin to bss_end
$(obj)/$(SPL_BIN)-pad.bin: $(obj)/$(SPL_BIN)
@bss_size_str=$(shell $(NM) $< | awk 'BEGIN {size = 0} /__bss_size/ {size = $$1} END {print "ibase=16; " toupper(size)}' | bc); \
dd if=/dev/zero of=$@ bs=1 count=$${bss_size_str} 2>/dev/null;
@@ -211,9 +218,9 @@ endif
quiet_cmd_objcopy = OBJCOPY $@
cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@
-OBJCOPYFLAGS_$(SPL_BIN).bin = $(SPL_OBJCFLAGS) -O binary
+OBJCOPYFLAGS_$(SPL_BIN)-nodtb.bin = $(SPL_OBJCFLAGS) -O binary
-$(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN) FORCE
+$(obj)/$(SPL_BIN)-nodtb.bin: $(obj)/$(SPL_BIN) FORCE
$(call if_changed,objcopy)
LDFLAGS_$(SPL_BIN) += -T u-boot-spl.lds $(LDFLAGS_FINAL)