kbuild: Add DTB_FILES variable for dtbs_check
Subsystems (2)
PATCH 1/1 kbuild: Add DTB_FILES variable for dtbs_check
Currently running dtbs_check compiles and runs the DT checker on all enabled devicetrees against all dt-bindings. This can take a long time, and is an unnecessary burden when just validating a new devicetree or changes in an existing one, with the dt-bindings unchanged.
Similarly to DT_SCHEMA_FILES for dt_binding_check, add a DTB_FILES variable that can be passed to the dtbs_check make command to restrict which devicetrees are validated.
---
Usage example:
make dtbs_check DTB_FILES='arch/arm64/boot/dts/mediatek/mt8192-asurada-spherion-r0.dtb arch/arm64/boot/dts/mediatek/mt8192-asurada-hayato-r1.dtb'
scripts/Makefile.lib | 7 +++++++ 1 file changed, 7 insertions(+)
scripts/Makefile.lib +7 -0
@@ -418,9 +418,16 @@ DT_CHECKER_FLAGS ?= $(if $(DT_SCHEMA_FILES),-l $(DT_SCHEMA_FILES),-m) DT_BINDING_DIR := Documentation/devicetree/bindings DT_TMP_SCHEMA := $(objtree)/$(DT_BINDING_DIR)/processed-schema.json +ifeq ($(DTB_FILES),) quiet_cmd_dtb = DTC_CHK $@ cmd_dtb = $(cmd_dtc) ; $(DT_CHECKER) $(DT_CHECKER_FLAGS) -u $(srctree)/$(DT_BINDING_DIR) -p $(DT_TMP_SCHEMA) $@ || true else +SHOULD_CHECK_DTB = $(filter $@,$(DTB_FILES)) + +quiet_cmd_dtb = $(if $(SHOULD_CHECK_DTB),DTC_CHK,DTC) $@ + cmd_dtb = $(if $(SHOULD_CHECK_DTB), $(cmd_dtc) ; $(DT_CHECKER) $(DT_CHECKER_FLAGS) -u $(srctree)/$(DT_BINDING_DIR) -p $(DT_TMP_SCHEMA) $@ || true , $(cmd_dtc)) +endif +else quiet_cmd_dtb = $(quiet_cmd_dtc) cmd_dtb = $(cmd_dtc) endif
Signature · 1 line
2.38.1
Il 01/11/22 23:03, Nícolas F. R. A. Prado ha scritto:
Quoted 11 lines
Currently running
dtbs_checkcompiles and runs the DT checker on all enabled devicetrees against all dt-bindings. This can take a long time, and is an unnecessary burden when just validating a new devicetree or changes in an existing one, with the dt-bindings unchanged.Similarly to
DT_SCHEMA_FILESfordt_binding_check, add aDTB_FILESvariable that can be passed to thedtbs_checkmake command to restrict which devicetrees are validated.Signed-off-by Nícolas F. R. A. Prado <[email protected]>
Hi Nícolas,
Quoted 9 lines · Nícolas F. R. A. Prado
Currently running
dtbs_checkcompiles and runs the DT checker on all enabled devicetrees against all dt-bindings. This can take a long time, and is an unnecessary burden when just validating a new devicetree or changes in an existing one, with the dt-bindings unchanged.Similarly to
DT_SCHEMA_FILESfordt_binding_check, add aDTB_FILESvariable that can be passed to thedtbs_checkmake command to restrict which devicetrees are validated.
Quoted 5 lines
Signed-off-by Nícolas F. R. A. Prado <[email protected]>---
Usage example:
makedtbs_checkDTB_FILES='arch/arm64/boot/dts/mediatek/mt8192-asurada-spherion-r0.dtbarch/arm64/boot/dts/mediatek/mt8192-asurada-hayato-r1.dtb'
Please add the usage example to the 'Running checks' section in Documentation/devicetree/bindings/writing-schema.rst
-- Sebastian
Quoted 30 lines
scripts/Makefile.lib | 7 +++++++ 1 file changed, 7 insertions(+)scripts/Makefile.lib +7
-0@@ -418,9 +418,16 @@ DT_CHECKER_FLAGS ?= $(if $(DT_SCHEMA_FILES),-l $(DT_SCHEMA_FILES),-m) DT_BINDING_DIR := Documentation/devicetree/bindings DT_TMP_SCHEMA := $(objtree)/$(DT_BINDING_DIR)/processed-schema.json +ifeq ($(DTB_FILES),) quiet_cmd_dtb = DTC_CHK $@ cmd_dtb = $(cmd_dtc) ; $(DT_CHECKER) $(DT_CHECKER_FLAGS) -u $(srctree)/$(DT_BINDING_DIR) -p $(DT_TMP_SCHEMA) $@ || true else +SHOULD_CHECK_DTB = $(filter $@,$(DTB_FILES)) + +quiet_cmd_dtb = $(if $(SHOULD_CHECK_DTB),DTC_CHK,DTC) $@ + cmd_dtb = $(if $(SHOULD_CHECK_DTB), $(cmd_dtc) ; $(DT_CHECKER) $(DT_CHECKER_FLAGS) -u $(srctree)/$(DT_BINDING_DIR) -p $(DT_TMP_SCHEMA) $@ || true , $(cmd_dtc)) +endif +else quiet_cmd_dtb = $(quiet_cmd_dtc) cmd_dtb = $(cmd_dtc) endifSignature · 5 lines
2.38.1 -- To unsubscribe, send mail to [email protected].
Quoted 9 lines · Nícolas F. R. A. Prado
Currently running
dtbs_checkcompiles and runs the DT checker on all enabled devicetrees against all dt-bindings. This can take a long time, and is an unnecessary burden when just validating a new devicetree or changes in an existing one, with the dt-bindings unchanged.Similarly to
DT_SCHEMA_FILESfordt_binding_check, add aDTB_FILESvariable that can be passed to thedtbs_checkmake command to restrict which devicetrees are validated.
Quoted 5 lines
Signed-off-by Nícolas F. R. A. Prado <[email protected]>---
Usage example:
makedtbs_checkDTB_FILES='arch/arm64/boot/dts/mediatek/mt8192-asurada-spherion-r0.dtbarch/arm64/boot/dts/mediatek/mt8192-asurada-hayato-r1.dtb'
Hi,
I have just learned that it is already possible to achieve the same thing by passing the dtbs explicitly to make and enabling the DTBS_CHECK flag like so:
make CHECK_DTBS=y mediatek/mt8192-asurada-spherion-r0.dtb
This flag isn't documented anywhere outside the Makefile however. So I'll send a patch documenting it shortly, and this commit can be ignored.
Thanks,
Nícolas
Quoted 18 lines · Nícolas F. R. A. Prado
Quoted 9 lines · Nícolas F. R. A. Prado
Currently running
dtbs_checkcompiles and runs the DT checker on all enabled devicetrees against all dt-bindings. This can take a long time, and is an unnecessary burden when just validating a new devicetree or changes in an existing one, with the dt-bindings unchanged.Similarly to
DT_SCHEMA_FILESfordt_binding_check, add aDTB_FILESvariable that can be passed to thedtbs_checkmake command to restrict which devicetrees are validated.Quoted 5 lines
Signed-off-by Nícolas F. R. A. Prado <[email protected]>---
Usage example:
makedtbs_checkDTB_FILES='arch/arm64/boot/dts/mediatek/mt8192-asurada-spherion-r0.dtbarch/arm64/boot/dts/mediatek/mt8192-asurada-hayato-r1.dtb'Hi,
Quoted 7 lines
I have just learned that it is already possible to achieve the same thing by passing the dtbs explicitly to make and enabling the
DTBS_CHECKflag like so:make CHECK_DTBS=y mediatek/mt8192-asurada-spherion-r0.dtb
This flag isn't documented anywhere outside the
Makefilehowever. So I'll send a patch documenting it shortly, and this commit can be ignored.
Patch: https://lore.kernel.org/all/[email protected]
Thanks,
Nícolas