aboutsummaryrefslogtreecommitdiff
path: root/dts/upstream/Bindings/net/ethernet-switch.yaml
blob: b3b7e1a1b1278711678c11b620e15ea69e8b731d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/ethernet-switch.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Generic Ethernet Switch

maintainers:
  - Andrew Lunn <andrew@lunn.ch>
  - Florian Fainelli <f.fainelli@gmail.com>
  - Vladimir Oltean <olteanv@gmail.com>

description:
  Ethernet switches are multi-port Ethernet controllers. Each port has
  its own number and is represented as its own Ethernet controller.
  The minimum required functionality is to pass packets to software.
  They may or may not be able to forward packets automonously between
  ports.

select: false

allOf:
  # This condition is here to satisfy the case where certain device
  # nodes have to preserve non-standard names because of
  # backward-compatibility with boot loaders inspecting certain
  # node names.
  - if:
      properties:
        compatible:
          contains:
            enum:
              - marvell,turris-mox-mv88e6085
              - marvell,turris-mox-mv88e6190
    then:
      properties:
        $nodename:
          pattern: "switch[0-3]@[0-3]+$"
    else:
      properties:
        $nodename:
          pattern: "^(ethernet-)?switch(@.*)?$"

patternProperties:
  "^(ethernet-)?ports$":
    type: object
    unevaluatedProperties: false

    properties:
      '#address-cells':
        const: 1
      '#size-cells':
        const: 0

    patternProperties:
      "^(ethernet-)?port@[0-9a-f]+$":
        type: object
        description: Ethernet switch ports

    required:
      - "#address-cells"
      - "#size-cells"

oneOf:
  - required:
      - ports
  - required:
      - ethernet-ports

additionalProperties: true

$defs:
  ethernet-ports:
    description: An ethernet switch without any extra port properties
    $ref: '#'

    patternProperties:
      "^(ethernet-)?ports$":
        patternProperties:
          "^(ethernet-)?port@[0-9a-f]+$":
            description: Ethernet switch ports
            $ref: ethernet-switch-port.yaml#
            unevaluatedProperties: false

...