summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2020-10-14 19:35:31 +0300
committerAnup Patel <anup@brainfault.org>2020-10-18 08:03:57 +0300
commite9a4bfb7b51e1d43f2c5d6d387354ba4b14411f2 (patch)
tree0f7f921c2d0c7acabdcab3a7b495f65f39b300de /Makefile
parent9c07c513aa9b2df64a971432e8dae3338a8e22ab (diff)
downloadopensbi-e9a4bfb7b51e1d43f2c5d6d387354ba4b14411f2.tar.xz
Makefile: Allow padding zeros when converting DTB to C source
We extend d2c.sh to allow padding zeros in output C source when converting DTB to C source. Using this feature, platforms can create extra room for in-place FDT fixups on built-in DTBs. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile7
1 files changed, 5 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 6c36f09..a231881 100644
--- a/Makefile
+++ b/Makefile
@@ -291,7 +291,10 @@ compile_dts = $(CMD_PREFIX)mkdir -p `dirname $(1)`; \
$(CPP) $(DTSCPPFLAGS) $(2) | $(DTC) -O dtb -i `dirname $(2)` -o $(1)
compile_d2c = $(CMD_PREFIX)mkdir -p `dirname $(1)`; \
echo " D2C $(subst $(build_dir)/,,$(1))"; \
- $(src_dir)/scripts/d2c.sh -i $(4) -a $(3) -p $(2) > $(1)
+ $(if $($(2)-varalign-$(3)),$(eval D2C_ALIGN_BYTES := $($(2)-varalign-$(3))),$(eval D2C_ALIGN_BYTES := $(4))) \
+ $(if $($(2)-varprefix-$(3)),$(eval D2C_NAME_PREFIX := $($(2)-varprefix-$(3))),$(eval D2C_NAME_PREFIX := $(5))) \
+ $(if $($(2)-padding-$(3)),$(eval D2C_PADDING_BYTES := $($(2)-padding-$(3))),$(eval D2C_PADDING_BYTES := 0)) \
+ $(src_dir)/scripts/d2c.sh -i $(6) -a $(D2C_ALIGN_BYTES) -p $(D2C_NAME_PREFIX) -t $(D2C_PADDING_BYTES) > $(1)
compile_gen_dep = $(CMD_PREFIX)mkdir -p `dirname $(1)`; \
echo " GEN-DEP $(subst $(build_dir)/,,$(1))"; \
echo "$(1:.dep=$(2)): $(3)" >> $(1)
@@ -361,7 +364,7 @@ $(platform_build_dir)/%.dep: $(platform_src_dir)/%.dts
$(call compile_gen_dep,$@,.o,$(@:.dep=.c))
$(platform_build_dir)/%.c: $(platform_build_dir)/%.dtb
- $(call compile_d2c,$@,$(platform-varprefix-$(subst .dtb,.o,$(subst /,-,$(subst $(platform_build_dir)/,,$<)))),16,$<)
+ $(call compile_d2c,$@,platform,$(subst .dtb,.o,$(subst /,-,$(subst $(platform_build_dir)/,,$<))),16,dt,$<)
$(platform_build_dir)/%.dtb: $(platform_src_dir)/%.dts
$(call compile_dts,$@,$<)