[U-Boot] [PATCH 0/7] fdt: Replace u-boot-dtb.bin with u-boot.bin

At present u-boot.bin holds the plain U-Boot binary without the device tree. This is somewhat annoying since you need either u-boot.bin or u-boot-dtb.bin depending on whether device tree is used.
This series adjusts the build such that u-boot.bin includes a device tree, and the plain binary is in u-boot-nodtb.bin. For now u-boot-dtb.bin remains the same.
This should be acceptable since:
- without OF_CONTROL, u-boot.bin still does not include a device tree - with OF_CONTROL, u-boot-dtb.bin does not change
The main impact is build systems which are set up to use u-boot.bin as the output file and then add a device tree. These will have to change to use u-boot-nodtb.bin instead.
The original decision to use a separate u-boot-dtb.bin was aimed at allowing any device tree file to be concatenated to the u-boot.bin image after the build. However this no-longer seems so important. More important is the convenience of using the same output file regardless of the setting for OF_CONTROL.
Simon Glass (7): tegra: Drop generation of -nodtb file with OF_CONTROL fdt: Build a U-Boot binary without device tree fdt: Build an SPL binary without device tree tegra: Always build a boot image with the same filename socfpga: Simplify Makefile filenames Makefile: Make u-boot.img the same as u-boot-dtb.img Makefile: Drop unnecessary -dtb suffixes
Makefile | 67 ++++++++++++++++++++++++++-------------------------- scripts/Makefile.spl | 26 +++++++++++++------- 2 files changed, 50 insertions(+), 43 deletions(-)

It seems clear that the intent is to generate u-boot-nodtb-tegra.bin only when OF_CONTROL is not set. But due to the way the rules are set up, this file is always generated. Fix this.
Signed-off-by: Simon Glass sjg@chromium.org ---
Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile index c9c2cbe..e2b6674 100644 --- a/Makefile +++ b/Makefile @@ -1077,8 +1077,9 @@ u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot.bin FORCE $(call if_changed,pad_cat)
ifeq ($(CONFIG_OF_SEPARATE),y) -u-boot-dtb-tegra.bin: u-boot-nodtb-tegra.bin dts/dt.dtb FORCE - $(call if_changed,cat) +OBJCOPYFLAGS_u-boot-dtb-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE) +u-boot-dtb-tegra.bin: spl/u-boot-spl u-boot-dtb.bin FORCE + $(call if_changed,pad_cat) endif endif

On 01/25/2016 01:30 PM, Simon Glass wrote:
It seems clear that the intent is to generate u-boot-nodtb-tegra.bin only when OF_CONTROL is not set. But due to the way the rules are set up, this file is always generated. Fix this.
Nak, this file is used by our flashing tools, so needs to be kept around.
(As background, we take the separate u-boot-nodtb-tegra.bin and u-boot.dtb, modify u-boot.dtb to inject some changes to the environment such as over-writing bootcmd with flashing instructions etc., and then blend the two back together for download into RAM and subsequent execution).

Hi Stephen,
On 25 January 2016 at 14:08, Stephen Warren swarren@wwwdotorg.org wrote:
On 01/25/2016 01:30 PM, Simon Glass wrote:
It seems clear that the intent is to generate u-boot-nodtb-tegra.bin only when OF_CONTROL is not set. But due to the way the rules are set up, this file is always generated. Fix this.
Nak, this file is used by our flashing tools, so needs to be kept around.
(As background, we take the separate u-boot-nodtb-tegra.bin and u-boot.dtb, modify u-boot.dtb to inject some changes to the environment such as over-writing bootcmd with flashing instructions etc., and then blend the two back together for download into RAM and subsequent execution).
OK. well in that case It think the code at the top is wrong:
# enable combined SPL/u-boot/dtb rules for tegra ifneq ($(CONFIG_TEGRA),) ifeq ($(CONFIG_SPL),y) ifeq ($(CONFIG_OF_SEPARATE),y) ALL-y += u-boot-dtb-tegra.bin else ALL-y += u-boot-nodtb-tegra.bin endif endif endif
It should be this, right?
# enable combined SPL/u-boot/dtb rules for tegra ifneq ($(CONFIG_TEGRA),) ifeq ($(CONFIG_SPL),y) ALL-y += u-boot-dtb-tegra.bin u-boot-nodtb-tegra.bin endif endif
Regards, Simon

On 01/25/2016 02:18 PM, Simon Glass wrote:
Hi Stephen,
On 25 January 2016 at 14:08, Stephen Warren swarren@wwwdotorg.org wrote:
On 01/25/2016 01:30 PM, Simon Glass wrote:
It seems clear that the intent is to generate u-boot-nodtb-tegra.bin only when OF_CONTROL is not set. But due to the way the rules are set up, this file is always generated. Fix this.
Nak, this file is used by our flashing tools, so needs to be kept around.
(As background, we take the separate u-boot-nodtb-tegra.bin and u-boot.dtb, modify u-boot.dtb to inject some changes to the environment such as over-writing bootcmd with flashing instructions etc., and then blend the two back together for download into RAM and subsequent execution).
OK. well in that case It think the code at the top is wrong:
# enable combined SPL/u-boot/dtb rules for tegra ifneq ($(CONFIG_TEGRA),) ifeq ($(CONFIG_SPL),y) ifeq ($(CONFIG_OF_SEPARATE),y) ALL-y += u-boot-dtb-tegra.bin else ALL-y += u-boot-nodtb-tegra.bin endif endif endif
It should be this, right?
# enable combined SPL/u-boot/dtb rules for tegra ifneq ($(CONFIG_TEGRA),) ifeq ($(CONFIG_SPL),y) ALL-y += u-boot-dtb-tegra.bin u-boot-nodtb-tegra.bin endif endif
That change looks almost fine, yes. I'd phrase it as follows:
ifneq ($(CONFIG_TEGRA),) ifeq ($(CONFIG_SPL),y) ALL-y += u-boot-nodtb-tegra.bin ifeq ($(CONFIG_OF_SEPARATE),y) ALL-y += u-boot-dtb-tegra.bin endif endif endif
... so that u-boot-dtb-tegra.bin is only built when there's a DTB in use.
(or we could drop the most nested ifdef as you wrote, if we assume the value of CONFIG_OF_SEPARATE on Tegra)
Everything works and is safe right now since later Makefile says:
ifeq ($(CONFIG_OF_SEPARATE),y) u-boot-dtb-tegra.bin: u-boot-nodtb-tegra.bin dts/dt.dtb FORCE $(call if_changed,cat) endif
So the if statement you're quoting is ensuring that the "final" or "most complete" file is built, and then the dependency chain ends up ensuring that all the others are built. As you say though, it would be good if ALL-y listed everything that users expect to use.

Hi Stephen,
On 25 January 2016 at 14:26, Stephen Warren swarren@wwwdotorg.org wrote:
On 01/25/2016 02:18 PM, Simon Glass wrote:
Hi Stephen,
On 25 January 2016 at 14:08, Stephen Warren swarren@wwwdotorg.org wrote:
On 01/25/2016 01:30 PM, Simon Glass wrote:
It seems clear that the intent is to generate u-boot-nodtb-tegra.bin only when OF_CONTROL is not set. But due to the way the rules are set up, this file is always generated. Fix this.
Nak, this file is used by our flashing tools, so needs to be kept around.
(As background, we take the separate u-boot-nodtb-tegra.bin and u-boot.dtb, modify u-boot.dtb to inject some changes to the environment such as over-writing bootcmd with flashing instructions etc., and then blend the two back together for download into RAM and subsequent execution).
OK. well in that case It think the code at the top is wrong:
# enable combined SPL/u-boot/dtb rules for tegra ifneq ($(CONFIG_TEGRA),) ifeq ($(CONFIG_SPL),y) ifeq ($(CONFIG_OF_SEPARATE),y) ALL-y += u-boot-dtb-tegra.bin else ALL-y += u-boot-nodtb-tegra.bin endif endif endif
It should be this, right?
# enable combined SPL/u-boot/dtb rules for tegra ifneq ($(CONFIG_TEGRA),) ifeq ($(CONFIG_SPL),y) ALL-y += u-boot-dtb-tegra.bin u-boot-nodtb-tegra.bin endif endif
That change looks almost fine, yes. I'd phrase it as follows:
ifneq ($(CONFIG_TEGRA),) ifeq ($(CONFIG_SPL),y) ALL-y += u-boot-nodtb-tegra.bin ifeq ($(CONFIG_OF_SEPARATE),y) ALL-y += u-boot-dtb-tegra.bin endif endif endif
... so that u-boot-dtb-tegra.bin is only built when there's a DTB in use.
(or we could drop the most nested ifdef as you wrote, if we assume the value of CONFIG_OF_SEPARATE on Tegra)
Everything works and is safe right now since later Makefile says:
ifeq ($(CONFIG_OF_SEPARATE),y) u-boot-dtb-tegra.bin: u-boot-nodtb-tegra.bin dts/dt.dtb FORCE $(call if_changed,cat) endif
So the if statement you're quoting is ensuring that the "final" or "most complete" file is built, and then the dependency chain ends up ensuring that all the others are built. As you say though, it would be good if ALL-y listed everything that users expect to use.
OK thanks for the info.
Regards, Simon

At present u-boot.bin holds the plain U-Boot binary without the device tree. This is somewhat annoying since you need either u-boot.bin or u-boot-dtb.bin depending on whether device tree is used.
Adjust the build such that u-boot.bin includes a device tree, and the plain binary is in u-boot-nodtb.bin. For now u-boot-dtb.bin remains the same.
This should be acceptable since:
- without OF_CONTROL, u-boot.bin still does not include a device tree - with OF_CONTROL, u-boot-dtb.bin does not change
The main impact is build systems which are set up to use u-boot.bin as the output file and then add a device tree. These will have to change to use u-boot-nodtb.bin instead.
Adjust tegra rules so it continues to produce the correct files.
Signed-off-by: Simon Glass sjg@chromium.org ---
Makefile | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/Makefile b/Makefile index e2b6674..4fa1b9a 100644 --- a/Makefile +++ b/Makefile @@ -827,9 +827,17 @@ PHONY += dtbs dtbs dts/dt.dtb: checkdtc u-boot $(Q)$(MAKE) $(build)=dts dtbs
-u-boot-dtb.bin: u-boot.bin dts/dt.dtb FORCE +ifeq ($(CONFIG_OF_CONTROL),y) +u-boot-dtb.bin: u-boot-nodtb.bin dts/dt.dtb FORCE $(call if_changed,cat)
+u-boot.bin: u-boot-dtb.bin FORCE + $(call if_changed,cat) +else +u-boot.bin: u-boot-nodtb.bin FORCE + $(call if_changed,cat) +endif + %.imx: %.bin $(Q)$(MAKE) $(build)=arch/arm/imx-common $@
@@ -846,11 +854,11 @@ OBJCOPYFLAGS_u-boot.srec := -O srec u-boot.hex u-boot.srec: u-boot FORCE $(call if_changed,objcopy)
-OBJCOPYFLAGS_u-boot.bin := -O binary \ +OBJCOPYFLAGS_u-boot-nodtb.bin := -O binary \ $(if $(CONFIG_X86_RESET_VECTOR),-R .start16 -R .resetvec)
-binary_size_check: u-boot.bin FORCE - @file_size=$(shell wc -c u-boot.bin | awk '{print $$1}') ; \ +binary_size_check: u-boot-nodtb.bin FORCE + @file_size=$(shell wc -c u-boot-nodtb.bin | awk '{print $$1}') ; \ map_size=$(shell cat u-boot.map | \ awk '/_image_copy_start/ {start = $$1} /_image_binary_end/ {end = $$1} END {if (start != "" && end != "") print "ibase=16; " toupper(end) " - " toupper(start)}' \ | sed 's/0X//g' \ @@ -858,12 +866,12 @@ binary_size_check: u-boot.bin FORCE if [ "" != "$$map_size" ]; then \ if test $$map_size -ne $$file_size; then \ echo "u-boot.map shows a binary size of $$map_size" >&2 ; \ - echo " but u-boot.bin shows $$file_size" >&2 ; \ + echo " but u-boot-nodtb.bin shows $$file_size" >&2 ; \ exit 1; \ fi \ fi
-u-boot.bin: u-boot FORCE +u-boot-nodtb.bin: u-boot FORCE $(call if_changed,objcopy) $(call DO_STATIC_RELA,$<,$@,$(CONFIG_SYS_TEXT_BASE)) $(BOARD_SIZE_CHECK) @@ -1022,7 +1030,7 @@ rom: u-boot.rom FORCE IFDTOOL=$(objtree)/tools/ifdtool IFDTOOL_FLAGS = -f 0:$(objtree)/u-boot.dtb IFDTOOL_FLAGS += -m 0x$(shell $(NM) u-boot |grep _dt_ucode_base_size |cut -d' ' -f1) -IFDTOOL_FLAGS += -U $(CONFIG_SYS_TEXT_BASE):$(objtree)/u-boot.bin +IFDTOOL_FLAGS += -U $(CONFIG_SYS_TEXT_BASE):$(objtree)/u-boot-nodtb.bin IFDTOOL_FLAGS += -w $(CONFIG_SYS_X86_START16):$(objtree)/u-boot-x86-16bit.bin IFDTOOL_FLAGS += -C

On 01/25/2016 01:30 PM, Simon Glass wrote:
At present u-boot.bin holds the plain U-Boot binary without the device tree. This is somewhat annoying since you need either u-boot.bin or u-boot-dtb.bin depending on whether device tree is used.
Adjust the build such that u-boot.bin includes a device tree, and the plain binary is in u-boot-nodtb.bin. For now u-boot-dtb.bin remains the same.
This should be acceptable since:
- without OF_CONTROL, u-boot.bin still does not include a device tree
- with OF_CONTROL, u-boot-dtb.bin does not change
The main impact is build systems which are set up to use u-boot.bin as the output file and then add a device tree. These will have to change to use u-boot-nodtb.bin instead.
That's probably going to annoy somebody. Have you put thought into how such a build system could auto-detect which file it should use in order to automatically adjust to the different file naming conventions of different U-Boot versions or branches? If not, this change will burden the operator of any tool or automated system with manually handling the difference by branching their own code or processes:-(
Adjust tegra rules so it continues to produce the correct files.
I don't see anything Tegra-related in this patch. Perhaps patch 1/7 was included here in a previous version and the commit description not updated?
Anyway, I think this patch doesn't affect me or Tegra's flashing tools. For reference, the tool currently uses the following files:
u-boot spl/u-boot-spl u-boot-nodtb-tegra.bin u-boot.dtb u-boot-dtb-tegra.bin

Hi Stephen,
On 25 January 2016 at 14:14, Stephen Warren swarren@wwwdotorg.org wrote:
On 01/25/2016 01:30 PM, Simon Glass wrote:
At present u-boot.bin holds the plain U-Boot binary without the device tree. This is somewhat annoying since you need either u-boot.bin or u-boot-dtb.bin depending on whether device tree is used.
Adjust the build such that u-boot.bin includes a device tree, and the plain binary is in u-boot-nodtb.bin. For now u-boot-dtb.bin remains the same.
This should be acceptable since:
- without OF_CONTROL, u-boot.bin still does not include a device tree
- with OF_CONTROL, u-boot-dtb.bin does not change
The main impact is build systems which are set up to use u-boot.bin as the output file and then add a device tree. These will have to change to use u-boot-nodtb.bin instead.
That's probably going to annoy somebody. Have you put thought into how such a build system could auto-detect which file it should use in order to automatically adjust to the different file naming conventions of different U-Boot versions or branches? If not, this change will burden the operator of any tool or automated system with manually handling the difference by branching their own code or processes:-(
Well we cannot know what downstream build systems do, but I think my reasoning is about right.
Adjust tegra rules so it continues to produce the correct files.
I don't see anything Tegra-related in this patch. Perhaps patch 1/7 was included here in a previous version and the commit description not updated?
Yes, somehow I managed to send out the wrong branch. A few commit messages are out of date but the code is the same. I'll fix it with v2 once I get some comments.
Anyway, I think this patch doesn't affect me or Tegra's flashing tools. For reference, the tool currently uses the following files:
u-boot spl/u-boot-spl u-boot-nodtb-tegra.bin u-boot.dtb u-boot-dtb-tegra.bin
Regards, Simon

On 01/25/2016 02:14 PM, Stephen Warren wrote:
On 01/25/2016 01:30 PM, Simon Glass wrote:
At present u-boot.bin holds the plain U-Boot binary without the device tree. This is somewhat annoying since you need either u-boot.bin or u-boot-dtb.bin depending on whether device tree is used.
Adjust the build such that u-boot.bin includes a device tree, and the plain binary is in u-boot-nodtb.bin. For now u-boot-dtb.bin remains the same.
This should be acceptable since:
- without OF_CONTROL, u-boot.bin still does not include a device tree
- with OF_CONTROL, u-boot-dtb.bin does not change
The main impact is build systems which are set up to use u-boot.bin as the output file and then add a device tree. These will have to change to use u-boot-nodtb.bin instead.
That's probably going to annoy somebody. Have you put thought into how such a build system could auto-detect which file it should use in order to automatically adjust to the different file naming conventions of different U-Boot versions or branches? If not, this change will burden the operator of any tool or automated system with manually handling the difference by branching their own code or processes:-(
Adjust tegra rules so it continues to produce the correct files.
I don't see anything Tegra-related in this patch. Perhaps patch 1/7 was included here in a previous version and the commit description not updated?
Anyway, I think this patch doesn't affect me or Tegra's flashing tools. For reference, the tool currently uses the following files:
u-boot spl/u-boot-spl u-boot-nodtb-tegra.bin u-boot.dtb u-boot-dtb-tegra.bin
Oh, that list is for ARMv7 targets. For ARMv8 targets, we currently use the following instead:
u-boot* u-boot.bin u-boot.dtb u-boot-dtb.bin
Preferably those files won't change either, or if they do, there's a trivial way of determining which set of files is present (e.g. perhaps we pick up u-boot-nodtb.bin and u-boot-dtb.bin if those two files exist, else we pick up u-boot.bin and u-boot-dtb.bin?)

Hi Stephen,
On 25 January 2016 at 17:42, Stephen Warren swarren@wwwdotorg.org wrote:
On 01/25/2016 02:14 PM, Stephen Warren wrote:
On 01/25/2016 01:30 PM, Simon Glass wrote:
At present u-boot.bin holds the plain U-Boot binary without the device tree. This is somewhat annoying since you need either u-boot.bin or u-boot-dtb.bin depending on whether device tree is used.
Adjust the build such that u-boot.bin includes a device tree, and the plain binary is in u-boot-nodtb.bin. For now u-boot-dtb.bin remains the same.
This should be acceptable since:
- without OF_CONTROL, u-boot.bin still does not include a device tree
- with OF_CONTROL, u-boot-dtb.bin does not change
The main impact is build systems which are set up to use u-boot.bin as the output file and then add a device tree. These will have to change to use u-boot-nodtb.bin instead.
That's probably going to annoy somebody. Have you put thought into how such a build system could auto-detect which file it should use in order to automatically adjust to the different file naming conventions of different U-Boot versions or branches? If not, this change will burden the operator of any tool or automated system with manually handling the difference by branching their own code or processes:-(
Adjust tegra rules so it continues to produce the correct files.
I don't see anything Tegra-related in this patch. Perhaps patch 1/7 was included here in a previous version and the commit description not updated?
Anyway, I think this patch doesn't affect me or Tegra's flashing tools. For reference, the tool currently uses the following files:
u-boot spl/u-boot-spl u-boot-nodtb-tegra.bin u-boot.dtb u-boot-dtb-tegra.bin
Oh, that list is for ARMv7 targets. For ARMv8 targets, we currently use the following instead:
u-boot* u-boot.bin u-boot.dtb u-boot-dtb.bin
Preferably those files won't change either, or if they do, there's a trivial way of determining which set of files is present (e.g. perhaps we pick up u-boot-nodtb.bin and u-boot-dtb.bin if those two files exist, else we pick up u-boot.bin and u-boot-dtb.bin?)
The only addition will be u-boot-nodtb.bin. I'm not sure what you should pick up - perhaps everything?
Regards, Simon

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, and the plain binary is in u-boot-spl-nodtb.bin. For now u-boot-spl-dtb.bin remains the same.
Signed-off-by: Simon Glass sjg@chromium.org ---
scripts/Makefile.spl | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index 96f414a..7bf471a 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -131,14 +131,14 @@ 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 +ALL-$(CONFIG_OF_SEPARATE) += $(obj)/$(SPL_BIN)-pad.bin $(obj)/$(SPL_BIN)-nodtb.bin endif
ifdef CONFIG_SAMSUNG @@ -166,11 +166,19 @@ 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 \ +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,cat) +else +$(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN)-nodtb.bin FORCE + $(call if_changed,cat) +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 +219,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)

Adjust the Makefile to build u-boot-tegra.bin which contains a device tree if OF_CONTROL is enabled, and does not if not. This mirrors U-Boot's new approach of using u-boot.bin to handle both cases.
Signed-off-by: Simon Glass sjg@chromium.org ---
Makefile | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/Makefile b/Makefile index 4fa1b9a..fa55c71 100644 --- a/Makefile +++ b/Makefile @@ -765,6 +765,7 @@ endif # enable combined SPL/u-boot/dtb rules for tegra ifneq ($(CONFIG_TEGRA),) ifeq ($(CONFIG_SPL),y) +ALL-y += u-boot-tegra.bin ifeq ($(CONFIG_OF_SEPARATE),y) ALL-y += u-boot-dtb-tegra.bin else @@ -1080,15 +1081,12 @@ u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin \ endif
ifneq ($(CONFIG_TEGRA),) -OBJCOPYFLAGS_u-boot-nodtb-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE) -u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot.bin FORCE +OBJCOPYFLAGS_u-boot-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE) +u-boot-tegra.bin: spl/u-boot-spl u-boot.bin FORCE $(call if_changed,pad_cat)
-ifeq ($(CONFIG_OF_SEPARATE),y) -OBJCOPYFLAGS_u-boot-dtb-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE) -u-boot-dtb-tegra.bin: spl/u-boot-spl u-boot-dtb.bin FORCE - $(call if_changed,pad_cat) -endif +u-boot-nodtb-tegra.bin u-boot-dtb-tegra.bin: u-boot-tegra.bin FORCE + $(call if_changed,cat) endif
OBJCOPYFLAGS_u-boot-app.efi := $(OBJCOPYFLAGS_EFI)

On 01/25/2016 01:30 PM, Simon Glass wrote:
Adjust the Makefile to build u-boot-tegra.bin which contains a device tree if OF_CONTROL is enabled, and does not if not. This mirrors U-Boot's new approach of using u-boot.bin to handle both cases.
For Tegra, we need:
u-boot-nodtb-tegra.bin Required always. This never includes a DTB.
u-boot-dtb-tegra.bin Required if OF_CONTROL is enabled (which these days is always). This always includes a DTB.
I believe this change violates those requirements since it makes both u-boot-nodtb-tegra.bin and u-boot-dtb-tegra.bin identical to u-boot-tegra.bin, and hence always include a DTB in practice.

Hi Stephen,
On 25 January 2016 at 14:20, Stephen Warren swarren@wwwdotorg.org wrote:
On 01/25/2016 01:30 PM, Simon Glass wrote:
Adjust the Makefile to build u-boot-tegra.bin which contains a device tree if OF_CONTROL is enabled, and does not if not. This mirrors U-Boot's new approach of using u-boot.bin to handle both cases.
For Tegra, we need:
u-boot-nodtb-tegra.bin Required always. This never includes a DTB.
u-boot-dtb-tegra.bin Required if OF_CONTROL is enabled (which these days is always). This always includes a DTB.
I believe this change violates those requirements since it makes both u-boot-nodtb-tegra.bin and u-boot-dtb-tegra.bin identical to u-boot-tegra.bin, and hence always include a DTB in practice.
Yes, I think I was confused by the code at the top, as mentioned on the other thread. Will await your response there and then take another look.
Regards, Simon

We don't need the -dtb suffix anymore, so drop it.
Signed-off-by: Simon Glass sjg@chromium.org ---
Makefile | 10 +++++----- scripts/Makefile.spl | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/Makefile b/Makefile index fa55c71..66e96cb 100644 --- a/Makefile +++ b/Makefile @@ -1015,10 +1015,10 @@ u-boot.spr: spl/u-boot-spl.img u-boot.img FORCE
ifneq ($(CONFIG_ARCH_SOCFPGA),) quiet_cmd_socboot = SOCBOOT $@ -cmd_socboot = cat spl/u-boot-spl-dtb.sfp spl/u-boot-spl-dtb.sfp \ - spl/u-boot-spl-dtb.sfp spl/u-boot-spl-dtb.sfp \ - u-boot-dtb.img > $@ || rm -f $@ -u-boot-with-spl-dtb.sfp: spl/u-boot-spl-dtb.sfp u-boot-dtb.img FORCE +cmd_socboot = cat spl/u-boot-spl.sfp spl/u-boot-spl.sfp \ + spl/u-boot-spl.sfp spl/u-boot-spl.sfp \ + u-boot.img > $@ || rm -f $@ +u-boot-with-spl.sfp: spl/u-boot-spl.sfp u-boot.img FORCE $(call if_changed,socboot) endif
@@ -1323,7 +1323,7 @@ spl/u-boot-spl: tools prepare $(if $(CONFIG_OF_SEPARATE),dts/dt.dtb) spl/sunxi-spl.bin: spl/u-boot-spl @:
-spl/u-boot-spl-dtb.sfp: spl/u-boot-spl +spl/u-boot-spl.sfp: spl/u-boot-spl @:
spl/boot.bin: spl/u-boot-spl diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index 7bf471a..aa7091c 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -146,7 +146,7 @@ ALL-y += $(obj)/$(BOARD)-spl.bin endif
ifdef CONFIG_ARCH_SOCFPGA -ALL-y += $(obj)/$(SPL_BIN)-dtb.sfp +ALL-y += $(obj)/$(SPL_BIN).sfp endif
ifdef CONFIG_SUNXI @@ -230,8 +230,8 @@ LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_SPL_TEXT_BASE) endif
ifdef CONFIG_ARCH_SOCFPGA -MKIMAGEFLAGS_$(SPL_BIN)-dtb.sfp = -T socfpgaimage -$(obj)/$(SPL_BIN)-dtb.sfp: $(obj)/$(SPL_BIN)-dtb.bin FORCE +MKIMAGEFLAGS_$(SPL_BIN).sfp = -T socfpgaimage +$(obj)/$(SPL_BIN).sfp: $(obj)/$(SPL_BIN).bin FORCE $(call if_changed,mkimage) endif

On Monday, January 25, 2016 at 09:30:29 PM, Simon Glass wrote:
We don't need the -dtb suffix anymore, so drop it.
Signed-off-by: Simon Glass sjg@chromium.org
You should also fix the MCV:
$ git grep u-boot-with-spl-dtb.sfp ... include/configs/socfpga_mcvevk.h: "update_filename=u-boot-with-spl-dtb.sfp\0"
I have to admit, I am not a big fan of this renaming, since it's just introducing naming chaos between versions.
Makefile | 10 +++++----- scripts/Makefile.spl | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/Makefile b/Makefile index fa55c71..66e96cb 100644 --- a/Makefile +++ b/Makefile @@ -1015,10 +1015,10 @@ u-boot.spr: spl/u-boot-spl.img u-boot.img FORCE
ifneq ($(CONFIG_ARCH_SOCFPGA),) quiet_cmd_socboot = SOCBOOT $@ -cmd_socboot = cat spl/u-boot-spl-dtb.sfp spl/u-boot-spl-dtb.sfp \
spl/u-boot-spl-dtb.sfp spl/u-boot-spl-dtb.sfp \
u-boot-dtb.img > $@ || rm -f $@
-u-boot-with-spl-dtb.sfp: spl/u-boot-spl-dtb.sfp u-boot-dtb.img FORCE +cmd_socboot = cat spl/u-boot-spl.sfp spl/u-boot-spl.sfp \
spl/u-boot-spl.sfp spl/u-boot-spl.sfp \
u-boot.img > $@ || rm -f $@
+u-boot-with-spl.sfp: spl/u-boot-spl.sfp u-boot.img FORCE $(call if_changed,socboot) endif
@@ -1323,7 +1323,7 @@ spl/u-boot-spl: tools prepare $(if $(CONFIG_OF_SEPARATE),dts/dt.dtb) spl/sunxi-spl.bin: spl/u-boot-spl @:
-spl/u-boot-spl-dtb.sfp: spl/u-boot-spl +spl/u-boot-spl.sfp: spl/u-boot-spl @:
spl/boot.bin: spl/u-boot-spl diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index 7bf471a..aa7091c 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -146,7 +146,7 @@ ALL-y += $(obj)/$(BOARD)-spl.bin endif
ifdef CONFIG_ARCH_SOCFPGA -ALL-y += $(obj)/$(SPL_BIN)-dtb.sfp +ALL-y += $(obj)/$(SPL_BIN).sfp endif
ifdef CONFIG_SUNXI @@ -230,8 +230,8 @@ LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_SPL_TEXT_BASE) endif
ifdef CONFIG_ARCH_SOCFPGA -MKIMAGEFLAGS_$(SPL_BIN)-dtb.sfp = -T socfpgaimage -$(obj)/$(SPL_BIN)-dtb.sfp: $(obj)/$(SPL_BIN)-dtb.bin FORCE +MKIMAGEFLAGS_$(SPL_BIN).sfp = -T socfpgaimage +$(obj)/$(SPL_BIN).sfp: $(obj)/$(SPL_BIN).bin FORCE $(call if_changed,mkimage) endif
Best regards, Marek Vasut

Hi Marek,
On 25 January 2016 at 13:43, Marek Vasut marex@denx.de wrote:
On Monday, January 25, 2016 at 09:30:29 PM, Simon Glass wrote:
We don't need the -dtb suffix anymore, so drop it.
Signed-off-by: Simon Glass sjg@chromium.org
You should also fix the MCV:
$ git grep u-boot-with-spl-dtb.sfp ... include/configs/socfpga_mcvevk.h: "update_filename=u-boot-with-spl-dtb.sfp\0"
OK
I have to admit, I am not a big fan of this renaming, since it's just introducing naming chaos between versions.
I'm rather hoping that the impact will be fairly small for the reasons I explained in the cover letter.
Makefile | 10 +++++----- scripts/Makefile.spl | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/Makefile b/Makefile index fa55c71..66e96cb 100644 --- a/Makefile +++ b/Makefile @@ -1015,10 +1015,10 @@ u-boot.spr: spl/u-boot-spl.img u-boot.img FORCE
ifneq ($(CONFIG_ARCH_SOCFPGA),) quiet_cmd_socboot = SOCBOOT $@ -cmd_socboot = cat spl/u-boot-spl-dtb.sfp spl/u-boot-spl-dtb.sfp \
spl/u-boot-spl-dtb.sfp spl/u-boot-spl-dtb.sfp \
u-boot-dtb.img > $@ || rm -f $@
-u-boot-with-spl-dtb.sfp: spl/u-boot-spl-dtb.sfp u-boot-dtb.img FORCE +cmd_socboot = cat spl/u-boot-spl.sfp spl/u-boot-spl.sfp \
spl/u-boot-spl.sfp spl/u-boot-spl.sfp \
u-boot.img > $@ || rm -f $@
+u-boot-with-spl.sfp: spl/u-boot-spl.sfp u-boot.img FORCE $(call if_changed,socboot) endif
@@ -1323,7 +1323,7 @@ spl/u-boot-spl: tools prepare $(if $(CONFIG_OF_SEPARATE),dts/dt.dtb) spl/sunxi-spl.bin: spl/u-boot-spl @:
-spl/u-boot-spl-dtb.sfp: spl/u-boot-spl +spl/u-boot-spl.sfp: spl/u-boot-spl @:
spl/boot.bin: spl/u-boot-spl diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index 7bf471a..aa7091c 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -146,7 +146,7 @@ ALL-y += $(obj)/$(BOARD)-spl.bin endif
ifdef CONFIG_ARCH_SOCFPGA -ALL-y += $(obj)/$(SPL_BIN)-dtb.sfp +ALL-y += $(obj)/$(SPL_BIN).sfp endif
ifdef CONFIG_SUNXI @@ -230,8 +230,8 @@ LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_SPL_TEXT_BASE) endif
ifdef CONFIG_ARCH_SOCFPGA -MKIMAGEFLAGS_$(SPL_BIN)-dtb.sfp = -T socfpgaimage -$(obj)/$(SPL_BIN)-dtb.sfp: $(obj)/$(SPL_BIN)-dtb.bin FORCE +MKIMAGEFLAGS_$(SPL_BIN).sfp = -T socfpgaimage +$(obj)/$(SPL_BIN).sfp: $(obj)/$(SPL_BIN).bin FORCE $(call if_changed,mkimage) endif
Best regards, Marek Vasut
Regards, Simon

When OF_CONTROL is enabled, u-boot.img has no purpose since it does not include the required device tree binary. The correct image to use is u-boot-dtb.img with OF_CONTROL but u-boot.img without OF_CONTROL.
Create u-boot.img even when OF_CONTROL is enabled, so that this file can be used in both cases.
Signed-off-by: Simon Glass sjg@chromium.org ---
Makefile | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/Makefile b/Makefile index 66e96cb..d432000 100644 --- a/Makefile +++ b/Makefile @@ -906,6 +906,8 @@ MKIMAGEFLAGS_u-boot.img = -A $(ARCH) -T firmware -C none -O u-boot \ -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \ -n "U-Boot $(UBOOTRELEASE) for $(BOARD) board"
+MKIMAGEFLAGS_u-boot-dtb.img = $(MKIMAGEFLAGS_u-boot.img) + MKIMAGEFLAGS_u-boot.kwb = -n $(srctree)/$(CONFIG_SYS_KWD_CONFIG:"%"=%) \ -T kwbimage -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE)
@@ -915,17 +917,12 @@ MKIMAGEFLAGS_u-boot-spl.kwb = -n $(srctree)/$(CONFIG_SYS_KWD_CONFIG:"%"=%) \ MKIMAGEFLAGS_u-boot.pbl = -n $(srctree)/$(CONFIG_SYS_FSL_PBL_RCW:"%"=%) \ -R $(srctree)/$(CONFIG_SYS_FSL_PBL_PBI:"%"=%) -T pblimage
-u-boot.img u-boot.kwb u-boot.pbl: u-boot.bin FORCE +u-boot-dtb.img u-boot.img u-boot.kwb u-boot.pbl: u-boot.bin FORCE $(call if_changed,mkimage)
u-boot-spl.kwb: u-boot-dtb.img spl/u-boot-spl.bin FORCE $(call if_changed,mkimage)
-MKIMAGEFLAGS_u-boot-dtb.img = $(MKIMAGEFLAGS_u-boot.img) - -u-boot-dtb.img: u-boot-dtb.bin FORCE - $(call if_changed,mkimage) - u-boot.sha1: u-boot.bin tools/ubsha1 u-boot.bin
@@ -1127,11 +1124,7 @@ spl/u-boot-spl.pbl: spl/u-boot-spl.bin FORCE $(call if_changed,mkimage)
ifeq ($(ARCH),arm) -ifdef CONFIG_OF_CONTROL -UBOOT_BINLOAD := u-boot-dtb.img -else UBOOT_BINLOAD := u-boot.img -endif else UBOOT_BINLOAD := u-boot.bin endif

When OF_CONTROL is enabled, u-boot-dtb.* files are the same as u-boot.* files. So we can use the latter for simplicity.
Signed-off-by: Simon Glass sjg@chromium.org ---
Makefile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/Makefile b/Makefile index d432000..c15a5ac 100644 --- a/Makefile +++ b/Makefile @@ -920,7 +920,7 @@ MKIMAGEFLAGS_u-boot.pbl = -n $(srctree)/$(CONFIG_SYS_FSL_PBL_RCW:"%"=%) \ u-boot-dtb.img u-boot.img u-boot.kwb u-boot.pbl: u-boot.bin FORCE $(call if_changed,mkimage)
-u-boot-spl.kwb: u-boot-dtb.img spl/u-boot-spl.bin FORCE +u-boot-spl.kwb: u-boot.img spl/u-boot-spl.bin FORCE $(call if_changed,mkimage)
u-boot.sha1: u-boot.bin @@ -1061,7 +1061,7 @@ endif cmd_ifdtool += $(IFDTOOL) $(IFDTOOL_FLAGS) u-boot.tmp; cmd_ifdtool += mv u-boot.tmp $@
-u-boot.rom: u-boot-x86-16bit.bin u-boot-dtb.bin +u-boot.rom: u-boot-x86-16bit.bin u-boot.bin $(call if_changed,ifdtool)
OBJCOPYFLAGS_u-boot-x86-16bit.bin := -O binary -j .start16 -j .resetvec @@ -1072,8 +1072,7 @@ endif ifneq ($(CONFIG_SUNXI),) OBJCOPYFLAGS_u-boot-sunxi-with-spl.bin = -I binary -O binary \ --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff -u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin \ - u-boot$(if $(CONFIG_OF_CONTROL),-dtb,).img FORCE +u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img FORCE $(call if_changed,pad_cat) endif
@@ -1090,7 +1089,7 @@ OBJCOPYFLAGS_u-boot-app.efi := $(OBJCOPYFLAGS_EFI) u-boot-app.efi: u-boot FORCE $(call if_changed,zobjcopy)
-u-boot-dtb.bin.o: u-boot-dtb.bin FORCE +u-boot.bin.o: u-boot.bin FORCE $(call if_changed,efipayload)
u-boot-payload.lds: $(LDSCRIPT_EFI) FORCE @@ -1100,10 +1099,10 @@ u-boot-payload.lds: $(LDSCRIPT_EFI) FORCE quiet_cmd_u-boot_payload ?= LD $@ cmd_u-boot_payload ?= $(LD) $(LDFLAGS_EFI_PAYLOAD) -o $@ \ -T u-boot-payload.lds arch/x86/cpu/call32.o \ - lib/efi/efi.o lib/efi/efi_stub.o u-boot-dtb.bin.o \ + lib/efi/efi.o lib/efi/efi_stub.o u-boot.bin.o \ $(addprefix arch/$(ARCH)/lib/efi/,$(EFISTUB))
-u-boot-payload: u-boot-dtb.bin.o u-boot-payload.lds FORCE +u-boot-payload: u-boot.bin.o u-boot-payload.lds FORCE $(call if_changed,u-boot_payload)
OBJCOPYFLAGS_u-boot-payload.efi := $(OBJCOPYFLAGS_EFI)

Hello Simon,
On Mon, Jan 25, 2016 at 6:30 PM, Simon Glass sjg@chromium.org wrote:
At present u-boot.bin holds the plain U-Boot binary without the device tree. This is somewhat annoying since you need either u-boot.bin or u-boot-dtb.bin depending on whether device tree is used.
This series adjusts the build such that u-boot.bin includes a device tree, and the plain binary is in u-boot-nodtb.bin. For now u-boot-dtb.bin remains the same.
This should be acceptable since:
- without OF_CONTROL, u-boot.bin still does not include a device tree
- with OF_CONTROL, u-boot-dtb.bin does not change
The main impact is build systems which are set up to use u-boot.bin as the output file and then add a device tree. These will have to change to use u-boot-nodtb.bin instead.
The original decision to use a separate u-boot-dtb.bin was aimed at allowing any device tree file to be concatenated to the u-boot.bin image after the build. However this no-longer seems so important. More important is the convenience of using the same output file regardless of the setting for OF_CONTROL.
This makes sense for user-friendness point of view and still allows for build systems to interact over the raw copy of U-Boot to concatenate it with the desired set of Device Tree files.
I think the more platforms move to Device Tree (from U-Boot point of view) the more important this change is.
I do support this addition. Tom, please make sure to mention this on the NEWS entry for the next release as integrations must to be aware of this behavior change.

Hi Otavio,
On 25 January 2016 at 14:57, Otavio Salvador otavio.salvador@ossystems.com.br wrote:
Hello Simon,
On Mon, Jan 25, 2016 at 6:30 PM, Simon Glass sjg@chromium.org wrote:
At present u-boot.bin holds the plain U-Boot binary without the device tree. This is somewhat annoying since you need either u-boot.bin or u-boot-dtb.bin depending on whether device tree is used.
This series adjusts the build such that u-boot.bin includes a device tree, and the plain binary is in u-boot-nodtb.bin. For now u-boot-dtb.bin remains the same.
This should be acceptable since:
- without OF_CONTROL, u-boot.bin still does not include a device tree
- with OF_CONTROL, u-boot-dtb.bin does not change
The main impact is build systems which are set up to use u-boot.bin as the output file and then add a device tree. These will have to change to use u-boot-nodtb.bin instead.
The original decision to use a separate u-boot-dtb.bin was aimed at allowing any device tree file to be concatenated to the u-boot.bin image after the build. However this no-longer seems so important. More important is the convenience of using the same output file regardless of the setting for OF_CONTROL.
This makes sense for user-friendness point of view and still allows for build systems to interact over the raw copy of U-Boot to concatenate it with the desired set of Device Tree files.
I think the more platforms move to Device Tree (from U-Boot point of view) the more important this change is.
Yes that is my motivation. We have been adding more and more special-case Makefile rules, and build/deploy instruction have had to change, etc. This way we can make the DT conversion a bit more seamless.
I do support this addition. Tom, please make sure to mention this on the NEWS entry for the next release as integrations must to be aware of this behavior change.
Regards, Simon

Hi Hans,
On 25 January 2016 at 13:30, Simon Glass sjg@chromium.org wrote:
At present u-boot.bin holds the plain U-Boot binary without the device tree. This is somewhat annoying since you need either u-boot.bin or u-boot-dtb.bin depending on whether device tree is used.
This series adjusts the build such that u-boot.bin includes a device tree, and the plain binary is in u-boot-nodtb.bin. For now u-boot-dtb.bin remains the same.
This should be acceptable since:
- without OF_CONTROL, u-boot.bin still does not include a device tree
- with OF_CONTROL, u-boot-dtb.bin does not change
The main impact is build systems which are set up to use u-boot.bin as the output file and then add a device tree. These will have to change to use u-boot-nodtb.bin instead.
The original decision to use a separate u-boot-dtb.bin was aimed at allowing any device tree file to be concatenated to the u-boot.bin image after the build. However this no-longer seems so important. More important is the convenience of using the same output file regardless of the setting for OF_CONTROL.
Do you have any comments on this series please?
Simon Glass (7): tegra: Drop generation of -nodtb file with OF_CONTROL fdt: Build a U-Boot binary without device tree fdt: Build an SPL binary without device tree tegra: Always build a boot image with the same filename socfpga: Simplify Makefile filenames Makefile: Make u-boot.img the same as u-boot-dtb.img Makefile: Drop unnecessary -dtb suffixes
Makefile | 67 ++++++++++++++++++++++++++-------------------------- scripts/Makefile.spl | 26 +++++++++++++------- 2 files changed, 50 insertions(+), 43 deletions(-)
-- 2.7.0.rc3.207.g0ac5344
Regards, Simon

Hi,
On 28-01-16 04:58, Simon Glass wrote:
Hi Hans,
On 25 January 2016 at 13:30, Simon Glass sjg@chromium.org wrote:
At present u-boot.bin holds the plain U-Boot binary without the device tree. This is somewhat annoying since you need either u-boot.bin or u-boot-dtb.bin depending on whether device tree is used.
This series adjusts the build such that u-boot.bin includes a device tree, and the plain binary is in u-boot-nodtb.bin. For now u-boot-dtb.bin remains the same.
This should be acceptable since:
- without OF_CONTROL, u-boot.bin still does not include a device tree
- with OF_CONTROL, u-boot-dtb.bin does not change
The main impact is build systems which are set up to use u-boot.bin as the output file and then add a device tree. These will have to change to use u-boot-nodtb.bin instead.
The original decision to use a separate u-boot-dtb.bin was aimed at allowing any device tree file to be concatenated to the u-boot.bin image after the build. However this no-longer seems so important. More important is the convenience of using the same output file regardless of the setting for OF_CONTROL.
Do you have any comments on this series please?
I'm fine with this series, all normal sunxi use-cases use u-boot-sunxi-with-spl.bin which is generated like this:
ifneq ($(CONFIG_SUNXI),) OBJCOPYFLAGS_u-boot-sunxi-with-spl.bin = -I binary -O binary \ --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin \ u-boot$(if $(CONFIG_OF_CONTROL),-dtb,).img FORCE $(call if_changed,pad_cat) endif
Which should stay working just fine, although it might be slightly simplified after your patch to simply always use u-boot.img.
sunxi spl does not use a dtb, so nothing should change there.
Regards,
Hans
Simon Glass (7): tegra: Drop generation of -nodtb file with OF_CONTROL fdt: Build a U-Boot binary without device tree fdt: Build an SPL binary without device tree tegra: Always build a boot image with the same filename socfpga: Simplify Makefile filenames Makefile: Make u-boot.img the same as u-boot-dtb.img Makefile: Drop unnecessary -dtb suffixes
Makefile | 67 ++++++++++++++++++++++++++-------------------------- scripts/Makefile.spl | 26 +++++++++++++------- 2 files changed, 50 insertions(+), 43 deletions(-)
-- 2.7.0.rc3.207.g0ac5344
Regards, Simon

Hi Hans,
On 28 January 2016 at 01:25, Hans de Goede hdegoede@redhat.com wrote:
Hi,
On 28-01-16 04:58, Simon Glass wrote:
Hi Hans,
On 25 January 2016 at 13:30, Simon Glass sjg@chromium.org wrote:
At present u-boot.bin holds the plain U-Boot binary without the device tree. This is somewhat annoying since you need either u-boot.bin or u-boot-dtb.bin depending on whether device tree is used.
This series adjusts the build such that u-boot.bin includes a device tree, and the plain binary is in u-boot-nodtb.bin. For now u-boot-dtb.bin remains the same.
This should be acceptable since:
- without OF_CONTROL, u-boot.bin still does not include a device tree
- with OF_CONTROL, u-boot-dtb.bin does not change
The main impact is build systems which are set up to use u-boot.bin as the output file and then add a device tree. These will have to change to use u-boot-nodtb.bin instead.
The original decision to use a separate u-boot-dtb.bin was aimed at allowing any device tree file to be concatenated to the u-boot.bin image after the build. However this no-longer seems so important. More important is the convenience of using the same output file regardless of the setting for OF_CONTROL.
Do you have any comments on this series please?
I'm fine with this series, all normal sunxi use-cases use u-boot-sunxi-with-spl.bin which is generated like this:
ifneq ($(CONFIG_SUNXI),) OBJCOPYFLAGS_u-boot-sunxi-with-spl.bin = -I binary -O binary \ --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin \ u-boot$(if $(CONFIG_OF_CONTROL),-dtb,).img FORCE $(call if_changed,pad_cat) endif
Which should stay working just fine, although it might be slightly simplified after your patch to simply always use u-boot.img.
sunxi spl does not use a dtb, so nothing should change there.
OK thanks. I'll respin the series with the comments address and send v2.
Regards, Simon
participants (5)
-
Hans de Goede
-
Marek Vasut
-
Otavio Salvador
-
Simon Glass
-
Stephen Warren