MIPS: Create common infrastructure for building built-in device-trees
authorAndrew Bresticker <abrestic@chromium.org>
Thu, 21 Aug 2014 20:04:20 +0000 (13:04 -0700)
committerRalf Baechle <ralf@linux-mips.org>
Mon, 22 Sep 2014 11:35:49 +0000 (13:35 +0200)
In preparation for moving the device-trees to a common location,
introduce the config option BUILTIN_DTB, which can be selected by
platforms that use a device-tree built into the kernel image, and
create a Makefile to build the device-trees in arch/mips/boot/dts/.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
Cc: Kumar Gala <galak@codeaurora.org>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: David Daney <david.daney@cavium.com>
Cc: John Crispin <blogic@openwrt.org>
Cc: Jayachandran C <jchandra@broadcom.com>
Cc: Qais Yousef <qais.yousef@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: devicetree@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/7564/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/Kconfig
arch/mips/Makefile
arch/mips/boot/dts/Makefile [new file with mode: 0644]

index 574c430006997427b564ef9bdeda2c16c3497279..8a2663d806c922afce49ee5bf8c74e294e77603f 100644 (file)
@@ -2482,6 +2482,9 @@ config USE_OF
        select OF_EARLY_FLATTREE
        select IRQ_DOMAIN
 
+config BUILTIN_DTB
+       bool
+
 endmenu
 
 config LOCKDEP_SUPPORT
index bbac51e11179af67698250417512a92136a11a0f..bd642623f360d398e5c09af6f144635d193a4c9d 100644 (file)
@@ -333,6 +333,12 @@ endif
 
 CLEAN_FILES += vmlinux.32 vmlinux.64
 
+# device-trees
+core-$(CONFIG_BUILTIN_DTB) += arch/mips/boot/dts/
+
+%.dtb %.dtb.S %.dtb.o: | scripts
+       $(Q)$(MAKE) $(build)=arch/mips/boot/dts arch/mips/boot/dts/$@
+
 archprepare:
 ifdef CONFIG_MIPS32_N32
        @echo '  Checking missing-syscalls for N32'
diff --git a/arch/mips/boot/dts/Makefile b/arch/mips/boot/dts/Makefile
new file mode 100644 (file)
index 0000000..6bb41df
--- /dev/null
@@ -0,0 +1,3 @@
+obj-y          += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
+
+clean-files    += *.dtb.S