Skip to content

Commit 49636c5

Browse files
lumagrobherring
authored andcommitted
kbuild: verify dtoverlay files against schema
Currently only the single part device trees are validated against DT schema. For the multipart DT files only the base DTB is validated. Extend the fdtoverlay commands to validate the resulting DTB file against schema. Signed-off-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rob Herring (Arm) <[email protected]>
1 parent 2bcc896 commit 49636c5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/Makefile.lib

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,15 @@ cmd_dtc = $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ;
407407
-d $(depfile).dtc.tmp $(dtc-tmp) ; \
408408
cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile)
409409

410+
DT_CHECK_CMD = $(DT_CHECKER) $(DT_CHECKER_FLAGS) -u $(srctree)/$(DT_BINDING_DIR) -p $(DT_TMP_SCHEMA)
411+
412+
ifneq ($(CHECK_DTBS),)
413+
quiet_cmd_fdtoverlay = DTOVLCH $@
414+
cmd_fdtoverlay = $(objtree)/scripts/dtc/fdtoverlay -o $@ -i $(real-prereqs) ; $(DT_CHECK_CMD) $@ || true
415+
else
410416
quiet_cmd_fdtoverlay = DTOVL $@
411417
cmd_fdtoverlay = $(objtree)/scripts/dtc/fdtoverlay -o $@ -i $(real-prereqs)
418+
endif
412419

413420
$(multi-dtb-y): FORCE
414421
$(call if_changed,fdtoverlay)
@@ -421,7 +428,7 @@ DT_BINDING_DIR := Documentation/devicetree/bindings
421428
DT_TMP_SCHEMA := $(objtree)/$(DT_BINDING_DIR)/processed-schema.json
422429

423430
quiet_cmd_dtb = DTC_CHK $@
424-
cmd_dtb = $(cmd_dtc) ; $(DT_CHECKER) $(DT_CHECKER_FLAGS) -u $(srctree)/$(DT_BINDING_DIR) -p $(DT_TMP_SCHEMA) $@ || true
431+
cmd_dtb = $(cmd_dtc) ; $(DT_CHECK_CMD) $@ || true
425432
else
426433
quiet_cmd_dtb = $(quiet_cmd_dtc)
427434
cmd_dtb = $(cmd_dtc)

0 commit comments

Comments
 (0)