Skip to contentSkip to conversation

fdt: Replace u-boot-dtb.bin with u-boot.bin

PATCH Superseded Simon Glass 4 participants 23 messages Feb 1, 2016 – Feb 2, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

v3 cover 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 if enabled, 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 to 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.

Changes in v3:
- Fix build error when CONFIG_OF_EMBED is used
- Drop unnecessary ifdef around Makefile rule
- Adjust rules based on Masahiro's expert comments
- Use cmd_copy instead of cmd_cat
- Drop an unnecessary rule
- Update commit message to say OF_SEPARATE instead of OF_CONTROL
- Rewrite the commit message for clarity

Changes in v2:
- Rewrite this commit based on tegra feedback
- Update based on previous changes
- Fix the update_filename in MCV
- Tweak the tegra rule slightly

Simon Glass (7):
tegra: Clarify 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                         | 89 +++++++++++++++++++---------------------
 include/configs/socfpga_mcvevk.h |  2 +-
 scripts/Makefile.spl             | 31 ++++++++------
 3 files changed, 63 insertions(+), 59 deletions(-)
Signature · 1 line
2.7.0.rc3.207.g0ac5344
#1 lore raw

PATCH v3 1/7 tegra: Clarify generation of -nodtb file with OF_CONTROL

Fix the ALL-y logic in the Makefile so that is clear that we always want the -nodtb file.

---

Changes in v3:
- Fix build error when CONFIG_OF_EMBED is used
- Drop unnecessary ifdef around Makefile rule

Changes in v2:
- Rewrite this commit based on tegra feedback

 Makefile | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)
Makefile +5 -11
index 06996d4..dbb914a 100644
@@ -764,14 +764,9 @@ ALL-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom
 endif
 
 # 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
+ifeq ($(CONFIG_TEGRA)$(CONFIG_SPL),yy)
 ALL-y += u-boot-nodtb-tegra.bin
-endif
-endif
+ALL-$(CONFIG_OF_SEPARATE) += u-boot-dtb-tegra.bin
 endif
 
 # Add optional build target if defined in board/cpu/soc headers
@@ -1077,10 +1072,9 @@ 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
 	$(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)
-endif
+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
 
 OBJCOPYFLAGS_u-boot-app.efi := $(OBJCOPYFLAGS_EFI)
Signature · 1 line
2.7.0.rc3.207.g0ac5344
#2 lore raw

PATCH v3 1/7 tegra: Clarify generation of -nodtb file with OF_CONTROL

Quoted 4 lines · Simon Glass

Fix the ALL-y logic in the Makefile so that is clear that we always want the -nodtb file.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160201/58ffc447/attachment.sig>
#3 lore raw

PATCH v3 1/7 tegra: Clarify generation of -nodtb file with OF_CONTROL

In reply to Simon Glass
Quoted 4 lines · Simon Glass

Fix the ALL-y logic in the Makefile so that is clear that we always want the -nodtb file.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160201/3bdf3a4a/attachment.sig>
#4 lore raw

PATCH v3 2/7 fdt: Build a U-Boot binary without device tree

In reply to Simon Glass

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 (if enabled), 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.

---

Changes in v3:
- Adjust rules based on Masahiro's expert comments

Changes in v2: None

 Makefile | 32 ++++++++++++++++++++------------
 1 file changed, 20 insertions(+), 12 deletions(-)
Makefile +20 -12
index dbb914a..67824ac 100644
@@ -747,7 +747,7 @@ endif
 ALL-$(CONFIG_SPL) += spl/u-boot-spl.bin
 ALL-$(CONFIG_SPL_FRAMEWORK) += u-boot.img
 ALL-$(CONFIG_TPL) += tpl/u-boot-tpl.bin
-ALL-$(CONFIG_OF_SEPARATE) += u-boot.dtb u-boot-dtb.bin
+ALL-$(CONFIG_OF_SEPARATE) += u-boot.dtb
 ifeq ($(CONFIG_SPL_FRAMEWORK),y)
 ALL-$(CONFIG_OF_SEPARATE) += u-boot-dtb.img
 endif
@@ -823,15 +823,23 @@ 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
+quiet_cmd_copy = COPY    $@
+      cmd_copy = cp $< $@
+
+ifeq ($(CONFIG_OF_SEPARATE),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,copy)
+else
+u-boot.bin: u-boot-nodtb.bin FORCE
+	$(call if_changed,copy)
+endif
+
 %.imx: %.bin
 	$(Q)$(MAKE) $(build)=arch/arm/imx-common $@
 
-quiet_cmd_copy = COPY    $@
-      cmd_copy = cp $< $@
-
 u-boot.dtb: dts/dt.dtb
 	$(call cmd,copy)
 
@@ -842,11 +850,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' \
@@ -854,12 +862,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)
@@ -1018,7 +1026,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
 
@@ -1069,7 +1077,7 @@ 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
+u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot-nodtb.bin FORCE
 	$(call if_changed,pad_cat)
 
 OBJCOPYFLAGS_u-boot-dtb-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE)
Signature · 1 line
2.7.0.rc3.207.g0ac5344
#5 lore raw

PATCH v3 2/7 fdt: Build a U-Boot binary without device tree

Quoted 13 lines · Simon Glass

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 (if enabled), 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

Quoted 7 lines

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160201/18a17d4e/attachment.sig>
#6 lore raw

PATCH v3 3/7 fdt: Build an SPL binary without device tree

In reply to Simon Glass

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.

---

Changes in v3:
- Use cmd_copy instead of cmd_cat
- Drop an unnecessary rule

Changes in v2: None

 scripts/Makefile.spl | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)
scripts/Makefile.spl +16 -9
index dff16b9..bc6a330 100644
@@ -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)
Signature · 1 line
2.7.0.rc3.207.g0ac5344
#7 lore raw

PATCH v3 3/7 fdt: Build an SPL binary without device tree

Quoted 9 lines · Simon Glass

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160201/fb251066/attachment.sig>
#8 lore raw

PATCH v3 4/7 tegra: Always build a boot image with the same filename

In reply to Simon Glass

Adjust the Makefile to build u-boot-tegra.bin which contains a device tree if OF_SEPARATE is enabled, and does not if not. This mirrors U-Boot's new approach of using u-boot.bin to handle both cases.

---

Changes in v3:
- Update commit message to say OF_SEPARATE instead of OF_CONTROL

Changes in v2:
- Update based on previous changes

 Makefile | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
Makefile +6 -3
index 67824ac..74c13f0 100644
@@ -765,7 +765,7 @@ endif
 
 # enable combined SPL/u-boot/dtb rules for tegra
 ifeq ($(CONFIG_TEGRA)$(CONFIG_SPL),yy)
-ALL-y += u-boot-nodtb-tegra.bin
+ALL-y += u-boot-tegra.bin u-boot-nodtb-tegra.bin
 ALL-$(CONFIG_OF_SEPARATE) += u-boot-dtb-tegra.bin
 endif
 
@@ -1080,9 +1080,12 @@ 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-nodtb.bin FORCE
 	$(call if_changed,pad_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
+OBJCOPYFLAGS_u-boot-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE)
+u-boot-tegra.bin: spl/u-boot-spl u-boot-dtb.bin FORCE
 	$(call if_changed,pad_cat)
+
+u-boot-dtb-tegra.bin: u-boot-tegra.bin FORCE
+	$(call if_changed,copy)
 endif
 
 OBJCOPYFLAGS_u-boot-app.efi := $(OBJCOPYFLAGS_EFI)
Signature · 1 line
2.7.0.rc3.207.g0ac5344
#9 lore raw

PATCH v3 4/7 tegra: Always build a boot image with the same filename

Makefile endif · line 770

Quoted 12 lines · Simon Glass

Adjust the Makefile to build u-boot-tegra.bin which contains a device tree if OF_SEPARATE is enabled, and does not if not. This mirrors U-Boot's new approach of using u-boot.bin to handle both cases.

Makefile +1 -1
 
  # enable combined SPL/u-boot/dtb rules for tegra
  ifeq ($(CONFIG_TEGRA)$(CONFIG_SPL),yy)
-ALL-y += u-boot-nodtb-tegra.bin
+ALL-y += u-boot-tegra.bin u-boot-nodtb-tegra.bin
  ALL-$(CONFIG_OF_SEPARATE) += u-boot-dtb-tegra.bin
  endif

This seems different to the ALL-y entries for u-boot.bin and its -dtb/-nodtb variants. I believe that in that case, only u-boot.bin is in ALL-Y. No doubt my next comment is related.

Makefile OBJCOPYFLAGS_u-boot-nodtb-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE) · line 1089

Quoted 13 lines
Makefile +5 -2
@@ -1080,9 +1080,12 @@ 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-nodtb.bin FORCE
  	$(call if_changed,pad_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
+OBJCOPYFLAGS_u-boot-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE)
+u-boot-tegra.bin: spl/u-boot-spl u-boot-dtb.bin FORCE
  	$(call if_changed,pad_cat)
+
+u-boot-dtb-tegra.bin: u-boot-tegra.bin FORCE
+	$(call if_changed,copy)
  endif

That looks different to how the main u-boot.bin is handled too. There, u-boot.bin is a copy of u-boot-nodtb.bin or u-boot-dtb.bin depending on whether a DTB is in use. Here, the copy operation is backwards; u-boot-dt-tegra.bin gets copied from u-boot-tegra.bin (which actually might not contain a DTB if OF_SEPARATE isn't enabled).

Shouldn't the two sets of rules use identical schemes for the dependency chain so it's easy to compare the rules?

#10 lore raw

PATCH v3 4/7 tegra: Always build a boot image with the same filename

In reply to Simon Glass
Quoted 5 lines · Simon Glass

Adjust the Makefile to build u-boot-tegra.bin which contains a device tree if OF_SEPARATE is enabled, and does not if not. This mirrors U-Boot's new approach of using u-boot.bin to handle both cases.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160201/29e72129/attachment.sig>
#11 lore raw

PATCH v3 5/7 socfpga: Simplify Makefile filenames

In reply to Simon Glass

We don't need the -dtb suffix anymore, so drop it.

---

Changes in v3: None
Changes in v2:
- Fix the update_filename in MCV

 Makefile                         | 10 +++++-----
 include/configs/socfpga_mcvevk.h |  2 +-
 scripts/Makefile.spl             |  6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)
Makefile +5 -5
index 74c13f0..b4e75a5 100644
@@ -1010,10 +1010,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
 
@@ -1322,7 +1322,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
include/configs/socfpga_mcvevk.h +1 -1
index e7b5675..f260a64 100644
@@ -56,7 +56,7 @@
 	"netdev=eth0\0"							\
 	"hostname=mcvevk\0"						\
 	"kernel_addr_r=0x10000000\0"					\
-	"update_filename=u-boot-with-spl-dtb.sfp\0"			\
+	"update_filename=u-boot-with-spl.sfp\0"				\
 	"update_sd_offset=0x800\0"					\
 	"update_sd="		/* Update the SD firmware partition */	\
 		"if mmc rescan ; then "					\
scripts/Makefile.spl +3 -3
index bc6a330..f486feb 100644
@@ -142,7 +142,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
@@ -229,8 +229,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
 
Signature · 1 line
2.7.0.rc3.207.g0ac5344
#12 lore raw

PATCH v3 5/7 socfpga: Simplify Makefile filenames

Quoted 3 lines · Simon Glass

We don't need the -dtb suffix anymore, so drop it.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160201/97cfee72/attachment.sig>
#13 lore raw

PATCH v3 6/7 Makefile: Make u-boot.img the same as u-boot-dtb.img

In reply to Simon Glass

Create u-boot.img even when OF_CONTROL is enabled, so that this file can be used in both cases.

---

Changes in v3:
- Rewrite the commit message for clarity

Changes in v2: None

 Makefile | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)
Makefile +3 -10
index b4e75a5..6ddfd20 100644
@@ -901,6 +901,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)
 
@@ -910,17 +912,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
 
@@ -1126,11 +1123,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
Signature · 1 line
2.7.0.rc3.207.g0ac5344
#14 lore raw

PATCH v3 6/7 Makefile: Make u-boot.img the same as u-boot-dtb.img

Quoted 2 lines · Simon Glass

Create u-boot.img even when OF_CONTROL is enabled, so that this file can be used in both cases.

Here also I wonder if it would be better to copy either u-boot-dtb.img or u-boot-nodtb.img to u-boot.img, to avoid running mkimage again?

#15 lore raw

PATCH v3 6/7 Makefile: Make u-boot.img the same as u-boot-dtb.img

Quoted 7 lines · Stephen Warren
Quoted 2 lines · Simon Glass

Create u-boot.img even when OF_CONTROL is enabled, so that this file can be used in both cases.

Here also I wonder if it would be better to copy either u-boot-dtb.img or u-boot-nodtb.img to u-boot.img, to avoid running mkimage again?

Sounds like a good clean-up.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160201/5c39064c/attachment.sig>
#16 lore raw

PATCH v3 6/7 Makefile: Make u-boot.img the same as u-boot-dtb.img

In reply to Simon Glass
Quoted 4 lines · Simon Glass

Create u-boot.img even when OF_CONTROL is enabled, so that this file can be used in both cases.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160201/e214c81b/attachment.sig>
#17 lore raw

PATCH v3 7/7 Makefile: Drop unnecessary -dtb suffixes

In reply to Simon Glass

When OF_CONTROL is enabled, u-boot-dtb.* files are the same as u-boot.* files. So we can use the latter for simplicity.

---

Changes in v3: None
Changes in v2:
- Tweak the tegra rule slightly

 Makefile | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
Makefile +7 -8
index 6ddfd20..4ae6058 100644
@@ -915,7 +915,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
@@ -1056,7 +1056,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
@@ -1067,8 +1067,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
 
@@ -1078,7 +1077,7 @@ u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot-nodtb.bin FORCE
 	$(call if_changed,pad_cat)
 
 OBJCOPYFLAGS_u-boot-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE)
-u-boot-tegra.bin: spl/u-boot-spl u-boot-dtb.bin FORCE
+u-boot-tegra.bin: spl/u-boot-spl u-boot.bin FORCE
 	$(call if_changed,pad_cat)
 
 u-boot-dtb-tegra.bin: u-boot-tegra.bin FORCE
@@ -1089,7 +1088,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
@@ -1099,10 +1098,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)
Signature · 1 line
2.7.0.rc3.207.g0ac5344
#18 lore raw

PATCH v3 7/7 Makefile: Drop unnecessary -dtb suffixes

Quoted 4 lines · Simon Glass

When OF_CONTROL is enabled, u-boot-dtb.* files are the same as u-boot.* files. So we can use the latter for simplicity.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160201/89465bc5/attachment.sig>
#19 lore raw

v3 cover fdt: Replace u-boot-dtb.bin with u-boot.bin

In reply to Simon Glass

Hello Simon,

Nitpicking:

Quoted 5 lines · Simon Glass

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.

Maybe explain in a few words why concatenating the DT no long seems important, so that readers who were intending to concatenate get a hint on what option they should follow instead?

Amicalement,

Signature · 1 line
Albert.
#20 lore raw

v3 cover fdt: Replace u-boot-dtb.bin with u-boot.bin

Hi Albert,

Quoted 13 lines · Albert ARIBAUD

Hello Simon,

Nitpicking:

Quoted 5 lines · Simon Glass

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.

Quoted 3 lines

Maybe explain in a few words why concatenating the DT no long seems important, so that readers who were intending to concatenate get a hint on what option they should follow instead?

I'm not sure what to say here. If people want to concatenate in a build system, then they can use u-boot-nodtb.bin for that. Everything should then work as expected.

Regards,
Simon

#21 lore raw

v3 cover fdt: Replace u-boot-dtb.bin with u-boot.bin

In reply to Simon Glass
Quoted 17 lines · Simon Glass

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 if enabled, 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 to 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.

Quoted 5 lines

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.

The series,
Tested-by: Stephen Warren <swarren at nvidia.com

(Both out T124-and-before and T210-and-later flashing processes still seem to work OK with the new file naming etc.)

Patches 1-3,

#22 lore raw

v3 cover fdt: Replace u-boot-dtb.bin with u-boot.bin

Quoted 24 lines · Stephen Warren
Quoted 17 lines · Simon Glass

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 if enabled, 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 to 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.

Quoted 5 lines

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.

Quoted 8 lines

The series,

(Both out T124-and-before and T210-and-later flashing processes still seem to work OK with the new file naming etc.)

Patches 1-3,

I've pushed this since I want -rc1 to have it (so everyone sees it and adjusts now on a clean tag) and the feedback seems like minor updates that we can do after the fact. Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160201/0e90bd19/attachment.sig>