diff mbox series

boot/uboot: fix uboot build failure with UBOOT_CUSTOM_DTS_PATH on uboot version >= 2020.x

Message ID 20210209201303.195093-1-giulio.benetti@benettiengineering.com
State New
Headers show
Series boot/uboot: fix uboot build failure with UBOOT_CUSTOM_DTS_PATH on uboot version >= 2020.x | expand

Commit Message

Giulio Benetti Feb. 9, 2021, 8:13 p.m. UTC
Starting from version 2020.x uboot can't build .dts files not listed in
dts/Makefile leading to a build failure when trying to pass a .dts file to
UBOOT_CUSTOM_DTS_PATH. So let's prepend that file(s) to dts/Makefile if
UBOOT_CUSTOM_DTS_PATH is used.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 boot/uboot/uboot.mk | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Giulio Benetti March 27, 2021, 10:33 p.m. UTC | #1
Hi All,

On 2/9/21 9:13 PM, Giulio Benetti wrote:
> Starting from version 2020.x uboot can't build .dts files not listed in
> dts/Makefile leading to a build failure when trying to pass a .dts file to
> UBOOT_CUSTOM_DTS_PATH. So let's prepend that file(s) to dts/Makefile if
> UBOOT_CUSTOM_DTS_PATH is used.
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---
>   boot/uboot/uboot.mk | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
> index 2478a2a1e9..a5ad101d68 100644
> --- a/boot/uboot/uboot.mk
> +++ b/boot/uboot/uboot.mk
> @@ -303,6 +303,11 @@ endif # BR2_TARGET_UBOOT_BUILD_SYSTEM_LEGACY
>   UBOOT_CUSTOM_DTS_PATH = $(call qstrip,$(BR2_TARGET_UBOOT_CUSTOM_DTS_PATH))
>   
>   define UBOOT_BUILD_CMDS
> +	$(if $(UBOOT_CUSTOM_DTS_PATH),
> +		$(Q)$(SED) \
> +		'1s;^;dtb-y += $(subst .dts,.dtb,$(call notdir,$(UBOOT_CUSTOM_DTS_PATH)))\n;' \
> +		$(@D)/arch/$(UBOOT_ARCH)/dts/Makefile
> +	)
>   	$(if $(UBOOT_CUSTOM_DTS_PATH),
>   		cp -f $(UBOOT_CUSTOM_DTS_PATH) $(@D)/arch/$(UBOOT_ARCH)/dts/
>   	)
> 

Any new about this patch? It's essential to build an external u-boot dts 
after u-boot 2020.x

Kind regards
diff mbox series

Patch

diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index 2478a2a1e9..a5ad101d68 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -303,6 +303,11 @@  endif # BR2_TARGET_UBOOT_BUILD_SYSTEM_LEGACY
 UBOOT_CUSTOM_DTS_PATH = $(call qstrip,$(BR2_TARGET_UBOOT_CUSTOM_DTS_PATH))
 
 define UBOOT_BUILD_CMDS
+	$(if $(UBOOT_CUSTOM_DTS_PATH),
+		$(Q)$(SED) \
+		'1s;^;dtb-y += $(subst .dts,.dtb,$(call notdir,$(UBOOT_CUSTOM_DTS_PATH)))\n;' \
+		$(@D)/arch/$(UBOOT_ARCH)/dts/Makefile
+	)
 	$(if $(UBOOT_CUSTOM_DTS_PATH),
 		cp -f $(UBOOT_CUSTOM_DTS_PATH) $(@D)/arch/$(UBOOT_ARCH)/dts/
 	)