Skip to content

Commit

Permalink
nios2: use common rules to build built-in dtb
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rob Herring committed Oct 2, 2018
1 parent 1188648 commit 1b4f9e2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 37 deletions.
6 changes: 2 additions & 4 deletions arch/nios2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,14 @@ BOOT_TARGETS = vmImage zImage
PHONY += $(BOOT_TARGETS) install
KBUILD_IMAGE := $(nios2-boot)/vmImage

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

all: vmImage

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

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

dtbs:
Expand Down
14 changes: 0 additions & 14 deletions arch/nios2/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,6 @@ $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
$(obj)/compressed/vmlinux: $(obj)/vmlinux.gz FORCE
$(Q)$(MAKE) $(build)=$(obj)/compressed $@

# Rule to build device tree blobs
DTB_SRC := $(patsubst "%",%,$(CONFIG_NIOS2_DTB_SOURCE))

# Make sure the generated dtb gets removed during clean
extra-$(CONFIG_NIOS2_DTB_SOURCE_BOOL) += system.dtb

$(obj)/system.dtb: $(DTB_SRC) FORCE
$(call cmd,dtc)

# Ensure system.dtb exists
$(obj)/linked_dtb.o: $(obj)/system.dtb

obj-$(CONFIG_NIOS2_DTB_SOURCE_BOOL) += linked_dtb.o

targets += $(dtb-y)

$(obj)/dtbs: $(addprefix $(obj)/, $(dtb-y))
Expand Down
2 changes: 2 additions & 0 deletions arch/nios2/boot/dts/Makefile
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# SPDX-License-Identifier: GPL-2.0

obj-y := $(patsubst "%.dts",%.dtb.o,$(CONFIG_NIOS2_DTB_SOURCE))
19 changes: 0 additions & 19 deletions arch/nios2/boot/linked_dtb.S

This file was deleted.

0 comments on commit 1b4f9e2

Please sign in to comment.