Re: [PATCH 1/1] dt-bindings: riscv: sifive-l2-cache: convert bindings to json-schema

From: Rob Herring
Date: Mon Aug 24 2020 - 13:36:16 EST


On Mon, 24 Aug 2020 13:20:21 +0530, Sagar Kadam wrote:
> Convert the device tree bindings for the SiFive's FU540-C000 SoC's L2 Cache
> controller to YAML format.
>
> Signed-off-by: Sagar Kadam <sagar.kadam@xxxxxxxxxx>
> ---
> .../devicetree/bindings/riscv/sifive-l2-cache.txt | 51 ------------
> .../devicetree/bindings/riscv/sifive-l2-cache.yaml | 93 ++++++++++++++++++++++
> 2 files changed, 93 insertions(+), 51 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/riscv/sifive-l2-cache.txt
> create mode 100644 Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
>


My bot found errors running 'make dt_binding_check' on your patch:

/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.example.dt.yaml: l2-cache: $nodename:0: 'l2-cache' does not match '^(cache-controller|cpu)(@[0-9a-f,]+)*$'
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.example.dt.yaml: l2-cache: compatible:0: 'cache' is not one of ['sifive,fu540-c000-ccache']
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.example.dt.yaml: l2-cache: compatible: ['cache'] is too short
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.example.dt.yaml: l2-cache: 'l3-cache' does not match any of the regexes: 'pinctrl-[0-9]+'
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.example.dt.yaml: l2-cache: 'cache-block-size' is a required property
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.example.dt.yaml: l2-cache: 'cache-level' is a required property
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.example.dt.yaml: l2-cache: 'cache-sets' is a required property
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.example.dt.yaml: l2-cache: 'cache-size' is a required property
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.example.dt.yaml: l2-cache: 'cache-unified' is a required property
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.example.dt.yaml: l2-cache: 'reg' is a required property
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.example.dt.yaml: l2-cache: {'compatible': ['cache'], 'next-level-cache': [[2]], 'phandle': [[1]], 'l3-cache': {'compatible': ['cache'], 'phandle': [[2]]}, '$nodename': ['l2-cache']} is not valid under any of the given schemas
{'$filename': '/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml',
'$id': 'http://devicetree.org/schemas/riscv/sifive-l2-cache.yaml#',
'$schema': 'http://devicetree.org/meta-schemas/core.yaml#',
'$select_validator': <jsonschema.validators.create.<locals>.Validator object at 0x7efcd84bc850>,
'additionalProperties': False,
'allOf': [{'$ref': '/schemas/cache-controller.yaml#'}],
'oneOf': [{'required': ['interrupts']},
{'required': ['interrupts-extended']}],
'patternProperties': {'pinctrl-[0-9]+': True},
'properties': {'$nodename': True,
'cache-block-size': {'additionalItems': False,
'items': [{'additionalItems': False,
'items': [{'const': 64}],
'maxItems': 1,
'minItems': 1,
'type': 'array'}],
'maxItems': 1,
'minItems': 1,
'type': 'array'},
'cache-level': {'additionalItems': False,
'items': [{'additionalItems': False,
'items': [{'const': 2}],
'maxItems': 1,
'minItems': 1,
'type': 'array'}],
'maxItems': 1,
'minItems': 1,
'type': 'array'},
'cache-sets': {'additionalItems': False,
'items': [{'additionalItems': False,
'items': [{'const': 1024}],
'maxItems': 1,
'minItems': 1,
'type': 'array'}],
'maxItems': 1,
'minItems': 1,
'type': 'array'},
'cache-size': {'additionalItems': False,
'items': [{'additionalItems': False,
'items': [{'const': 2097152}],
'maxItems': 1,
'minItems': 1,
'type': 'array'}],
'maxItems': 1,
'minItems': 1,
'type': 'array'},
'cache-unified': True,
'compatible': {'additionalItems': False,
'items': [{'enum': ['sifive,fu540-c000-ccache']},
{'const': 'cache'}],
'maxItems': 2,
'minItems': 2,
'type': 'array'},
'interrupt-parent': True,
'interrupts': {'maxItems': 3, 'minItems': 1},
'interrupts-extended': {'maxItems': 3, 'minItems': 1},
'memory-region': {},
'next-level-cache': {},
'phandle': True,
'pinctrl-names': True,
'reg': {'maxItems': 1, 'minItems': 1},
'status': True},
'required': ['compatible',
'cache-block-size',
'cache-level',
'cache-sets',
'cache-size',
'cache-unified',
'reg'],
'select': {'properties': {'compatible': {'contains': {'enum': ['cache',
'sifive,fu540-c000-ccache']}}},
'required': ['compatible']},
'title': 'SiFive L2 Cache Controller'} (Possible causes of the failure):
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.example.dt.yaml: l2-cache: 'interrupts' is a required property

From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.example.dt.yaml: l3-cache: $nodename:0: 'l3-cache' does not match '^(cache-controller|cpu)(@[0-9a-f,]+)*$'
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.example.dt.yaml: l3-cache: compatible:0: 'cache' is not one of ['sifive,fu540-c000-ccache']
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.example.dt.yaml: l3-cache: compatible: ['cache'] is too short
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.example.dt.yaml: l3-cache: 'cache-block-size' is a required property
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.example.dt.yaml: l3-cache: 'cache-level' is a required property
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.example.dt.yaml: l3-cache: 'cache-sets' is a required property
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.example.dt.yaml: l3-cache: 'cache-size' is a required property
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.example.dt.yaml: l3-cache: 'cache-unified' is a required property
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.example.dt.yaml: l3-cache: 'reg' is a required property
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.example.dt.yaml: l3-cache: {'compatible': ['cache'], 'phandle': [[2]], '$nodename': ['l3-cache']} is not valid under any of the given schemas
{'$filename': '/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml',
'$id': 'http://devicetree.org/schemas/riscv/sifive-l2-cache.yaml#',
'$schema': 'http://devicetree.org/meta-schemas/core.yaml#',
'$select_validator': <jsonschema.validators.create.<locals>.Validator object at 0x7efcd84bc850>,
'additionalProperties': False,
'allOf': [{'$ref': '/schemas/cache-controller.yaml#'}],
'oneOf': [{'required': ['interrupts']},
{'required': ['interrupts-extended']}],
'patternProperties': {'pinctrl-[0-9]+': True},
'properties': {'$nodename': True,
'cache-block-size': {'additionalItems': False,
'items': [{'additionalItems': False,
'items': [{'const': 64}],
'maxItems': 1,
'minItems': 1,
'type': 'array'}],
'maxItems': 1,
'minItems': 1,
'type': 'array'},
'cache-level': {'additionalItems': False,
'items': [{'additionalItems': False,
'items': [{'const': 2}],
'maxItems': 1,
'minItems': 1,
'type': 'array'}],
'maxItems': 1,
'minItems': 1,
'type': 'array'},
'cache-sets': {'additionalItems': False,
'items': [{'additionalItems': False,
'items': [{'const': 1024}],
'maxItems': 1,
'minItems': 1,
'type': 'array'}],
'maxItems': 1,
'minItems': 1,
'type': 'array'},
'cache-size': {'additionalItems': False,
'items': [{'additionalItems': False,
'items': [{'const': 2097152}],
'maxItems': 1,
'minItems': 1,
'type': 'array'}],
'maxItems': 1,
'minItems': 1,
'type': 'array'},
'cache-unified': True,
'compatible': {'additionalItems': False,
'items': [{'enum': ['sifive,fu540-c000-ccache']},
{'const': 'cache'}],
'maxItems': 2,
'minItems': 2,
'type': 'array'},
'interrupt-parent': True,
'interrupts': {'maxItems': 3, 'minItems': 1},
'interrupts-extended': {'maxItems': 3, 'minItems': 1},
'memory-region': {},
'next-level-cache': {},
'phandle': True,
'pinctrl-names': True,
'reg': {'maxItems': 1, 'minItems': 1},
'status': True},
'required': ['compatible',
'cache-block-size',
'cache-level',
'cache-sets',
'cache-size',
'cache-unified',
'reg'],
'select': {'properties': {'compatible': {'contains': {'enum': ['cache',
'sifive,fu540-c000-ccache']}}},
'required': ['compatible']},
'title': 'SiFive L2 Cache Controller'} (Possible causes of the failure):
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.example.dt.yaml: l3-cache: 'interrupts' is a required property

From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/power/renesas,rcar-sysc.example.dt.yaml: cache-controller-0: $nodename:0: 'cache-controller-0' does not match '^(cache-controller|cpu)(@[0-9a-f,]+)*$'
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/power/renesas,rcar-sysc.example.dt.yaml: cache-controller-0: compatible:0: 'cache' is not one of ['sifive,fu540-c000-ccache']
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/power/renesas,rcar-sysc.example.dt.yaml: cache-controller-0: compatible: ['cache'] is too short
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/power/renesas,rcar-sysc.example.dt.yaml: cache-controller-0: 'power-domains' does not match any of the regexes: 'pinctrl-[0-9]+'
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/power/renesas,rcar-sysc.example.dt.yaml: cache-controller-0: 'cache-block-size' is a required property
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/power/renesas,rcar-sysc.example.dt.yaml: cache-controller-0: 'cache-sets' is a required property
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/power/renesas,rcar-sysc.example.dt.yaml: cache-controller-0: 'cache-size' is a required property
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/power/renesas,rcar-sysc.example.dt.yaml: cache-controller-0: 'reg' is a required property
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/power/renesas,rcar-sysc.example.dt.yaml: cache-controller-0: {'compatible': ['cache'], 'power-domains': [[1, 12]], 'cache-unified': True, 'cache-level': [[2]], '$nodename': ['cache-controller-0']} is not valid under any of the given schemas
{'$filename': '/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml',
'$id': 'http://devicetree.org/schemas/riscv/sifive-l2-cache.yaml#',
'$schema': 'http://devicetree.org/meta-schemas/core.yaml#',
'$select_validator': <jsonschema.validators.create.<locals>.Validator object at 0x7f26dd3928b0>,
'additionalProperties': False,
'allOf': [{'$ref': '/schemas/cache-controller.yaml#'}],
'oneOf': [{'required': ['interrupts']},
{'required': ['interrupts-extended']}],
'patternProperties': {'pinctrl-[0-9]+': True},
'properties': {'$nodename': True,
'cache-block-size': {'additionalItems': False,
'items': [{'additionalItems': False,
'items': [{'const': 64}],
'maxItems': 1,
'minItems': 1,
'type': 'array'}],
'maxItems': 1,
'minItems': 1,
'type': 'array'},
'cache-level': {'additionalItems': False,
'items': [{'additionalItems': False,
'items': [{'const': 2}],
'maxItems': 1,
'minItems': 1,
'type': 'array'}],
'maxItems': 1,
'minItems': 1,
'type': 'array'},
'cache-sets': {'additionalItems': False,
'items': [{'additionalItems': False,
'items': [{'const': 1024}],
'maxItems': 1,
'minItems': 1,
'type': 'array'}],
'maxItems': 1,
'minItems': 1,
'type': 'array'},
'cache-size': {'additionalItems': False,
'items': [{'additionalItems': False,
'items': [{'const': 2097152}],
'maxItems': 1,
'minItems': 1,
'type': 'array'}],
'maxItems': 1,
'minItems': 1,
'type': 'array'},
'cache-unified': True,
'compatible': {'additionalItems': False,
'items': [{'enum': ['sifive,fu540-c000-ccache']},
{'const': 'cache'}],
'maxItems': 2,
'minItems': 2,
'type': 'array'},
'interrupt-parent': True,
'interrupts': {'maxItems': 3, 'minItems': 1},
'interrupts-extended': {'maxItems': 3, 'minItems': 1},
'memory-region': {},
'next-level-cache': {},
'phandle': True,
'pinctrl-names': True,
'reg': {'maxItems': 1, 'minItems': 1},
'status': True},
'required': ['compatible',
'cache-block-size',
'cache-level',
'cache-sets',
'cache-size',
'cache-unified',
'reg'],
'select': {'properties': {'compatible': {'contains': {'enum': ['cache',
'sifive,fu540-c000-ccache']}}},
'required': ['compatible']},
'title': 'SiFive L2 Cache Controller'} (Possible causes of the failure):
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/power/renesas,rcar-sysc.example.dt.yaml: cache-controller-0: 'interrupts' is a required property

From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml


See https://patchwork.ozlabs.org/patch/1350111

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure dt-schema is up to date:

pip3 install git+https://github.com/devicetree-org/dt-schema.git@master --upgrade

Please check and re-submit.