Skip to content

Commit

Permalink
schemas: bootph: Add check for bootph tags in parent nodes
Browse files Browse the repository at this point in the history
When a node has boot phase tags, the parent node is implicitly included
and a bootph tag is not needed. Add a schema to check for and disallow
bootph tags in both parent and child nodes. It's not the greatest logic
and resulting error message, but that's what works for json-schema.

Signed-off-by: Rob Herring <robh@kernel.org>
  • Loading branch information
robherring committed Feb 21, 2023
1 parent bb4b09d commit 53ca8c9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions dtschema/schemas/bootph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,23 @@ properties:
description:
Include this node in all phases (for U-Boot see enum u_boot_phase).

allOf:
- if:
anyOf:
- required: [ bootph-pre-sram ]
- required: [ bootph-verify ]
- required: [ bootph-pre-ram ]
- required: [ bootph-some-ram ]
- required: [ bootph-all ]
then:
description: Parent nodes don't need bootph tags
patternProperties:
'.*':
properties:
bootph-pre-sram: false
bootph-verify: false
bootph-pre-ram: false
bootph-some-ram: false
bootph-all: false

additionalProperties: true

0 comments on commit 53ca8c9

Please sign in to comment.