| 1 | |
| 2 | |
| 3 | %YAML 1.2
|
| 4 | ---
|
| 5 | |
| 6 | |
| 7 |
|
| 8 | |
| 9 | |
| 10 | $id: http://devicetree.org/schemas/example-schema.yaml#
|
| 11 | |
| 12 | $schema: http://devicetree.org/meta-schemas/core.yaml#
|
| 13 |
|
| 14 | title: An Example Device
|
| 15 |
|
| 16 | maintainers:
|
| 17 | - Rob Herring <[email protected]>
|
| 18 |
|
| 19 | description: |
|
| 20 | A more detailed multi-line description of the binding.
|
| 21 |
|
| 22 | Details about the hardware device and any links to datasheets can go here.
|
| 23 |
|
| 24 | Literal blocks are marked with the '|' at the beginning. The end is marked by
|
| 25 | indentation less than the first line of the literal block. Lines also cannot
|
| 26 | begin with a tab character.
|
| 27 |
|
| 28 | select: false
|
| 29 | |
| 30 | |
| 31 | |
| 32 |
|
| 33 | |
| 34 |
|
| 35 | properties:
|
| 36 | |
| 37 | compatible:
|
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | oneOf:
|
| 44 | - items:
|
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | - enum:
|
| 52 | - vendor,soc4-ip
|
| 53 | - vendor,soc3-ip
|
| 54 | - vendor,soc2-ip
|
| 55 | - const: vendor,soc1-ip
|
| 56 | |
| 57 | |
| 58 | - items:
|
| 59 | |
| 60 | - const: vendor,soc1-ip
|
| 61 |
|
| 62 | reg:
|
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | items:
|
| 68 | - description: core registers
|
| 69 | - description: aux registers
|
| 70 | |
| 71 |
|
| 72 | reg-names:
|
| 73 | |
| 74 | items:
|
| 75 | - const: core
|
| 76 | - const: aux
|
| 77 |
|
| 78 | clocks:
|
| 79 | |
| 80 | maxItems: 1
|
| 81 | description: bus clock. A description is only needed for a single item if
|
| 82 | there's something unique to add.
|
| 83 | The items should have a fixed order, so pattern matching names are
|
| 84 | discouraged.
|
| 85 |
|
| 86 | clock-names:
|
| 87 | |
| 88 | |
| 89 | |
| 90 | items:
|
| 91 | - const: bus
|
| 92 |
|
| 93 | interrupts:
|
| 94 | |
| 95 | minItems: 1
|
| 96 | items:
|
| 97 | - description: tx or combined interrupt
|
| 98 | - description: rx interrupt
|
| 99 | description:
|
| 100 | A variable number of interrupts warrants a description of what conditions
|
| 101 | affect the number of interrupts. Otherwise, descriptions on standard
|
| 102 | properties are not necessary.
|
| 103 | The items should have a fixed order, so pattern matching names are
|
| 104 | discouraged.
|
| 105 |
|
| 106 | interrupt-names:
|
| 107 | |
| 108 | minItems: 1
|
| 109 | items:
|
| 110 | - const: tx irq
|
| 111 | - const: rx irq
|
| 112 |
|
| 113 | |
| 114 | '#interrupt-cells':
|
| 115 | |
| 116 | |
| 117 | const: 2
|
| 118 |
|
| 119 | interrupt-controller: true
|
| 120 | |
| 121 | |
| 122 |
|
| 123 | clock-frequency:
|
| 124 | |
| 125 | |
| 126 | minimum: 100
|
| 127 | maximum: 400000
|
| 128 | |
| 129 | default: 200
|
| 130 |
|
| 131 | foo-gpios:
|
| 132 | maxItems: 1
|
| 133 | description: A connection of the 'foo' gpio line.
|
| 134 |
|
| 135 | |
| 136 | foo-supply: true
|
| 137 |
|
| 138 | |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | vendor,int-property:
|
| 144 | description: Vendor-specific properties must have a description
|
| 145 | $ref: /schemas/types.yaml#/definitions/uint32
|
| 146 | enum: [2, 4, 6, 8, 10]
|
| 147 |
|
| 148 | vendor,bool-property:
|
| 149 | description: Vendor-specific properties must have a description. Boolean
|
| 150 | properties are one case where the json-schema 'type' keyword can be used
|
| 151 | directly.
|
| 152 | type: boolean
|
| 153 |
|
| 154 | vendor,string-array-property:
|
| 155 | description: Vendor-specific properties should reference a type in the
|
| 156 | core schema.
|
| 157 | $ref: /schemas/types.yaml#/definitions/string-array
|
| 158 | items:
|
| 159 | - enum: [foo, bar]
|
| 160 | - enum: [baz, boo]
|
| 161 |
|
| 162 | vendor,property-in-standard-units-microvolt:
|
| 163 | description: Vendor-specific properties having a standard unit suffix
|
| 164 | don't need a type.
|
| 165 | enum: [ 100, 200, 300 ]
|
| 166 |
|
| 167 | vendor,int-array-variable-length-and-constrained-values:
|
| 168 | description: Array might define what type of elements might be used (e.g.
|
| 169 | their range).
|
| 170 | $ref: /schemas/types.yaml#/definitions/uint32-array
|
| 171 | minItems: 2
|
| 172 | maxItems: 3
|
| 173 | items:
|
| 174 | minimum: 0
|
| 175 | maximum: 8
|
| 176 |
|
| 177 | child-node:
|
| 178 | description: Child nodes are just another property from a json-schema
|
| 179 | perspective.
|
| 180 | type: object |
| 181 | |
| 182 | |
| 183 | |
| 184 | additionalProperties: false
|
| 185 | properties:
|
| 186 | vendor,a-child-node-property:
|
| 187 | description: Child node properties have all the same schema
|
| 188 | requirements.
|
| 189 | type: boolean
|
| 190 |
|
| 191 | required:
|
| 192 | - vendor,a-child-node-property
|
| 193 |
|
| 194 | child-node-with-own-schema:
|
| 195 | description: |
|
| 196 | Child node with their own compatible and device schema which ends in
|
| 197 | 'additionalProperties: false' or 'unevaluatedProperties: false' can
|
| 198 | mention only the compatible and use here 'additionalProperties: true'.
|
| 199 | type: object
|
| 200 | additionalProperties: true
|
| 201 | properties:
|
| 202 | compatible:
|
| 203 | const: vendor,sub-device
|
| 204 |
|
| 205 | |
| 206 | dependencies:
|
| 207 | |
| 208 | |
| 209 | vendor,bool-property: [ 'vendor,string-array-property' ]
|
| 210 | |
| 211 | |
| 212 | vendor,string-array-property: [ 'vendor,bool-property' ]
|
| 213 |
|
| 214 | required:
|
| 215 | - compatible
|
| 216 | - reg
|
| 217 | - interrupts
|
| 218 | - interrupt-controller
|
| 219 |
|
| 220 | |
| 221 | |
| 222 | |
| 223 | |
| 224 | |
| 225 | |
| 226 | |
| 227 | |
| 228 | allOf:
|
| 229 | - if:
|
| 230 | properties:
|
| 231 | compatible:
|
| 232 | contains:
|
| 233 | const: vendor,soc2-ip
|
| 234 | then:
|
| 235 | required:
|
| 236 | - foo-supply
|
| 237 | else:
|
| 238 | |
| 239 | properties:
|
| 240 | foo-supply: false
|
| 241 | |
| 242 | |
| 243 | - if:
|
| 244 | required:
|
| 245 | - vendor,bool-property
|
| 246 | then:
|
| 247 | properties:
|
| 248 | vendor,int-property:
|
| 249 | enum: [2, 4, 6]
|
| 250 |
|
| 251 | |
| 252 | |
| 253 | |
| 254 | |
| 255 | |
| 256 | |
| 257 | |
| 258 | |
| 259 | |
| 260 | additionalProperties: false
|
| 261 |
|
| 262 | examples:
|
| 263 | |
| 264 | |
| 265 | |
| 266 | |
| 267 | |
| 268 | |
| 269 | |
| 270 | - |
|
| 271 | node@1000 {
|
| 272 | compatible = "vendor,soc4-ip", "vendor,soc1-ip";
|
| 273 | reg = <0x1000 0x80>,
|
| 274 | <0x3000 0x80>;
|
| 275 | reg-names = "core", "aux";
|
| 276 | interrupts = <10>;
|
| 277 | interrupt-controller;
|
| 278 | #interrupt-cells = <2>;
|
| 279 | };
|