of_list_dirs := $(dir $(EXT_DTB))
else
of_list := $(CONFIG_OF_LIST)
+ifneq ($(CONFIG_OF_UPSTREAM_INCLUDE_LOCAL_FALLBACK_DTBOS),)
+of_list_dirs := $(dt_dir) arch/$(ARCH)/dts
+else
of_list_dirs := $(dt_dir)
+endif
default_dt := $(if $(DEVICE_TREE),$(DEVICE_TREE),$(CONFIG_DEFAULT_DEVICE_TREE))
endif
help
Select the vendor to build all devicetree files for.
+config OF_UPSTREAM_INCLUDE_LOCAL_FALLBACK_DTBOS
+ bool "Build local DTBOs as fallback for DTBOs missing upstream"
+ default n
+ depends on OF_UPSTREAM
+ help
+ Enable building DTBOs from arch/$(ARCH)/dts as a fallback for
+ DTBOs which are not part of Linux kernel upstream yet. This is
+ a stopgap measure to expedite OF_UPSTREAM switch for platforms
+ which already have main DT in Linux kernel upstream, but still
+ have leftover DTBOs in U-Boot tree.
+
+ Do not use this option, upstream your DTs and DTBOs instead.
+ If the upstreaming is in progress, use with utmost caution.
+
+ If unsure, say N.
+
choice
prompt "Provider of DTB for DT control"
depends on OF_CONTROL
dt_dir := arch/$(ARCH)/dts
endif
+ifneq ($(CONFIG_OF_UPSTREAM_INCLUDE_LOCAL_FALLBACK_DTBOS),)
+local_dtbos := local-dtbos
+else
+local_dtbos :=
+endif
+
ifneq ($(EXT_DTB),)
DTB := $(EXT_DTB)
else
targets += dt.dtb
-$(DTB): arch-dtbs
+$(DTB): arch-dtbs $(local_dtbos)
$(Q)test -e $@ || ( \
echo >&2; \
echo >&2 "Device Tree Source ($@) is not correctly specified."; \
arch-dtbs:
$(Q)$(MAKE) $(build)=$(dt_dir) dtbs
+ifneq ($(CONFIG_OF_UPSTREAM_INCLUDE_LOCAL_FALLBACK_DTBOS),)
+PHONY += local-dtbos
+local-dtbos:
+ $(Q)$(MAKE) $(build)=arch/$(ARCH)/dts dtbos
+endif
+
ifeq ($(CONFIG_XPL_BUILD),y)
obj-$(CONFIG_OF_EMBED) := dt-spl.dtb.o
# support "out-of-tree" build for dtb-spl
dtbs: $(addprefix $(obj)/, $(dtb-y))
@:
+ifneq ($(CONFIG_OF_UPSTREAM_INCLUDE_LOCAL_FALLBACK_DTBOS),)
+PHONY += dtbos
+dtbos: $(addprefix $(obj)/, $(filter-out %.dtb,$(dtb-y)))
+ @:
+endif
+
clean-files := *.dtb *.dtbo */*.dtb */*.dtbo *_HS