[1/3] dt-bindings: arm: coresight: restrict single port subnodes
Commit Message
"in-ports" and "out-ports" with single "port" subnode should use
"additionalProperties: false" to disallow any other properties mentioned
by graph schema which are not applicable for this case, e.g.
"address-cells".
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
.../devicetree/bindings/arm/arm,coresight-dummy-sink.yaml | 1 +
.../devicetree/bindings/arm/arm,coresight-dummy-source.yaml | 1 +
Documentation/devicetree/bindings/arm/qcom,coresight-tpda.yaml | 1 +
Documentation/devicetree/bindings/arm/qcom,coresight-tpdm.yaml | 1 +
4 files changed, 4 insertions(+)
Comments
On Wed, Dec 06, 2023 at 12:53:30PM +0100, Krzysztof Kozlowski wrote:
> "in-ports" and "out-ports" with single "port" subnode should use
> "additionalProperties: false" to disallow any other properties mentioned
> by graph schema which are not applicable for this case, e.g.
> "address-cells".
The graph schema should already check this case with this subschema:
oneOf:
- required:
- port
- required:
- "#address-cells"
- "#size-cells"
However, I now see this would allow port and #address-cells if
#size-cells is omitted. (#address-cells is a dependency for
##size-cells, but not vice-versa because interrupt-controllers can have
##just #address-cells). Perhaps this should instead be:
oneOf:
- required:
- port
- anyOf:
- required:
- "#address-cells"
- required:
- "#size-cells"
We're missing a similar check on endpoint. Or I'm forgetting why I
didn't add it.
I suspect there are a lot more cases if we fixed these in the users.
Rob
@@ -41,6 +41,7 @@ properties:
in-ports:
$ref: /schemas/graph.yaml#/properties/ports
+ additionalProperties: false
properties:
port:
@@ -40,6 +40,7 @@ properties:
out-ports:
$ref: /schemas/graph.yaml#/properties/ports
+ additionalProperties: false
properties:
port:
@@ -76,6 +76,7 @@ properties:
description: |
Output connections from the TPDA to legacy CoreSight trace bus.
$ref: /schemas/graph.yaml#/properties/ports
+ additionalProperties: false
properties:
port:
@@ -72,6 +72,7 @@ properties:
description: |
Output connections from the TPDM to coresight funnel/TPDA.
$ref: /schemas/graph.yaml#/properties/ports
+ additionalProperties: false
properties:
port: