2011-10-15 13:48:21 +08:00
|
|
|
#
|
|
|
|
# Copyright (c) 2011 The Chromium OS Authors.
|
|
|
|
#
|
2013-07-08 15:37:19 +08:00
|
|
|
# SPDX-License-Identifier: GPL-2.0+
|
2011-10-15 13:48:21 +08:00
|
|
|
#
|
|
|
|
|
|
|
|
# This Makefile builds the internal U-Boot fdt if CONFIG_OF_CONTROL is
|
|
|
|
# enabled. See doc/README.fdt-control for more details.
|
|
|
|
|
2014-02-05 10:28:25 +08:00
|
|
|
DEVICE_TREE ?= $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%)
|
|
|
|
ifeq ($(DEVICE_TREE),)
|
2014-02-05 10:28:27 +08:00
|
|
|
DEVICE_TREE := unset
|
2014-02-05 10:28:25 +08:00
|
|
|
endif
|
2013-07-25 01:09:19 +08:00
|
|
|
|
2014-06-03 12:04:50 +08:00
|
|
|
ifneq ($(DEV_TREE_BIN),)
|
|
|
|
DTB := $(DEV_TREE_BIN)
|
|
|
|
else
|
2014-02-05 10:28:27 +08:00
|
|
|
DTB := arch/$(ARCH)/dts/$(DEVICE_TREE).dtb
|
2014-06-03 12:04:50 +08:00
|
|
|
endif
|
2013-07-25 01:09:19 +08:00
|
|
|
|
2014-02-05 10:28:27 +08:00
|
|
|
$(obj)/dt.dtb: $(DTB) FORCE
|
2014-06-04 09:11:18 +08:00
|
|
|
$(call if_changed,shipped)
|
2011-10-15 13:48:21 +08:00
|
|
|
|
2014-02-05 10:28:25 +08:00
|
|
|
targets += dt.dtb
|
2011-10-15 13:48:21 +08:00
|
|
|
|
2014-02-05 10:28:27 +08:00
|
|
|
$(DTB): arch-dtbs
|
|
|
|
$(Q)test -e $@ || ( \
|
|
|
|
echo >&2; \
|
|
|
|
echo >&2 "Device Tree Source is not correctly specified."; \
|
|
|
|
echo >&2 "Please define 'CONFIG_DEFAULT_DEVICE_TREE'"; \
|
|
|
|
echo >&2 "or build with 'DEVICE_TREE=<device_tree>' argument"; \
|
|
|
|
echo >&2; \
|
|
|
|
/bin/false)
|
|
|
|
|
|
|
|
arch-dtbs:
|
|
|
|
$(Q)$(MAKE) $(build)=arch/$(ARCH)/dts dtbs
|
2011-10-15 13:48:21 +08:00
|
|
|
|
2014-02-05 10:28:25 +08:00
|
|
|
.SECONDARY: $(obj)/dt.dtb.S
|
2011-10-15 13:48:21 +08:00
|
|
|
|
2014-02-05 10:28:25 +08:00
|
|
|
obj-$(CONFIG_OF_EMBED) := dt.dtb.o
|
2011-10-15 13:48:21 +08:00
|
|
|
|
2014-02-05 10:28:25 +08:00
|
|
|
dtbs: $(obj)/dt.dtb
|
|
|
|
@:
|
2011-10-15 13:48:21 +08:00
|
|
|
|
2014-02-05 10:28:25 +08:00
|
|
|
clean-files := dt.dtb.S
|
2014-02-05 10:28:27 +08:00
|
|
|
|
|
|
|
# Let clean descend into dts directories
|
2014-03-28 13:55:02 +08:00
|
|
|
subdir- += ../arch/arm/dts ../arch/microblaze/dts ../arch/sandbox/dts ../arch/x86/dts
|