summaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.lib
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/Makefile.lib')
-rw-r--r--scripts/Makefile.lib46
1 files changed, 34 insertions, 12 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index bbfd4cd2de..0b56dcc218 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -141,10 +141,10 @@ cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(__cpp_flags)
ld_flags = $(LDFLAGS) $(EXTRA_LDFLAGS)
-dtc_cpp_flags = -Wp,-MD,$(depfile) -nostdinc \
- -I$(srctree)/arch/$(SRCARCH)/dts \
- -I$(srctree)/arch/$(SRCARCH)/include/dts \
- -undef -D__DTS__
+dtc_cpp_flags = -Wp,-MD,$(depfile).pre -nostdinc \
+ -I$(srctree)/arch/$(SRCARCH)/dts \
+ -I$(srctree)/arch/$(SRCARCH)/dts/include \
+ -undef -D__DTS__
# Finds the multi-part object the current object will be linked into
modname-multi = $(sort $(foreach m,$(multi-used),\
@@ -212,20 +212,17 @@ $(obj)/%.dtb.S: $(obj)/%.dtb
$(call cmd,dt_S_dtb)
quiet_cmd_dtc = DTC $@
-cmd_dtc = $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) -d $(depfile) $<
+cmd_dtc = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
+ $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 \
+ -i $(srctree)/arch/$(SRCARCH)/dts $(DTC_FLAGS) \
+ -d $(depfile).dtc $(dtc-tmp) ; \
+ cat $(depfile).pre $(depfile).dtc > $(depfile)
$(obj)/%.dtb: $(src)/%.dts FORCE
$(call if_changed_dep,dtc)
dtc-tmp = $(subst $(comma),_,$(dot-target).dts)
-quiet_cmd_dtc_cpp = DTC+CPP $@
-cmd_dtc_cpp = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
- $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) $(dtc-tmp)
-
-$(obj)/%.dtb: $(src)/%.dtsp FORCE
- $(call if_changed_dep,dtc_cpp)
-
# Bzip2
# ---------------------------------------------------------------------------
@@ -308,3 +305,28 @@ quiet_cmd_check_file_size = CHKSIZE $@
echo "$@ size $$size > of the maximum size $$max_size" >&2; \
exit 1 ; \
fi;
+
+quiet_cmd_imximage__S_dcd= DCD_S $@
+cmd_imximage_S_dcd= \
+( \
+ echo '\#include <asm-generic/barebox.lds.h>'; \
+ echo '.balign STRUCT_ALIGNMENT'; \
+ echo '.global $(subst -,_,$(*F))_start'; \
+ echo '$(subst -,_,$(*F))_start:'; \
+ echo '.incbin "$<" '; \
+ echo '$(subst -,_,$(*F))_end:'; \
+ echo '.global $(subst -,_,$(*F))_end'; \
+ echo '.balign STRUCT_ALIGNMENT'; \
+) > $@
+
+quiet_cmd_dcd = DCD $@
+ cmd_dcd = $(objtree)/scripts/imx/imx-image -d -o $@ -c $<
+
+$(obj)/%.dcd: $(obj)/%.imxcfg FORCE
+ $(call if_changed,dcd)
+
+$(obj)/%.S: $(obj)/%.dcd
+ $(call cmd,imximage_S_dcd)
+
+quiet_cmd_imx_image = IMX-IMG $@
+ cmd_imx_image = $(obj)/scripts/imx/imx-image -b -c $(CFG_$(@F)) -f $< -o $@