| 1 |
# SPDX-License-Identifier: BSD-2-Clause |
| 2 |
# Copyright 2018 Linaro Ltd. |
| 3 |
# Copyright 2018-2019 Arm Ltd. |
| 4 |
%YAML 1.2 |
| 5 |
--- |
| 6 |
$id: http://devicetree.org/meta-schemas/core.yaml# |
| 7 |
$schema: https://json-schema.org/draft/2019-09/schema |
| 8 |
description: Metaschema for devicetree binding documentation |
| 9 |
|
| 10 |
allOf: |
| 11 |
- $ref: http://devicetree.org/meta-schemas/base.yaml# |
| 12 |
- description: Either unevaluatedProperties or additionalProperties must be present |
| 13 |
oneOf: |
| 14 |
- required: [ unevaluatedProperties ] |
| 15 |
- required: [ additionalProperties ] |
| 16 |
|
| 17 |
definitions: |
| 18 |
unit-suffix-properties: |
| 19 |
$ref: cell.yaml#/array |
| 20 |
propertyNames: |
| 21 |
description: Standard unit suffix properties don't need a type $ref |
| 22 |
not: |
| 23 |
const: $ref |
| 24 |
|
| 25 |
|
| 26 |
all-properties: |
| 27 |
allOf: |
| 28 |
- $ref: "#/definitions/core-properties" |
| 29 |
- $ref: clocks.yaml# |
| 30 |
- $ref: dma.yaml# |
| 31 |
- $ref: gpios.yaml# |
| 32 |
- $ref: hwlock.yaml# |
| 33 |
- $ref: iio.yaml# |
| 34 |
- $ref: interrupts.yaml# |
| 35 |
- $ref: iommu.yaml# |
| 36 |
- $ref: mailbox.yaml# |
| 37 |
- $ref: nvmem.yaml# |
| 38 |
- $ref: phy.yaml# |
| 39 |
- $ref: power-domain.yaml# |
| 40 |
- $ref: pwm.yaml# |
| 41 |
- $ref: reset.yaml# |
| 42 |
- $ref: mailbox.yaml# |
| 43 |
- $ref: vendor-props.yaml# |
| 44 |
core-properties: |
| 45 |
properties: |
| 46 |
ranges: |
| 47 |
$ref: cell.yaml#/array |
| 48 |
reg: |
| 49 |
$ref: cell.yaml#/array |
| 50 |
compatible: |
| 51 |
$ref: string-array.yaml |
| 52 |
$nodename: |
| 53 |
$ref: string-array.yaml |
| 54 |
memory-region: |
| 55 |
$ref: cell.yaml#/array |
| 56 |
memory-region-names: |
| 57 |
$ref: string-array.yaml |
| 58 |
patternProperties: |
| 59 |
'.*-names$': |
| 60 |
$ref: string-array.yaml |
| 61 |
|
| 62 |
'^#.*-cells$': |
| 63 |
$ref: cell.yaml#/single |
| 64 |
|
| 65 |
'-supply$': |
| 66 |
propertyNames: |
| 67 |
enum: [ description, deprecated ] |
| 68 |
|
| 69 |
'-(bits|bps|kBps|percent|bp|db|mhz|hz|sec|ms|us|ns|ps|mm|nanoamp|microamp(-hours)?|micro-ohms|microwatt-hours|microvolt|(femto|pico)farads|(milli)?celsius|kelvin|k?pascal)$': |
| 70 |
$ref: '#/definitions/unit-suffix-properties' |
| 71 |
|
| 72 |
# Some special cases which don't match the normal size. |
| 73 |
'(?<!ti,[xy]-plate)-ohms$': |
| 74 |
$ref: '#/definitions/unit-suffix-properties' |
| 75 |
|
| 76 |
# Really is "marvell,wakeup-gap-ms", but look-behind requires a fixed width pattern |
| 77 |
'(?<!(rvell,wakeup-gap|refresh-interval))-ms$': |
| 78 |
$ref: '#/definitions/unit-suffix-properties' |
| 79 |
|
| 80 |
'^.*$': |
| 81 |
properties: |
| 82 |
# 'boolean' and 'object' are the only native types allowed |
| 83 |
type: |
| 84 |
enum: [ boolean, object ] |
| 85 |
properties: |
| 86 |
$ref: "#/definitions/all-properties" |
| 87 |
patternProperties: |
| 88 |
$ref: "#/definitions/all-properties" |
| 89 |
$ref: |
| 90 |
pattern: '(#$|#\/)?' |
| 91 |
|
| 92 |
allOf: |
| 93 |
- if: |
| 94 |
type: object |
| 95 |
properties: |
| 96 |
type: |
| 97 |
const: object |
| 98 |
required: |
| 99 |
- type |
| 100 |
then: |
| 101 |
$ref: nodes.yaml# |
| 102 |
- if: |
| 103 |
required: [ properties ] |
| 104 |
then: |
| 105 |
description: node schemas must have a type or $ref |
| 106 |
anyOf: |
| 107 |
- required: [ type ] |
| 108 |
- required: [ $ref ] |
| 109 |
|
| 110 |
dependentRequired: |
| 111 |
"#size-cells": [ "#address-cells" ] |
| 112 |
memory-region-names: [ memory-region ] |
| 113 |
reg-names: [ reg ] |
| 114 |
|
| 115 |
properties: |
| 116 |
patternProperties: |
| 117 |
$ref: "#/definitions/all-properties" |
| 118 |
properties: |
| 119 |
$ref: "#/definitions/all-properties" |
| 120 |
allOf: |
| 121 |
items: |
| 122 |
properties: |
| 123 |
properties: |
| 124 |
$ref: "#/definitions/all-properties" |
| 125 |
patternProperties: |
| 126 |
$ref: "#/definitions/all-properties" |
| 127 |
anyOf: |
| 128 |
items: |
| 129 |
properties: |
| 130 |
properties: |
| 131 |
$ref: "#/definitions/all-properties" |
| 132 |
patternProperties: |
| 133 |
$ref: "#/definitions/all-properties" |
| 134 |
oneOf: |
| 135 |
items: |
| 136 |
properties: |
| 137 |
properties: |
| 138 |
$ref: "#/definitions/all-properties" |
| 139 |
patternProperties: |
| 140 |
$ref: "#/definitions/all-properties" |
| 141 |
if: |
| 142 |
properties: |
| 143 |
properties: |
| 144 |
$ref: "#/definitions/all-properties" |
| 145 |
patternProperties: |
| 146 |
$ref: "#/definitions/all-properties" |
| 147 |
|
| 148 |
anyOf: |
| 149 |
- required: |
| 150 |
- properties |
| 151 |
- required: |
| 152 |
- patternProperties |