Skip to contentSkip to conversation

kbuild: Enable DT schema checks for %.dtb targets

PATCH Superseded Rob Herring 2 participants 3 messages Sep 3, 2021 – Sep 9, 2021 Kbuild

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: Enable DT schema checks for %.dtb targets

It is possible to build a single dtb, but not with DT schema validation enabled. Enable the schema validation to run for %.dtb targets. Anyone building a dtb for a specific platform *should* pay attention to schema warnings.

This could be supported with a separate %.dt.yaml target instead. However, the .dt.yaml format is considered an intermediate format and could possibly go away at some point if schema checking is integrated into dtc. Also, the plan is to enable the schema checks by default once platforms are free of warnings, and this is a move in that direction.

Cc Dmitry Baryshkov <[email protected]>
Cc Tom Rini <[email protected]>
Cc Masahiro Yamada <[email protected]>
---
 Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Makefile +3 -3
index ec9e8a0fe298..01b888cfe1dc 100644
@@ -1399,8 +1399,8 @@ endif
 
 ifneq ($(dtstree),)
 
-%.dtb: include/config/kernel.release scripts_dtc
-	$(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
+%.dtb: dt_binding_check include/config/kernel.release scripts_dtc
+	$(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ $(dtstree)/$*.dt.yaml
 
 %.dtbo: include/config/kernel.release scripts_dtc
 	$(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
@@ -1409,7 +1409,7 @@ PHONY += dtbs dtbs_install dtbs_check
 dtbs: include/config/kernel.release scripts_dtc
 	$(Q)$(MAKE) $(build)=$(dtstree)
 
-ifneq ($(filter dtbs_check, $(MAKECMDGOALS)),)
+ifneq ($(filter dtbs_check %.dtb, $(MAKECMDGOALS)),)
 export CHECK_DTBS=y
 dtbs: dt_binding_check
 endif
Signature · 1 line
2.30.2
#1 lore raw
Quoted 26 lines · Rob Herring

It is possible to build a single dtb, but not with DT schema validation enabled. Enable the schema validation to run for %.dtb targets. Anyone building a dtb for a specific platform *should* pay attention to schema warnings.

This could be supported with a separate %.dt.yaml target instead. However, the .dt.yaml format is considered an intermediate format and could possibly go away at some point if schema checking is integrated into dtc. Also, the plan is to enable the schema checks by default once platforms are free of warnings, and this is a move in that direction.

Cc Dmitry Baryshkov <[email protected]>
Cc Tom Rini <[email protected]>
Cc Masahiro Yamada <[email protected]>
---
 Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Makefile +0 -0
index ec9e8a0fe298..01b888cfe1dc 100644

Makefile endif · line 1406

Quoted 10 lines
Makefile +2 -2
@@ -1399,8 +1399,8 @@ endif
 
 ifneq ($(dtstree),)
 
-%.dtb: include/config/kernel.release scripts_dtc
-       $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
+%.dtb: dt_binding_check include/config/kernel.release scripts_dtc
+       $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ $(dtstree)/$*.dt.yaml
 
 %.dtbo: include/config/kernel.release scripts_dtc
        $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@

Why didn't you change the %.dtbo part?

Quoted 12 lines
Makefile +1 -2
@@ -1409,7 +1409,7 @@ PHONY += dtbs dtbs_install dtbs_check
 dtbs: include/config/kernel.release scripts_dtc
        $(Q)$(MAKE) $(build)=$(dtstree)
 
-ifneq ($(filter dtbs_check, $(MAKECMDGOALS)),)
+ifneq ($(filter dtbs_check %.dtb, $(MAKECMDGOALS)),)
 export CHECK_DTBS=y
 dtbs: dt_binding_check
 endif
--

2.30.2

Signature · 2 lines
Best Regards
Masahiro Yamada
#2 lore raw
Quoted 36 lines · Masahiro Yamada
Quoted 34 lines · Rob Herring

It is possible to build a single dtb, but not with DT schema validation enabled. Enable the schema validation to run for %.dtb targets. Anyone building a dtb for a specific platform *should* pay attention to schema warnings.

This could be supported with a separate %.dt.yaml target instead. However, the .dt.yaml format is considered an intermediate format and could possibly go away at some point if schema checking is integrated into dtc. Also, the plan is to enable the schema checks by default once platforms are free of warnings, and this is a move in that direction.

Cc Dmitry Baryshkov <[email protected]>
Cc Tom Rini <[email protected]>
Cc Masahiro Yamada <[email protected]>
---
 Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Makefile +2 -2
index ec9e8a0fe298..01b888cfe1dc 100644
@@ -1399,8 +1399,8 @@ endif
 
 ifneq ($(dtstree),)
 
-%.dtb: include/config/kernel.release scripts_dtc
-       $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
+%.dtb: dt_binding_check include/config/kernel.release scripts_dtc
+       $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ $(dtstree)/$*.dt.yaml
 
Quoted 5 lines

Makefile endif · line 1406

Quoted 2 lines
Makefile +0 -0
 %.dtbo: include/config/kernel.release scripts_dtc
        $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@

Why didn't you change the %.dtbo part?

Right, it should.

Rob