Skip to content

Commit 1b4f9e2

Browse files
committed
nios2: use common rules to build built-in dtb
Using the common build support for built-in dtb files just requires adding a .dtb.o target to obj-y. This has the side effect that CONFIG_NIOS2_DTB_SOURCE should now be just the dts filename in arch/nios2/boot/dts/ directory. Before any path was supported, but if you want to build in your dtb to the kernel, it should be in the kernel tree. Cc: Ley Foon Tan <lftan@altera.com> Cc: nios2-dev@lists.rocketboards.org Signed-off-by: Rob Herring <robh@kernel.org>
1 parent 1188648 commit 1b4f9e2

File tree

4 files changed

+4
-37
lines changed

4 files changed

+4
-37
lines changed

arch/nios2/Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,14 @@ BOOT_TARGETS = vmImage zImage
4949
PHONY += $(BOOT_TARGETS) install
5050
KBUILD_IMAGE := $(nios2-boot)/vmImage
5151

52-
ifneq ($(CONFIG_NIOS2_DTB_SOURCE),"")
53-
core-y += $(nios2-boot)/
54-
endif
52+
core-y += $(nios2-boot)/dts/
5553

5654
all: vmImage
5755

5856
archclean:
5957
$(Q)$(MAKE) $(clean)=$(nios2-boot)
6058

61-
%.dtb: | scripts
59+
%.dtb %.dtb.S %.dtb.o: | scripts
6260
$(Q)$(MAKE) $(build)=$(nios2-boot)/dts $(nios2-boot)/dts/$@
6361

6462
dtbs:

arch/nios2/boot/Makefile

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,6 @@ $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
3131
$(obj)/compressed/vmlinux: $(obj)/vmlinux.gz FORCE
3232
$(Q)$(MAKE) $(build)=$(obj)/compressed $@
3333

34-
# Rule to build device tree blobs
35-
DTB_SRC := $(patsubst "%",%,$(CONFIG_NIOS2_DTB_SOURCE))
36-
37-
# Make sure the generated dtb gets removed during clean
38-
extra-$(CONFIG_NIOS2_DTB_SOURCE_BOOL) += system.dtb
39-
40-
$(obj)/system.dtb: $(DTB_SRC) FORCE
41-
$(call cmd,dtc)
42-
43-
# Ensure system.dtb exists
44-
$(obj)/linked_dtb.o: $(obj)/system.dtb
45-
46-
obj-$(CONFIG_NIOS2_DTB_SOURCE_BOOL) += linked_dtb.o
47-
4834
targets += $(dtb-y)
4935

5036
$(obj)/dtbs: $(addprefix $(obj)/, $(dtb-y))

arch/nios2/boot/dts/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
# SPDX-License-Identifier: GPL-2.0
2+
3+
obj-y := $(patsubst "%.dts",%.dtb.o,$(CONFIG_NIOS2_DTB_SOURCE))

arch/nios2/boot/linked_dtb.S

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)