blob: 3fca5f5c2f5df968b9b924c97d873a478ca222a7 [file] [log] [blame]
Simon Glassbbb0b122011-10-15 05:48:21 +00001#
2# Copyright (c) 2011 The Chromium OS Authors.
3#
Wolfgang Denk1a459662013-07-08 09:37:19 +02004# SPDX-License-Identifier: GPL-2.0+
Simon Glassbbb0b122011-10-15 05:48:21 +00005#
6
7# This Makefile builds the internal U-Boot fdt if CONFIG_OF_CONTROL is
8# enabled. See doc/README.fdt-control for more details.
9
Masahiro Yamadaefcf8612014-02-04 17:24:40 +090010DEVICE_TREE ?= $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%)
11ifeq ($(DEVICE_TREE),)
Masahiro Yamada3284c8b2014-02-05 11:28:27 +090012DEVICE_TREE := unset
Masahiro Yamadaefcf8612014-02-04 17:24:40 +090013endif
Simon Glassbbb0b122011-10-15 05:48:21 +000014
Masahiro Yamada3284c8b2014-02-05 11:28:27 +090015DTB := arch/$(ARCH)/dts/$(DEVICE_TREE).dtb
Simon Glassbbb0b122011-10-15 05:48:21 +000016
Masahiro Yamada3284c8b2014-02-05 11:28:27 +090017$(obj)/dt.dtb: $(DTB) FORCE
Masahiro Yamadab9d1dbd2014-06-04 10:11:18 +090018 $(call if_changed,shipped)
Simon Glassbbb0b122011-10-15 05:48:21 +000019
Masahiro Yamada6ab6b2a2014-02-05 11:28:25 +090020targets += dt.dtb
Simon Glassbbb0b122011-10-15 05:48:21 +000021
Masahiro Yamada3284c8b2014-02-05 11:28:27 +090022$(DTB): arch-dtbs
23 $(Q)test -e $@ || ( \
24 echo >&2; \
25 echo >&2 "Device Tree Source is not correctly specified."; \
26 echo >&2 "Please define 'CONFIG_DEFAULT_DEVICE_TREE'"; \
27 echo >&2 "or build with 'DEVICE_TREE=<device_tree>' argument"; \
28 echo >&2; \
29 /bin/false)
30
31arch-dtbs:
32 $(Q)$(MAKE) $(build)=arch/$(ARCH)/dts dtbs
Masahiro Yamada6ab6b2a2014-02-05 11:28:25 +090033
34.SECONDARY: $(obj)/dt.dtb.S
35
36obj-$(CONFIG_OF_EMBED) := dt.dtb.o
37
38dtbs: $(obj)/dt.dtb
39 @:
40
41clean-files := dt.dtb.S
Masahiro Yamada3284c8b2014-02-05 11:28:27 +090042
43# Let clean descend into dts directories
Masahiro Yamada6bd04bb2014-03-28 14:55:02 +090044subdir- += ../arch/arm/dts ../arch/microblaze/dts ../arch/sandbox/dts ../arch/x86/dts