When building for a custom board, it is quite common to maintain a
private branch which include some defconfig and .dts files. But to
hook up those .dts files requires modifying a file "belonging" to
upstream U-Boot, the arch/*/dts/Makefile. Forward-porting that branch
to a newer upstream then often results in a conflict which, while it
is trivial to resolve by hand, makes it harder to have a CI do "try to
build our board against latest upstream".
The .config usually includes information on precisely what .dtb(s) are
needed, so to avoid having to modify the Makefile, simply add the
files in (SPL_)OF_LIST to dtb-y.
A technicality is that (SPL_)OF_LIST is not always defined, so rework
the Kconfig symbols so that (SPL_)OF_LIST is always defined (when
(SPL_)OF_CONTROL), but only prompted for in the cases which used to be
their "depends on".
nios2 and microblaze already have something like this in their
dts/Makefile, and the rationale in commit
41f59f68539 is similar to
the above. So this simply generalizes existing practice. Followup
patches could remove the logic in those two makefiles, just as there's
potential for moving some common boilerplate from all the
arch/*/dts/Makefile files to the new scripts/Makefile.dts.
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
dtb-$(CONFIG_TARGET_HSDK) += hsdk.dtb hsdk-4xd.dtb
dtb-$(CONFIG_TARGET_IOT_DEVKIT) += iot_devkit.dtb
+include $(srctree)/scripts/Makefile.dts
+
targets += $(dtb-y)
DTC_FLAGS += -R 4 -p 0x1000
dtb-$(CONFIG_ARCH_QEMU) += qemu-arm.dtb qemu-arm64.dtb
+include $(srctree)/scripts/Makefile.dts
+
targets += $(dtb-y)
# Add any required device tree compiler flags here
dtb-$(CONFIG_TARGET_AMCORE) += amcore.dtb
dtb-$(CONFIG_TARGET_STMARK2) += stmark2.dtb
+include $(srctree)/scripts/Makefile.dts
+
targets += $(dtb-y)
DTC_FLAGS += -R 4 -p 0x1000
dtb-y += $(shell echo $(CONFIG_DEFAULT_DEVICE_TREE)).dtb
+include $(srctree)/scripts/Makefile.dts
+
targets += $(dtb-y)
DTC_FLAGS += -R 4 -p 0x1000
dtb-$(CONFIG_SOC_SERVALT) += servalt_pcb116.dtb
dtb-$(CONFIG_SOC_SERVAL) += serval_pcb105.dtb serval_pcb106.dtb
+include $(srctree)/scripts/Makefile.dts
+
targets += $(dtb-y)
# Add any required device tree compiler flags here
dtb-$(CONFIG_TARGET_ADP_AG101P) += ag101p.dtb
dtb-$(CONFIG_TARGET_ADP_AE3XX) += ae3xx.dtb
+include $(srctree)/scripts/Makefile.dts
+
targets += $(dtb-y)
DTC_FLAGS += -R 4 -p 0x1000
dtb-y += $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%).dtb
+include $(srctree)/scripts/Makefile.dts
+
targets += $(dtb-y)
DTC_FLAGS += -R 4 -p 0x1000
dtb-$(CONFIG_TARGET_MCR3000) += mcr3000.dtb
dtb-$(CONFIG_TARGET_GAZERBEAM) += gazerbeam.dtb
+include $(srctree)/scripts/Makefile.dts
+
targets += $(dtb-y)
# Add any required device tree compiler flags here
dtb-$(CONFIG_TARGET_SIFIVE_UNMATCHED) += hifive-unmatched-a00.dtb
dtb-$(CONFIG_TARGET_SIPEED_MAIX) += k210-maix-bit.dtb
+include $(srctree)/scripts/Makefile.dts
+
targets += $(dtb-y)
DTC_FLAGS += -R 4 -p 0x1000
dtb-$(CONFIG_UT_DM) += test.dtb
dtb-$(CONFIG_CMD_EXTENSION) += overlay0.dtbo overlay1.dtbo
+include $(srctree)/scripts/Makefile.dts
+
targets += $(dtb-y)
DTC_FLAGS += -R 4 -p 0x1000
dtb-y += sh7751-r2dplus.dtb
+include $(srctree)/scripts/Makefile.dts
+
targets += $(dtb-y)
# Add any required device tree compiler flags here
slimbootloader.dtb \
baytrail_som-db5800-som-6867.dtb
+include $(srctree)/scripts/Makefile.dts
+
targets += $(dtb-y)
DTC_FLAGS += -R 4 -p $(if $(CONFIG_EFI_APP),0x8000,0x1000)
dtb-$(CONFIG_XTFPGA) += ml605.dtb ml605_nommu.dtb kc705.dtb kc705_nommu.dtb
+include $(srctree)/scripts/Makefile.dts
+
targets += $(dtb-y)
DTC_FLAGS +=
.dtsi files that will also be used.
config OF_LIST
- string "List of device tree files to include for DT control"
- depends on SPL_LOAD_FIT || MULTI_DTB_FIT
+ string "List of device tree files to include for DT control" if SPL_LOAD_FIT || MULTI_DTB_FIT
+ depends on OF_CONTROL
default DEFAULT_DEVICE_TREE
help
This option specifies a list of device tree files to use for DT
capabilities, pad configurations).
config SPL_OF_LIST
- string "List of device tree files to include for DT control in SPL"
- depends on SPL_MULTI_DTB_FIT
+ string "List of device tree files to include for DT control in SPL" if SPL_MULTI_DTB_FIT
+ depends on SPL_OF_CONTROL
default OF_LIST
help
This option specifies a list of device tree files to use for DT
--- /dev/null
+# SPDX-License-Identifier: GPL-2.0+
+
+dtb-y += $(patsubst %,%.dtb,$(subst ",,$(CONFIG_$(SPL_)OF_LIST)))