blob: 3fca5f5c2f5df968b9b924c97d873a478ca222a7 [file] [log] [blame]
Simon Glass38d6b8d2011-10-15 05:48:21 +00001#
2# Copyright (c) 2011 The Chromium OS Authors.
3#
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02004# SPDX-License-Identifier: GPL-2.0+
Simon Glass38d6b8d2011-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 Yamada43c08932014-02-05 11:28:25 +090010DEVICE_TREE ?= $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%)
11ifeq ($(DEVICE_TREE),)
Masahiro Yamadae7a579f2014-02-05 11:28:27 +090012DEVICE_TREE := unset
Masahiro Yamada43c08932014-02-05 11:28:25 +090013endif
Stephen Warrenc198ef72013-07-24 10:09:19 -070014
Masahiro Yamadae7a579f2014-02-05 11:28:27 +090015DTB := arch/$(ARCH)/dts/$(DEVICE_TREE).dtb
Stephen Warrenc198ef72013-07-24 10:09:19 -070016
Masahiro Yamadae7a579f2014-02-05 11:28:27 +090017$(obj)/dt.dtb: $(DTB) FORCE
Masahiro Yamada97e101c2014-06-04 10:11:18 +090018 $(call if_changed,shipped)
Simon Glass38d6b8d2011-10-15 05:48:21 +000019
Masahiro Yamada43c08932014-02-05 11:28:25 +090020targets += dt.dtb
Simon Glass38d6b8d2011-10-15 05:48:21 +000021
Masahiro Yamadae7a579f2014-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
Simon Glass38d6b8d2011-10-15 05:48:21 +000033
Masahiro Yamada43c08932014-02-05 11:28:25 +090034.SECONDARY: $(obj)/dt.dtb.S
Simon Glass38d6b8d2011-10-15 05:48:21 +000035
Masahiro Yamada43c08932014-02-05 11:28:25 +090036obj-$(CONFIG_OF_EMBED) := dt.dtb.o
Simon Glass38d6b8d2011-10-15 05:48:21 +000037
Masahiro Yamada43c08932014-02-05 11:28:25 +090038dtbs: $(obj)/dt.dtb
39 @:
Simon Glass38d6b8d2011-10-15 05:48:21 +000040
Masahiro Yamada43c08932014-02-05 11:28:25 +090041clean-files := dt.dtb.S
Masahiro Yamadae7a579f2014-02-05 11:28:27 +090042
43# Let clean descend into dts directories
Masahiro Yamada806adae2014-03-28 14:55:02 +090044subdir- += ../arch/arm/dts ../arch/microblaze/dts ../arch/sandbox/dts ../arch/x86/dts