blob: c47fba787ccb593f11260b33d4c77b7bb135148c [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 Yamada6ab6b2a2014-02-05 11:28:25 +090012DEVICE_TREE := notfound
Masahiro Yamadaefcf8612014-02-04 17:24:40 +090013endif
Simon Glassbbb0b122011-10-15 05:48:21 +000014
Masahiro Yamada6ab6b2a2014-02-05 11:28:25 +090015DTS := $(srctree)/board/$(VENDOR)/dts/$(DEVICE_TREE).dts
Simon Glassbbb0b122011-10-15 05:48:21 +000016
Masahiro Yamada6ab6b2a2014-02-05 11:28:25 +090017DTC_FLAGS += -i $(srctree)/arch/$(ARCH)/dts -R 4 -p 0x1000
Simon Glassbbb0b122011-10-15 05:48:21 +000018
Masahiro Yamada6ab6b2a2014-02-05 11:28:25 +090019$(obj)/dt.dtb: $(DTS) FORCE
20 $(call if_changed_dep,dtc)
Simon Glassbbb0b122011-10-15 05:48:21 +000021
Masahiro Yamada6ab6b2a2014-02-05 11:28:25 +090022targets += dt.dtb
Simon Glassbbb0b122011-10-15 05:48:21 +000023
Masahiro Yamada6ab6b2a2014-02-05 11:28:25 +090024$(DTS):
25 @echo >&2
26 @echo >&2 "Device Tree Source is not specified."
27 @echo >&2 "Please define 'CONFIG_DEFAULT_DEVICE_TREE'"
28 @echo >&2 "or build with 'DEVICE_TREE=<dts-file-name>' argument"
29 @/bin/false
30
31.SECONDARY: $(obj)/dt.dtb.S
32
33obj-$(CONFIG_OF_EMBED) := dt.dtb.o
34
35dtbs: $(obj)/dt.dtb
36 @:
37
38clean-files := dt.dtb.S