-
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 should 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
418 additions
and
16 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
59 changes: 59 additions & 0 deletions
59
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,59 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# Copyright (c) 2023 Christophe Dufaza <[email protected]> | ||
|
||
description: | | ||
Extends allow-and-blocklist-multilevel.yaml test case. | ||
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: | ||
cb-prop: | ||
type: int | ||
|
||
child-binding: | ||
properties: | ||
gcbb-prop: | ||
type: int |
34 changes: 34 additions & 0 deletions
34
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,34 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# Copyright (c) 2023 Christophe Dufaza <[email protected]> | ||
|
||
description: | | ||
Extends include.yaml with an additional property | ||
for testing grandchild-binding filters. | ||
See digest.yaml. | ||
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 |
18 changes: 18 additions & 0 deletions
18
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,18 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# Copyright (c) 2023 Christophe Dufaza <[email protected]> | ||
|
||
description: | | ||
Left include file for the multi-includes test case. | ||
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 |
31 changes: 31 additions & 0 deletions
31
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,31 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# Copyright (c) 2023 Christophe Dufaza <[email protected]> | ||
|
||
description: | | ||
Test multi-includes from top-level binding. | ||
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-right-prop: | ||
type: int | ||
|
||
child-binding: | ||
properties: | ||
child-prop: | ||
type: int | ||
child-binding: | ||
properties: | ||
grandchild-prop: | ||
type: int |
18 changes: 18 additions & 0 deletions
18
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,18 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# Copyright (c) 2023 Christophe Dufaza <[email protected]> | ||
|
||
description: | | ||
Right include file for the multi-includes test case. | ||
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.