-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
edtlib: preserve paths of properties from included child-bindings
All child bindings are initialized at once after included binding files have been merged, with the top-level binding file set as their origin. As a consequence, properties of child bindings appear to all come from ("last modified" semantic) the top-level file. For example, properties of a channel child of an ADC controller with compatible "nordic,nrf-saadc" will all appear last modified by nordic,nrf-saadc.yaml instead of adc-controller.yaml. We can use the same approach we've already come to for property specifications: - #65135 - #65221 Signed-off-by: Christophe Dufaza <[email protected]>
- Loading branch information
Showing
7 changed files
with
483 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
scripts/dts/python-devicetree/tests/test-bindings-include/digest.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
description: | | ||
Extends allow-and-blocklist-multilevel.yaml test case, adds: | ||
- check of bindings and property specs paths | ||
- check of grand-grandchild-binding level | ||
- check grandchild-binding filters | ||
- check setting "required: true" won't truncate included | ||
child-binding's property definitions | ||
All child-binding definitions come from a single file, | ||
included multiple times, at different levels, | ||
with different filters. | ||
compatible: vnd,digest | ||
|
||
# child-binding: | ||
# + child-prop-1 | ||
# | ||
# grandchild-binding: | ||
# + gandchild-prop-1 | ||
# + gandchild-prop-2 | ||
include: | ||
- name: digest_base.yaml | ||
property-allowlist: [x] | ||
|
||
child-binding: | ||
property-allowlist: [child-prop-1] | ||
|
||
child-binding: | ||
property-blocklist: [grandchild-prop-blocked] | ||
|
||
properties: | ||
top-prop: | ||
type: int | ||
|
||
child-binding: | ||
include: | ||
# child-binding: | ||
# ~ child-prop-1 | ||
# + x | ||
# + z | ||
- name: digest_base.yaml | ||
property-blocklist: [y] | ||
|
||
# grandchild-binding: | ||
# ~ gandchild-prop-1 | ||
# ~ gandchild-prop-2 | ||
# + child-prop-1 | ||
# + child-prop-1 | ||
child-binding: | ||
property-blocklist: [child-prop-blocked] | ||
|
||
# grandgrandchild-binding: | ||
# + gandchild-prop-1 | ||
# + gandchild-prop-2 | ||
child-binding: | ||
property-blocklist: [grandchild-prop-blocked] | ||
|
||
properties: | ||
child-prop-1: | ||
required: true | ||
z: | ||
required: true | ||
cb-prop: | ||
type: int | ||
|
||
child-binding: | ||
properties: | ||
gcbb-prop: | ||
type: int |
30 changes: 30 additions & 0 deletions
30
scripts/dts/python-devicetree/tests/test-bindings-include/digest_base.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
description: | | ||
Base include file for the digest.yaml test case. | ||
properties: | ||
x: | ||
type: int | ||
y: | ||
type: int | ||
z: | ||
type: int | ||
|
||
child-binding: | ||
properties: | ||
child-prop-1: | ||
type: int | ||
child-prop-2: | ||
type: int | ||
child-prop-blocked: | ||
type: int | ||
|
||
child-binding: | ||
properties: | ||
grandchild-prop-1: | ||
type: int | ||
grandchild-prop-2: | ||
type: int | ||
grandchild-prop-blocked: | ||
type: int |
17 changes: 17 additions & 0 deletions
17
scripts/dts/python-devicetree/tests/test-bindings-include/left.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
description: | | ||
Left include file for left_rigt.yaml. | ||
properties: | ||
left-prop-1: | ||
type: int | ||
left-prop-2: | ||
type: int | ||
|
||
child-binding: | ||
properties: | ||
left-child-prop-1: | ||
type: int | ||
left-child-prop-2: | ||
type: int |
35 changes: 35 additions & 0 deletions
35
scripts/dts/python-devicetree/tests/test-bindings-include/left_right.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
description: | | ||
Complements digest.yaml test case, | ||
here child-binding definitions come from two files. | ||
compatible: vnd,left_right | ||
|
||
include: | ||
- name: left.yaml | ||
property-allowlist: [left-prop-1] | ||
child-binding: | ||
property-allowlist: [left-child-prop-1] | ||
|
||
- name: right.yaml | ||
property-allowlist: [right-prop-2] | ||
child-binding: | ||
property-allowlist: [right-child-prop-2] | ||
|
||
properties: | ||
left-prop-1: | ||
required: true | ||
left-right-prop: | ||
type: int | ||
|
||
child-binding: | ||
properties: | ||
left-child-prop-1: | ||
required: true | ||
child-prop: | ||
type: int | ||
child-binding: | ||
properties: | ||
grandchild-prop: | ||
type: int |
17 changes: 17 additions & 0 deletions
17
scripts/dts/python-devicetree/tests/test-bindings-include/right.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
description: | | ||
Right include file for left_rigt.yaml. | ||
properties: | ||
right-prop-1: | ||
type: int | ||
right-prop-2: | ||
type: int | ||
|
||
child-binding: | ||
properties: | ||
right-child-prop-1: | ||
type: int | ||
right-child-prop-2: | ||
type: int |
Oops, something went wrong.