boot/uboot: add option to pass custom variables to U-Boot build
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>
Fri, 26 Apr 2019 15:19:46 +0000 (17:19 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Sat, 3 Aug 2019 17:21:32 +0000 (19:21 +0200)
U-Boot supports a number of environment variables to pass specific
information. The following patches were submitted in the past to one
some specific Config.in option to pass some of these variables:

 - http://patchwork.ozlabs.org/patch/881197/ proposed an option to
   pass a custom EXT_DTB= variable

 - http://patchwork.ozlabs.org/patch/1018245/ proposed an option to
   pass a custom DEVICE_TREE= variable

Instead of adding one Config.in option for each of those variables,
let's provide a generic mechanism to pass arbitrary variables during
U-Boot build step.

Cc: Konstantin Porotchkin <kostap@marvell.com>
Cc: Clemens Gruber <clemens.gruber@pqgruber.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
boot/uboot/Config.in
boot/uboot/uboot.mk

index 993979f27361694b6804d6fc59f322d665519472..f64df5029351c0c55e613068f714de811c62c3f5 100644 (file)
@@ -552,4 +552,10 @@ config BR2_TARGET_UBOOT_CUSTOM_DTS_PATH
 
 endif
 
+config BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS
+       string "Custom make options"
+       help
+         List of custom make options passed at build time. Can be
+         used for example to pass a DEVICE_TREE= value.
+
 endif # BR2_TARGET_UBOOT
index 0a8856d7db616020aac46a316fda7b74bb05ac8b..4ea2b967cfe904aab78842a351266535d8252786 100644 (file)
@@ -133,7 +133,8 @@ UBOOT_MAKE_OPTS += \
        CROSS_COMPILE="$(TARGET_CROSS)" \
        ARCH=$(UBOOT_ARCH) \
        HOSTCC="$(HOSTCC) $(subst -I/,-isystem /,$(subst -I /,-isystem /,$(HOST_CFLAGS)))" \
-       HOSTLDFLAGS="$(HOST_LDFLAGS)"
+       HOSTLDFLAGS="$(HOST_LDFLAGS)" \
+       $(call qstrip,$(BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS))
 
 ifeq ($(BR2_TARGET_UBOOT_NEEDS_ATF_BL31),y)
 UBOOT_DEPENDENCIES += arm-trusted-firmware