Commit 3cec368a authored by Colin Foster's avatar Colin Foster Committed by David S. Miller

dt-bindings: net: dsa: utilize base definitions for standard dsa switches

DSA switches can fall into one of two categories: switches where all ports
follow standard '(ethernet-)?port' properties, and switches that have
additional properties for the ports.

The scenario where DSA ports are all standardized can be handled by
switches with a reference to the new 'dsa.yaml#/$defs/ethernet-ports'.

The scenario where DSA ports require additional properties can reference
'$dsa.yaml#' directly. This will allow switches to reference these standard
definitions of the DSA switch, but add additional properties under the port
nodes.
Suggested-by: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarColin Foster <colin.foster@in-advantage.com>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Reviewed-by: default avatarRob Herring <robh@kernel.org>
Acked-by: Alvin Šipraga <alsi@bang-olufsen.dk> # realtek
Acked-by: default avatarArınç ÜNAL <arinc.unal@arinc9.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 54890925
......@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Arrow SpeedChips XRS7000 Series Switch
allOf:
- $ref: dsa.yaml#
- $ref: dsa.yaml#/$defs/ethernet-ports
maintainers:
- George McCollister <george.mccollister@gmail.com>
......
......@@ -66,7 +66,7 @@ required:
- reg
allOf:
- $ref: dsa.yaml#
- $ref: dsa.yaml#/$defs/ethernet-ports
- if:
properties:
compatible:
......
......@@ -58,4 +58,26 @@ oneOf:
additionalProperties: true
$defs:
ethernet-ports:
description: A DSA switch without any extra port properties
$ref: '#/'
patternProperties:
"^(ethernet-)?ports$":
type: object
additionalProperties: false
properties:
'#address-cells':
const: 1
'#size-cells':
const: 0
patternProperties:
"^(ethernet-)?port@[0-9]+$":
description: Ethernet switch ports
$ref: dsa-port.yaml#
unevaluatedProperties: false
...
......@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Hirschmann Hellcreek TSN Switch
allOf:
- $ref: dsa.yaml#
- $ref: dsa.yaml#/$defs/ethernet-ports
maintainers:
- Andrew Lunn <andrew@lunn.ch>
......
......@@ -157,9 +157,6 @@ patternProperties:
patternProperties:
"^(ethernet-)?port@[0-9]+$":
type: object
description: Ethernet switch ports
unevaluatedProperties: false
properties:
reg:
......@@ -238,7 +235,7 @@ $defs:
- sgmii
allOf:
- $ref: dsa.yaml#
- $ref: dsa.yaml#/$defs/ethernet-ports
- if:
required:
- mediatek,mcm
......
......@@ -11,7 +11,7 @@ maintainers:
- Woojung Huh <Woojung.Huh@microchip.com>
allOf:
- $ref: dsa.yaml#
- $ref: dsa.yaml#/$defs/ethernet-ports
- $ref: /schemas/spi/spi-peripheral-props.yaml#
properties:
......
......@@ -10,7 +10,7 @@ maintainers:
- UNGLinuxDriver@microchip.com
allOf:
- $ref: dsa.yaml#
- $ref: dsa.yaml#/$defs/ethernet-ports
properties:
compatible:
......
......@@ -78,7 +78,7 @@ required:
- reg
allOf:
- $ref: dsa.yaml#
- $ref: dsa.yaml#/$defs/ethernet-ports
- if:
properties:
compatible:
......
......@@ -13,7 +13,7 @@ description:
depends on the SPI bus master driver.
allOf:
- $ref: "dsa.yaml#"
- $ref: dsa.yaml#/$defs/ethernet-ports
- $ref: /schemas/spi/spi-peripheral-props.yaml#
maintainers:
......
......@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Realtek switches for unmanaged switches
allOf:
- $ref: dsa.yaml#
- $ref: dsa.yaml#/$defs/ethernet-ports
maintainers:
- Linus Walleij <linus.walleij@linaro.org>
......
......@@ -14,7 +14,7 @@ description: |
handles 4 ports + 1 CPU management port.
allOf:
- $ref: dsa.yaml#
- $ref: dsa.yaml#/$defs/ethernet-ports
properties:
compatible:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment