diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2020-10-14 22:05:31 +0530 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2020-10-18 10:33:57 +0530 |
commit | e9a4bfb7b51e1d43f2c5d6d387354ba4b14411f2 (patch) | |
tree | 0f7f921c2d0c7acabdcab3a7b495f65f39b300de /Makefile | |
parent | 9c07c513aa9b2df64a971432e8dae3338a8e22ab (diff) |
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-- | Makefile | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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,$@,$<) |