colibri_imx6: fix video stdout in default environment
[oweals/u-boot.git] / dts / Makefile
1 # SPDX-License-Identifier: GPL-2.0+
2 #
3 # Copyright (c) 2011 The Chromium OS Authors.
4
5 # This Makefile builds the internal U-Boot fdt if CONFIG_OF_CONTROL is
6 # enabled. See doc/README.fdt-control for more details.
7
8 DEVICE_TREE ?= $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%)
9 ifeq ($(DEVICE_TREE),)
10 DEVICE_TREE := unset
11 endif
12
13 ifneq ($(EXT_DTB),)
14 DTB := $(EXT_DTB)
15 else
16 DTB := arch/$(ARCH)/dts/$(DEVICE_TREE).dtb
17 endif
18
19 $(obj)/dt-spl.dtb: $(DTB) $(objtree)/tools/fdtgrep FORCE
20         $(call if_changed,fdtgrep)
21
22 ifeq ($(CONFIG_OF_DTB_PROPS_REMOVE),y)
23 $(obj)/dt.dtb: $(DTB) $(objtree)/tools/fdtgrep FORCE
24         $(call if_changed,fdt_rm_props)
25 else
26 $(obj)/dt.dtb: $(DTB) FORCE
27         $(call if_changed,shipped)
28 endif
29
30 targets += dt.dtb dt-spl.dtb
31
32 $(DTB): arch-dtbs
33         $(Q)test -e $@ || (                                             \
34         echo >&2;                                                       \
35         echo >&2 "Device Tree Source is not correctly specified.";      \
36         echo >&2 "Please define 'CONFIG_DEFAULT_DEVICE_TREE'";          \
37         echo >&2 "or build with 'DEVICE_TREE=<device_tree>' argument";  \
38         echo >&2;                                                       \
39         /bin/false)
40
41 PHONY += arch-dtbs
42 arch-dtbs:
43         $(Q)$(MAKE) $(build)=arch/$(ARCH)/dts dtbs
44
45 ifeq ($(CONFIG_SPL_BUILD),y)
46 obj-$(CONFIG_OF_EMBED) := dt-spl.dtb.o
47 # support "out-of-tree" build for dtb-spl
48 $(obj)/dt-spl.dtb.o: $(obj)/dt-spl.dtb.S FORCE
49         $(call if_changed_dep,as_o_S)
50 else
51 obj-$(CONFIG_OF_EMBED) := dt.dtb.o
52 endif
53
54 dtbs: $(obj)/dt.dtb $(obj)/dt-spl.dtb
55         @:
56
57 clean-files := dt.dtb.S dt-spl.dtb.S
58
59 # Let clean descend into dts directories
60 subdir- += ../arch/arm/dts ../arch/microblaze/dts ../arch/mips/dts ../arch/sandbox/dts ../arch/x86/dts ../arch/powerpc/dts ../arch/riscv/dts