aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSumit Garg <sumit.garg@linaro.org>2024-02-02 18:35:28 +0530
committerTom Rini <trini@konsulko.com>2024-02-02 12:55:53 -0500
commitb1ae2c6217e6ad11b006cd9d7d6dc4306b432d71 (patch)
tree47805726d66a36355a8554f50814fa501aa909da
parent3cca73d96e5d9c6974adddb07623c873fbde00a2 (diff)
downloadu-boot-b1ae2c6217e6ad11b006cd9d7d6dc4306b432d71.zip
u-boot-b1ae2c6217e6ad11b006cd9d7d6dc4306b432d71.tar.gz
u-boot-b1ae2c6217e6ad11b006cd9d7d6dc4306b432d71.tar.bz2
dts: Add alternative location for upstream DTB builds
Allow platform owners to mirror devicetree files from devitree-rebasing directory into dts/upstream/src/$(ARCH) (special case for arm64). Then build then along with any *-u-boot.dtsi file present in arch/$(ARCH)/dts directory. Also add a new Makefile for arm64. This will help easy migration for platforms which currently are compliant with upstream Linux kernel devicetree files. Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
-rw-r--r--dts/Kconfig16
-rw-r--r--dts/Makefile17
-rw-r--r--dts/upstream/src/arm64/Makefile14
3 files changed, 44 insertions, 3 deletions
diff --git a/dts/Kconfig b/dts/Kconfig
index 00c0aef..09789d3 100644
--- a/dts/Kconfig
+++ b/dts/Kconfig
@@ -85,6 +85,22 @@ config OF_LIVE
enables a live tree which is available after relocation,
and can be adjusted as needed.
+config OF_UPSTREAM
+ bool "Enable use of devicetree imported from Linux kernel release"
+ help
+ Traditionally, U-Boot platforms used to have their custom devicetree
+ files or copy devicetree files from Linux kernel which are hard to
+ maintain and can usually get out-of-sync from Linux kernel. This
+ option enables platforms to migrate to devicetree-rebasing repo where
+ a regular sync will be maintained every major Linux kernel release
+ cycle. However, platforms can still have some custom u-boot specific
+ bits maintained as part of *-u-boot.dtsi files.
+
+ Note: This option should be set in Kconfig, for the SoC as a whole.
+ However, newer boards whose devicetree source files haven't landed in
+ the dts/upstream subtree, they can override this option to have the
+ DT build from existing U-Boot tree location instead.
+
choice
prompt "Provider of DTB for DT control"
depends on OF_CONTROL
diff --git a/dts/Makefile b/dts/Makefile
index 3437e54..d6c2c9d 100644
--- a/dts/Makefile
+++ b/dts/Makefile
@@ -10,10 +10,20 @@ ifeq ($(DEVICE_TREE),)
DEVICE_TREE := unset
endif
+ifeq ($(CONFIG_OF_UPSTREAM),y)
+ifeq ($(CONFIG_ARM64),y)
+dt_dir := dts/upstream/src/arm64
+else
+dt_dir := dts/upstream/src/$(ARCH)
+endif
+else
+dt_dir := arch/$(ARCH)/dts
+endif
+
ifneq ($(EXT_DTB),)
DTB := $(EXT_DTB)
else
-DTB := arch/$(ARCH)/dts/$(DEVICE_TREE).dtb
+DTB := $(dt_dir)/$(DEVICE_TREE).dtb
endif
$(obj)/dt-$(SPL_NAME).dtb: dts/dt.dtb $(objtree)/tools/fdtgrep FORCE
@@ -41,7 +51,7 @@ $(DTB): arch-dtbs
PHONY += arch-dtbs
arch-dtbs:
- $(Q)$(MAKE) $(build)=arch/$(ARCH)/dts dtbs
+ $(Q)$(MAKE) $(build)=$(dt_dir) dtbs
ifeq ($(CONFIG_SPL_BUILD),y)
obj-$(CONFIG_OF_EMBED) := dt-spl.dtb.o
@@ -65,4 +75,5 @@ clean-files := dt.dtb.S
# Let clean descend into dts directories
subdir- += ../arch/arc/dts ../arch/arm/dts ../arch/m68k/dts ../arch/microblaze/dts \
../arch/mips/dts ../arch/nios2/dts ../arch/powerpc/dts ../arch/riscv/dts \
- ../arch/sandbox/dts ../arch/sh/dts ../arch/x86/dts ../arch/xtensa/dts
+ ../arch/sandbox/dts ../arch/sh/dts ../arch/x86/dts ../arch/xtensa/dts \
+ ./upstream/src/arm64 ./upstream/src/$(ARCH)
diff --git a/dts/upstream/src/arm64/Makefile b/dts/upstream/src/arm64/Makefile
new file mode 100644
index 0000000..9a8f6aa
--- /dev/null
+++ b/dts/upstream/src/arm64/Makefile
@@ -0,0 +1,14 @@
+# SPDX-License-Identifier: GPL-2.0+
+
+include $(srctree)/scripts/Makefile.dts
+
+targets += $(dtb-y)
+
+# Add any required device tree compiler flags here
+DTC_FLAGS += -a 0x8
+
+PHONY += dtbs
+dtbs: $(addprefix $(obj)/, $(dtb-y))
+ @:
+
+clean-files := */*.dtb */*.dtbo