4545obj-y := $(filter-out %/, $(obj-y))
4646endif
4747
48- ifdef need-dtbslist
49- dtb-y += $(addsuffix /dtbs-list, $(subdir-ym))
50- always-y += dtbs-list
51- endif
52-
5348# Expand $(foo-objs) $(foo-y) etc. by replacing their individuals
5449suffix-search = $(strip $(foreach s, $3, $($(1:%$(strip $2)=%$s))))
5550# List composite targets that are constructed by combining other targets
@@ -80,19 +75,6 @@ always-y += $(hostprogs-always-y) $(hostprogs-always-m)
8075userprogs += $(userprogs-always-y) $(userprogs-always-m)
8176always-y += $(userprogs-always-y) $(userprogs-always-m)
8277
83- # DTB
84- # If CONFIG_OF_ALL_DTBS is enabled, all DT blobs are built
85- dtb-$(CONFIG_OF_ALL_DTBS) += $(dtb-)
86-
87- # Composite DTB (i.e. DTB constructed by overlay)
88- multi-dtb-y := $(call multi-search, $(dtb-y), .dtb, -dtbs)
89- # Primitive DTB compiled from *.dts
90- real-dtb-y := $(call real-search, $(dtb-y), .dtb, -dtbs)
91- # Base DTB that overlay is applied onto
92- base-dtb-y := $(filter %.dtb, $(call real-search, $(multi-dtb-y), .dtb, -dtbs))
93-
94- always-y += $(dtb-y)
95-
9678# Add subdir path
9779
9880ifneq ($(obj),.)
@@ -104,9 +86,6 @@ lib-y := $(addprefix $(obj)/,$(lib-y))
10486real-obj-y := $(addprefix $(obj)/,$(real-obj-y))
10587real-obj-m := $(addprefix $(obj)/,$(real-obj-m))
10688multi-obj-m := $(addprefix $(obj)/, $(multi-obj-m))
107- dtb-y := $(addprefix $(obj)/, $(dtb-y))
108- multi-dtb-y := $(addprefix $(obj)/, $(multi-dtb-y))
109- real-dtb-y := $(addprefix $(obj)/, $(real-dtb-y))
11089subdir-ym := $(addprefix $(obj)/,$(subdir-ym))
11190endif
11291
@@ -255,12 +234,6 @@ cpp_flags = -Wp,-MMD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
255234
256235ld_flags = $(KBUILD_LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F))
257236
258- DTC_INCLUDE := $(srctree)/scripts/dtc/include-prefixes
259-
260- dtc_cpp_flags = -Wp,-MMD,$(depfile).pre.tmp -nostdinc \
261- $(addprefix -I,$(DTC_INCLUDE)) \
262- -undef -D__DTS__
263-
264237ifdef CONFIG_OBJTOOL
265238
266239objtool := $(objtree)/tools/objtool/objtool
@@ -350,94 +323,6 @@ cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@
350323quiet_cmd_gzip = GZIP $@
351324 cmd_gzip = cat $(real-prereqs) | $(KGZIP) -n -f -9 > $@
352325
353- # DTC
354- # ---------------------------------------------------------------------------
355- DTC ?= $(objtree)/scripts/dtc/dtc
356- DTC_FLAGS += \
357- -Wno-unique_unit_address
358-
359- # Disable noisy checks by default
360- ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),)
361- DTC_FLAGS += -Wno-unit_address_vs_reg \
362- -Wno-avoid_unnecessary_addr_size \
363- -Wno-alias_paths \
364- -Wno-graph_child_address \
365- -Wno-simple_bus_reg
366- else
367- DTC_FLAGS += \
368- -Wunique_unit_address_if_enabled
369- endif
370-
371- ifneq ($(findstring 2,$(KBUILD_EXTRA_WARN)),)
372- DTC_FLAGS += -Wnode_name_chars_strict \
373- -Wproperty_name_chars_strict \
374- -Wunique_unit_address
375- endif
376-
377- DTC_FLAGS += $(DTC_FLAGS_$(target-stem))
378-
379- # Set -@ if the target is a base DTB that overlay is applied onto
380- DTC_FLAGS += $(if $(filter $(patsubst $(obj)/%,%,$@), $(base-dtb-y)), -@)
381-
382- # Generate an assembly file to wrap the output of the device tree compiler
383- quiet_cmd_wrap_S_dtb = WRAP $@
384- cmd_wrap_S_dtb = { \
385- symbase=__$(patsubst .%,%,$(suffix $<))_$(subst -,_,$(notdir $*)); \
386- echo '\#include <asm-generic/vmlinux.lds.h>'; \
387- echo '.section .dtb.init.rodata,"a"'; \
388- echo '.balign STRUCT_ALIGNMENT'; \
389- echo ".global $${symbase}_begin"; \
390- echo "$${symbase}_begin:"; \
391- echo '.incbin "$<" '; \
392- echo ".global $${symbase}_end"; \
393- echo "$${symbase}_end:"; \
394- echo '.balign STRUCT_ALIGNMENT'; \
395- } > $@
396-
397- $(obj)/%.dtb.S: $(obj)/%.dtb FORCE
398- $(call if_changed,wrap_S_dtb)
399-
400- $(obj)/%.dtbo.S: $(obj)/%.dtbo FORCE
401- $(call if_changed,wrap_S_dtb)
402-
403- quiet_dtb_check_tag = $(if $(dtb-check-enabled),[C], )
404- cmd_dtb_check = $(if $(dtb-check-enabled),; $(DT_CHECKER) $(DT_CHECKER_FLAGS) -u $(srctree)/$(DT_BINDING_DIR) -p $(DT_TMP_SCHEMA) $@ || true)
405-
406- quiet_cmd_dtc = DTC $(quiet_dtb_check_tag) $@
407- cmd_dtc = $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
408- $(DTC) -o $@ -b 0 \
409- $(addprefix -i,$(dir $<) $(DTC_INCLUDE)) $(DTC_FLAGS) \
410- -d $(depfile).dtc.tmp $(dtc-tmp) ; \
411- cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile) \
412- $(cmd_dtb_check)
413-
414- # NOTE:
415- # Do not replace $(filter %.dtb %.dtbo, $^) with $(real-prereqs). When a single
416- # DTB is turned into a multi-blob DTB, $^ will contain header file dependencies
417- # recorded in the .*.cmd file.
418- quiet_cmd_fdtoverlay = OVL $(quiet_dtb_check_tag) $@
419- cmd_fdtoverlay = $(objtree)/scripts/dtc/fdtoverlay -o $@ -i $(filter %.dtb %.dtbo, $^) $(cmd_dtb_check)
420-
421- $(multi-dtb-y): FORCE
422- $(call if_changed,fdtoverlay)
423- $(call multi_depend, $(multi-dtb-y), .dtb, -dtbs)
424-
425- ifneq ($(CHECK_DTBS),)
426- DT_CHECKER ?= dt-validate
427- DT_CHECKER_FLAGS ?= $(if $(DT_SCHEMA_FILES),-l $(DT_SCHEMA_FILES),-m)
428- DT_BINDING_DIR := Documentation/devicetree/bindings
429- DT_TMP_SCHEMA := $(objtree)/$(DT_BINDING_DIR)/processed-schema.json
430- dtb-check-enabled = $(if $(filter %.dtb, $@),y)
431- endif
432-
433- $(obj)/%.dtb: $(obj)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE
434- $(call if_changed_dep,dtc)
435-
436- $(obj)/%.dtbo: $(src)/%.dtso $(DTC) FORCE
437- $(call if_changed_dep,dtc)
438-
439- dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
440-
441326# Bzip2
442327# ---------------------------------------------------------------------------
443328
0 commit comments