Commit 1b4f9e2b authored by Rob Herring's avatar Rob Herring

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: default avatarRob Herring <robh@kernel.org>
parent 11886486
...@@ -49,16 +49,14 @@ BOOT_TARGETS = vmImage zImage ...@@ -49,16 +49,14 @@ BOOT_TARGETS = vmImage zImage
PHONY += $(BOOT_TARGETS) install PHONY += $(BOOT_TARGETS) install
KBUILD_IMAGE := $(nios2-boot)/vmImage KBUILD_IMAGE := $(nios2-boot)/vmImage
ifneq ($(CONFIG_NIOS2_DTB_SOURCE),"") core-y += $(nios2-boot)/dts/
core-y += $(nios2-boot)/
endif
all: vmImage all: vmImage
archclean: archclean:
$(Q)$(MAKE) $(clean)=$(nios2-boot) $(Q)$(MAKE) $(clean)=$(nios2-boot)
%.dtb: | scripts %.dtb %.dtb.S %.dtb.o: | scripts
$(Q)$(MAKE) $(build)=$(nios2-boot)/dts $(nios2-boot)/dts/$@ $(Q)$(MAKE) $(build)=$(nios2-boot)/dts $(nios2-boot)/dts/$@
dtbs: dtbs:
......
...@@ -31,20 +31,6 @@ $(obj)/zImage: $(obj)/compressed/vmlinux FORCE ...@@ -31,20 +31,6 @@ $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
$(obj)/compressed/vmlinux: $(obj)/vmlinux.gz FORCE $(obj)/compressed/vmlinux: $(obj)/vmlinux.gz FORCE
$(Q)$(MAKE) $(build)=$(obj)/compressed $@ $(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) targets += $(dtb-y)
$(obj)/dtbs: $(addprefix $(obj)/, $(dtb-y)) $(obj)/dtbs: $(addprefix $(obj)/, $(dtb-y))
......
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
obj-y := $(patsubst "%.dts",%.dtb.o,$(CONFIG_NIOS2_DTB_SOURCE))
/*
* Copyright (C) 2011 Thomas Chou <thomas@wytron.com.tw>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
.section .dtb.init.rodata,"a"
.incbin "arch/nios2/boot/system.dtb"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment