Add out-of-source U-Boot device tree support
authorJames Balean <james@balean.com.au>
Wed, 5 Apr 2017 03:45:51 +0000 (22:45 -0500)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Wed, 5 Apr 2017 20:29:23 +0000 (22:29 +0200)
Similaly to Linux, this patch adds the ability to copy in and build
out-of-source device tree sources during a U-Boot build.

Signed-off-by: James Balean <james@balean.com.au>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
boot/uboot/Config.in
boot/uboot/uboot.mk

index c33861bac61645f36e5ce1c9cca0eb1ef5b7bf37..004f9c0ff049c00a4c9613b3fc50a0a4af318036 100644 (file)
@@ -407,4 +407,18 @@ config BR2_TARGET_UBOOT_ENVIMAGE_REDUNDANT
 
 endif # BR2_TARGET_UBOOT_ENVIMAGE
 
+if BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG
+
+config BR2_TARGET_UBOOT_CUSTOM_DTS_PATH
+       string "Device Tree Source file paths"
+       help
+         Space-separated list of paths to device tree source files
+         that will be copied to arch/ARCH/dts/ before starting the
+         build.
+
+         To use this device tree source file, the U-Boot configuration
+         file must refer to it.
+
+endif
+
 endif # BR2_TARGET_UBOOT
index aac692c47f150fade09004085cf73017231b025c..1d464d9675c477285fc57e507246d39bdff6fc82 100644 (file)
@@ -195,6 +195,9 @@ endef
 endif # BR2_TARGET_UBOOT_BUILD_SYSTEM_LEGACY
 
 define UBOOT_BUILD_CMDS
+       $(if $(BR2_TARGET_UBOOT_CUSTOM_DTS_PATH),
+               cp -f $(call qstrip,$(BR2_TARGET_UBOOT_CUSTOM_DTS_PATH)) $(@D)/arch/$(UBOOT_ARCH)/dts/
+       )
        $(TARGET_CONFIGURE_OPTS)        \
                $(MAKE) -C $(@D) $(UBOOT_MAKE_OPTS)             \
                $(UBOOT_MAKE_TARGET)