diff mbox series

[U-Boot,RFC,02/11] Makefile: support building SPL FIT images without device trees

Message ID 20190721180002.26993-3-lukas.auer@aisec.fraunhofer.de
State RFC
Delegated to: Andes
Headers show
Series SPL support for RISC-V | expand

Commit Message

Lukas Auer July 21, 2019, 5:59 p.m. UTC
When building a U-Boot FIT image, the device trees specified by the
board are unconditionally built for inclusion in the FIT image. However,
not all device tree providers, such as CONFIG_OF_PRIOR_STAGE, require a
device tree to be built and bundled with the U-Boot binary. They rely on
other mechanisms to provide the device tree to U-Boot. Compilation on
boards with these device tree providers fails, because they do not
specify a device tree.

Change the makefile rules to conditionally build the device trees if
either CONFIG_OF_SEPARATE or CONFIG_OF_EMBED is selected as device tree
provider.

Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
---

 Makefile | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Bin Meng July 23, 2019, 8:32 a.m. UTC | #1
On Mon, Jul 22, 2019 at 2:00 AM Lukas Auer
<lukas.auer@aisec.fraunhofer.de> wrote:
>
> When building a U-Boot FIT image, the device trees specified by the
> board are unconditionally built for inclusion in the FIT image. However,
> not all device tree providers, such as CONFIG_OF_PRIOR_STAGE, require a
> device tree to be built and bundled with the U-Boot binary. They rely on
> other mechanisms to provide the device tree to U-Boot. Compilation on
> boards with these device tree providers fails, because they do not
> specify a device tree.
>
> Change the makefile rules to conditionally build the device trees if
> either CONFIG_OF_SEPARATE or CONFIG_OF_EMBED is selected as device tree
> provider.
>
> Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
> ---
>
>  Makefile | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 73fdf70cdd..23f4a73b7a 100644
--- a/Makefile
+++ b/Makefile
@@ -1263,7 +1263,9 @@  MKIMAGEFLAGS_u-boot.pbl = -n $(srctree)/$(CONFIG_SYS_FSL_PBL_RCW:"%"=%) \
 		-R $(srctree)/$(CONFIG_SYS_FSL_PBL_PBI:"%"=%) -T pblimage
 
 u-boot-dtb.img u-boot.img u-boot.kwb u-boot.pbl u-boot-ivt.img: \
-		$(if $(CONFIG_SPL_LOAD_FIT),u-boot-nodtb.bin dts/dt.dtb,u-boot.bin) FORCE
+		$(if $(CONFIG_SPL_LOAD_FIT),u-boot-nodtb.bin \
+			$(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED),dts/dt.dtb) \
+		,u-boot.bin) FORCE
 	$(call if_changed,mkimage)
 	$(BOARD_SIZE_CHECK)
 
@@ -1273,7 +1275,9 @@  else
 MKIMAGEFLAGS_u-boot.itb = -E
 endif
 
-u-boot.itb: u-boot-nodtb.bin dts/dt.dtb $(U_BOOT_ITS) FORCE
+u-boot.itb: u-boot-nodtb.bin \
+		$(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED),dts/dt.dtb) \
+		$(U_BOOT_ITS) FORCE
 	$(call if_changed,mkfitimage)
 	$(BOARD_SIZE_CHECK)