xref: /linux/Documentation/devicetree/bindings/net/ethernet-switch.yaml (revision ab1c247094e323177a578b38f0325bf79f0317ac)
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-9a-f]+$":
40        type: object
41        description: Ethernet switch ports
42
43    required:
44      - "#address-cells"
45      - "#size-cells"
46
47oneOf:
48  - required:
49      - ports
50  - required:
51      - ethernet-ports
52
53additionalProperties: true
54
55$defs:
56  ethernet-ports:
57    description: An ethernet switch without any extra port properties
58    $ref: '#'
59
60    patternProperties:
61      "^(ethernet-)?ports$":
62        patternProperties:
63          "^(ethernet-)?port@[0-9a-f]+$":
64            description: Ethernet switch ports
65            $ref: ethernet-switch-port.yaml#
66            unevaluatedProperties: false
67
68...
69