Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -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:
+0 −14
Original line number Diff line number Diff line
@@ -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))
+2 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0

obj-y := $(patsubst "%.dts",%.dtb.o,$(CONFIG_NIOS2_DTB_SOURCE))

arch/nios2/boot/linked_dtb.S

deleted100644 → 0
+0 −19
Original line number Diff line number Diff line
/*
 * 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"