Skip to contentSkip to conversation

kbuild: Do not append dtb for OF_EMBED case

PATCH Superseded Michal Simek 3 participants 3 messages Apr 27, 2016 – Apr 28, 2016 Kbuild

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: Do not append dtb for OF_EMBED case

dtb is already included in binary that's why there is no need to replace u-boot-spl.bin with u-boot-spl-dtb.bin. This is only needed for OF_SEPARATE is enabled. Only copy -nodtb.bin version which is straight output from objcopy -O binary.

---

 scripts/Makefile.spl | 5 +++++
 1 file changed, 5 insertions(+)
scripts/Makefile.spl +5 -0
index 44242842db31..79c680c1d62f 100644
@@ -170,12 +170,17 @@ $(obj)/$(SPL_BIN)-dtb.bin: $(obj)/$(SPL_BIN)-nodtb.bin $(obj)/$(SPL_BIN)-pad.bin
 		$(obj)/$(SPL_BIN).dtb FORCE
 	$(call if_changed,cat)
 
+ifeq ($(CONFIG_OF_SEPARATE),y)
 $(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
+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)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 kbuild: Do not append dtb for OF_EMBED case

Hi Michal,
(+cc Simon)

2016-04-27 21:28 GMT+09:00 Michal Simek <[email protected]>:

Quoted 4 lines

dtb is already included in binary that's why there is no need to replace u-boot-spl.bin with u-boot-spl-dtb.bin. This is only needed for OF_SEPARATE is enabled. Only copy -nodtb.bin version which is straight output from objcopy -O binary.

Correct.

(But, as you know, fdtgrep does not work for OF_EMBED, so this is only useful when SPL has enough memory footprint.)

Quoted 18 lines

---

 scripts/Makefile.spl | 5 +++++
 1 file changed, 5 insertions(+)
scripts/Makefile.spl +1 -0
index 44242842db31..79c680c1d62f 100644
@@ -170,12 +170,17 @@ $(obj)/$(SPL_BIN)-dtb.bin: $(obj)/$(SPL_BIN)-nodtb.bin $(obj)/$(SPL_BIN)-pad.bin
                $(obj)/$(SPL_BIN).dtb FORCE
        $(call if_changed,cat)
 
+ifeq ($(CONFIG_OF_SEPARATE),y)
 $(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN)-dtb.bin FORCE
        $(call if_changed,copy)
 else

scripts/Makefile.spl $(obj)/$(SPL_BIN)-dtb.bin: $(obj)/$(SPL_BIN)-nodtb.bin $(obj)/$(SPL_BIN)-pad.bin · line 186

Quoted 10 lines
scripts/Makefile.spl +4 -0
 $(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN)-nodtb.bin FORCE
        $(call if_changed,copy)
 endif
+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)

The code is duplicated for
- CONFIG_SPL_OF_CONTROL=y && CONFIG_OF_SEPARATE=n
- CONFIG_SPL_OF_CONTROL=n

Could you refactor a bit like follows?

ifeq ($(CONFIG_SPL_OF_CONTROL)$(CONFIG_OF_SEPARATE),yy) $(obj)/$(SPL_BIN)-dtb.bin: $(obj)/$(SPL_BIN)-nodtb.bin

$(obj)/$(SPL_BIN)-pad.bin \
                          $(obj)/$(SPL_BIN).dtb FORCE
        $(call if_changed,cat)

$(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

Signature · 2 lines
Best Regards
Masahiro Yamada
#2 lore raw

PATCH 1/1 kbuild: Do not append dtb for OF_EMBED case

Hi Masahiro,

Quoted 9 lines · Masahiro Yamada

Hi Michal,
(+cc Simon)

2016-04-27 21:28 GMT+09:00 Michal Simek <[email protected]>:

Quoted 4 lines

dtb is already included in binary that's why there is no need to replace u-boot-spl.bin with u-boot-spl-dtb.bin. This is only needed for OF_SEPARATE is enabled. Only copy -nodtb.bin version which is straight output from objcopy -O binary.

Quoted 4 lines

Correct.

(But, as you know, fdtgrep does not work for OF_EMBED, so this is only useful when SPL has enough memory footprint.)

That's fine and it is reasonable limitation.

Quoted 35 lines
Quoted 18 lines

---

 scripts/Makefile.spl | 5 +++++
 1 file changed, 5 insertions(+)
scripts/Makefile.spl +1 -0
index 44242842db31..79c680c1d62f 100644
@@ -170,12 +170,17 @@ $(obj)/$(SPL_BIN)-dtb.bin: $(obj)/$(SPL_BIN)-nodtb.bin $(obj)/$(SPL_BIN)-pad.bin
                $(obj)/$(SPL_BIN).dtb FORCE
        $(call if_changed,cat)
 
+ifeq ($(CONFIG_OF_SEPARATE),y)
 $(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN)-dtb.bin FORCE
        $(call if_changed,copy)
 else

scripts/Makefile.spl $(obj)/$(SPL_BIN)-dtb.bin: $(obj)/$(SPL_BIN)-nodtb.bin $(obj)/$(SPL_BIN)-pad.bin · line 186

Quoted 10 lines
scripts/Makefile.spl +4 -0
 $(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN)-nodtb.bin FORCE
        $(call if_changed,copy)
 endif
+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)

The code is duplicated for
- CONFIG_SPL_OF_CONTROL=y && CONFIG_OF_SEPARATE=n
- CONFIG_SPL_OF_CONTROL=n

Quoted 1 line

Could you refactor a bit like follows?

TBH: I was expecting that there will be better solution for it.

Quoted 8 lines

ifeq ($(CONFIG_SPL_OF_CONTROL)$(CONFIG_OF_SEPARATE),yy) $(obj)/$(SPL_BIN)-dtb.bin: $(obj)/$(SPL_BIN)-nodtb.bin

$(obj)/$(SPL_BIN)-pad.bin \
                          $(obj)/$(SPL_BIN).dtb FORCE
        $(call if_changed,cat)
Quoted 7 lines

$(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

Let me retest and send v2.

Thanks,
Michal

Signature · 15 lines
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160428/d0066baf/attachment.sig>