From 53ca8c9554c445cadaae02f030b56211f39d8c44 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Tue, 21 Feb 2023 11:57:12 -0600 Subject: [PATCH] schemas: bootph: Add check for bootph tags in parent nodes 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 --- dtschema/schemas/bootph.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/dtschema/schemas/bootph.yaml b/dtschema/schemas/bootph.yaml index a3ccf06e..681c7977 100644 --- a/dtschema/schemas/bootph.yaml +++ b/dtschema/schemas/bootph.yaml @@ -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