script: Add support for DTC_FLAG

Add support to provide the DTC_FLAG for DTC
compilation from makefile and create folder for temporary/
intermediate DT build file creation.

This will help to build the DT available in hardware/nvidia.

Bug 3787936

Change-Id: I79ca3f2532fd317ff004bc7290185d4878028fff
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2773804
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Laxman Dewangan
2022-09-08 16:41:19 +00:00
parent 593f3c5677
commit 0acbdc273a

View File

@@ -223,6 +223,7 @@ DTC_INCLUDE += $(srctree)/scripts/dtc/include-prefixes
dtc_cpp_flags = -Wp,-MMD,$(depfile).pre.tmp -nostdinc \ dtc_cpp_flags = -Wp,-MMD,$(depfile).pre.tmp -nostdinc \
$(addprefix -I,$(DTC_INCLUDE)) \ $(addprefix -I,$(DTC_INCLUDE)) \
$(DTC_CPP_FLAGS) \
-undef -D__DTS__ -undef -D__DTS__
ifeq ($(CONFIG_LTO_CLANG),y) ifeq ($(CONFIG_LTO_CLANG),y)
@@ -348,7 +349,8 @@ $(obj)/%.dtb.S: $(obj)/%.dtb FORCE
$(call if_changed,dt_S_dtb) $(call if_changed,dt_S_dtb)
quiet_cmd_dtc = DTC $@ quiet_cmd_dtc = DTC $@
cmd_dtc = $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
$(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
$(DTC) -o $@ -b 0 \ $(DTC) -o $@ -b 0 \
$(addprefix -i,$(dir $<) $(DTC_INCLUDE)) $(DTC_FLAGS) \ $(addprefix -i,$(dir $<) $(DTC_INCLUDE)) $(DTC_FLAGS) \
-d $(depfile).dtc.tmp $(dtc-tmp) ; \ -d $(depfile).dtc.tmp $(dtc-tmp) ; \