2018-05-06 21:58:06 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0+
|
2011-10-15 05:48:21 +00:00
|
|
|
#
|
|
|
|
# Copyright (c) 2011 The Chromium OS Authors.
|
|
|
|
|
|
|
|
# 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 02:28:25 +00:00
|
|
|
DEVICE_TREE ?= $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%)
|
|
|
|
ifeq ($(DEVICE_TREE),)
|
2014-02-05 02:28:27 +00:00
|
|
|
DEVICE_TREE := unset
|
2014-02-05 02:28:25 +00:00
|
|
|
endif
|
2013-07-24 17:09:19 +00:00
|
|
|
|
2014-06-12 13:24:43 +00:00
|
|
|
ifneq ($(EXT_DTB),)
|
|
|
|
DTB := $(EXT_DTB)
|
2014-06-03 04:04:50 +00:00
|
|
|
else
|
2019-03-14 05:58:36 +00:00
|
|
|
DTB := arch/$(ARCH)/dts/$(DEVICE_TREE).dtb
|
2014-06-03 04:04:50 +00:00
|
|
|
endif
|
2013-07-24 17:09:19 +00:00
|
|
|
|
2020-12-23 02:30:15 +00:00
|
|
|
$(obj)/dt-$(SPL_NAME).dtb: dts/dt.dtb $(objtree)/tools/fdtgrep FORCE
|
2020-12-23 02:30:14 +00:00
|
|
|
mkdir -p $(dir $@)
|
2017-11-21 12:29:56 +00:00
|
|
|
$(call if_changed,fdtgrep)
|
|
|
|
|
2020-01-12 14:57:42 +00:00
|
|
|
ifeq ($(CONFIG_OF_DTB_PROPS_REMOVE),y)
|
|
|
|
$(obj)/dt.dtb: $(DTB) $(objtree)/tools/fdtgrep FORCE
|
|
|
|
$(call if_changed,fdt_rm_props)
|
|
|
|
else
|
2014-02-05 02:28:27 +00:00
|
|
|
$(obj)/dt.dtb: $(DTB) FORCE
|
2014-06-04 01:11:18 +00:00
|
|
|
$(call if_changed,shipped)
|
2020-01-12 14:57:42 +00:00
|
|
|
endif
|
2011-10-15 05:48:21 +00:00
|
|
|
|
2020-12-23 02:30:15 +00:00
|
|
|
targets += dt.dtb
|
2011-10-15 05:48:21 +00:00
|
|
|
|
2019-03-14 05:58:36 +00:00
|
|
|
$(DTB): arch-dtbs
|
2014-02-05 02:28:27 +00:00
|
|
|
$(Q)test -e $@ || ( \
|
|
|
|
echo >&2; \
|
2020-12-27 20:34:43 +00:00
|
|
|
echo >&2 "Device Tree Source ($@) is not correctly specified."; \
|
2014-02-05 02:28:27 +00:00
|
|
|
echo >&2 "Please define 'CONFIG_DEFAULT_DEVICE_TREE'"; \
|
|
|
|
echo >&2 "or build with 'DEVICE_TREE=<device_tree>' argument"; \
|
|
|
|
echo >&2; \
|
|
|
|
/bin/false)
|
|
|
|
|
2019-02-26 19:20:25 +00:00
|
|
|
PHONY += arch-dtbs
|
2014-02-05 02:28:27 +00:00
|
|
|
arch-dtbs:
|
2019-03-14 05:58:36 +00:00
|
|
|
$(Q)$(MAKE) $(build)=arch/$(ARCH)/dts dtbs
|
2011-10-15 05:48:21 +00:00
|
|
|
|
2017-11-21 12:29:56 +00:00
|
|
|
ifeq ($(CONFIG_SPL_BUILD),y)
|
|
|
|
obj-$(CONFIG_OF_EMBED) := dt-spl.dtb.o
|
|
|
|
# support "out-of-tree" build for dtb-spl
|
|
|
|
$(obj)/dt-spl.dtb.o: $(obj)/dt-spl.dtb.S FORCE
|
|
|
|
$(call if_changed_dep,as_o_S)
|
|
|
|
else
|
2014-02-05 02:28:25 +00:00
|
|
|
obj-$(CONFIG_OF_EMBED) := dt.dtb.o
|
2017-11-21 12:29:56 +00:00
|
|
|
endif
|
2011-10-15 05:48:21 +00:00
|
|
|
|
2020-12-23 02:30:15 +00:00
|
|
|
# Target for U-Boot proper
|
|
|
|
dtbs: $(obj)/dt.dtb
|
|
|
|
@:
|
|
|
|
|
|
|
|
# Target for SPL/TPL
|
|
|
|
spl_dtbs: $(obj)/dt-$(SPL_NAME).dtb
|
2014-02-05 02:28:25 +00:00
|
|
|
@:
|
2011-10-15 05:48:21 +00:00
|
|
|
|
2020-12-23 02:30:15 +00:00
|
|
|
clean-files := dt.dtb.S
|
2014-02-05 02:28:27 +00:00
|
|
|
|
|
|
|
# Let clean descend into dts directories
|
2023-06-19 22:41:05 +00:00
|
|
|
subdir- += ../arch/arc/dts ../arch/arm/dts ../arch/m68k/dts ../arch/microblaze/dts \
|
|
|
|
../arch/mips/dts ../arch/nios2/dts ../arch/powerpc/dts ../arch/riscv/dts \
|
|
|
|
../arch/sandbox/dts ../arch/sh/dts ../arch/x86/dts ../arch/xtensa/dts
|