1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/net/ethernet-switch.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Generic Ethernet Switch
8
9maintainers:
10  - Andrew Lunn <andrew@lunn.ch>
11  - Florian Fainelli <f.fainelli@gmail.com>
12  - Vladimir Oltean <olteanv@gmail.com>
13
14description:
15  Ethernet switches are multi-port Ethernet controllers. Each port has
16  its own number and is represented as its own Ethernet controller.
17  The minimum required functionality is to pass packets to software.
18  They may or may not be able to forward packets automonously between
19  ports.
20
21select: false
22
23properties:
24  $nodename:
25    pattern: "^(ethernet-)?switch(@.*)?$"
26
27patternProperties:
28  "^(ethernet-)?ports$":
29    type: object
30    unevaluatedProperties: false
31
32    properties:
33      '#address-cells':
34        const: 1
35      '#size-cells':
36        const: 0
37
38    patternProperties:
39      "^(ethernet-)?port@[0-9]+$":
40        type: object
41        description: Ethernet switch ports
42
43oneOf:
44  - required:
45      - ports
46  - required:
47      - ethernet-ports
48
49additionalProperties: true
50
51$defs:
52  base:
53    description: An ethernet switch without any extra port properties
54    $ref: '#/'
55
56    patternProperties:
57      "^(ethernet-)?port@[0-9]+$":
58        description: Ethernet switch ports
59        $ref: ethernet-switch-port.yaml#
60        unevaluatedProperties: false
61
62...
63