Commit b2d28642 authored by Rob Herring's avatar Rob Herring

dt-bindings: net: Cleanup MDIO node schemas

The schemas for MDIO bus nodes range from missing to duplicating
everything in mdio.yaml. The MDIO bus node schemas only need to
reference mdio.yaml, define any binding specific properties, and define
'unevaluatedProperties: false'. This ensures that MDIO nodes only
contain defined properties. With this, any duplicated properties can
be removed.

Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Chen-Yu Tsai <wens@csie.org>
Cc: Vivien Didelot <vivien.didelot@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Vladimir Oltean <olteanv@gmail.com>
Cc: Joakim Zhang <qiangqing.zhang@nxp.com>
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Cc: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
Cc: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
Cc: "Fernández Rojas" <noltari@gmail.com>
Cc: John Crispin <john@phrozen.org>
Cc: "G. Jaya Kumaran" <vineetha.g.jaya.kumaran@intel.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Joel Stanley <joel@jms.id.au>
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Cc: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Jose Abreu <joabreu@synopsys.com>
Cc: netdev@vger.kernel.org
Signed-off-by: default avatarRob Herring <robh@kernel.org>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20220105151009.3093506-1-robh@kernel.org
parent 8650381f
...@@ -51,6 +51,10 @@ properties: ...@@ -51,6 +51,10 @@ properties:
description: description:
Phandle to the device containing custom config. Phandle to the device containing custom config.
mdio:
$ref: mdio.yaml#
unevaluatedProperties: false
required: required:
- compatible - compatible
- reg - reg
......
...@@ -122,6 +122,7 @@ allOf: ...@@ -122,6 +122,7 @@ allOf:
mdio-mux: mdio-mux:
type: object type: object
unevaluatedProperties: false
properties: properties:
compatible: compatible:
...@@ -132,17 +133,18 @@ allOf: ...@@ -132,17 +133,18 @@ allOf:
description: description:
Phandle to EMAC MDIO. Phandle to EMAC MDIO.
mdio@1:
type: object
description: Internal MDIO Bus
properties:
"#address-cells": "#address-cells":
const: 1 const: 1
"#size-cells": "#size-cells":
const: 0 const: 0
mdio@1:
$ref: mdio.yaml#
unevaluatedProperties: false
description: Internal MDIO Bus
properties:
compatible: compatible:
const: allwinner,sun8i-h3-mdio-internal const: allwinner,sun8i-h3-mdio-internal
...@@ -168,16 +170,11 @@ allOf: ...@@ -168,16 +170,11 @@ allOf:
mdio@2: mdio@2:
type: object $ref: mdio.yaml#
unevaluatedProperties: false
description: External MDIO Bus (H3 only) description: External MDIO Bus (H3 only)
properties: properties:
"#address-cells":
const: 1
"#size-cells":
const: 0
reg: reg:
const: 2 const: 2
......
...@@ -15,18 +15,12 @@ description: ...@@ -15,18 +15,12 @@ description:
properties as well to generate desired MDIO transaction on appropriate bus. properties as well to generate desired MDIO transaction on appropriate bus.
allOf: allOf:
- $ref: "mdio.yaml#" - $ref: mdio-mux.yaml#
properties: properties:
compatible: compatible:
const: brcm,bcm6368-mdio-mux const: brcm,bcm6368-mdio-mux
"#address-cells":
const: 1
"#size-cells":
const: 0
reg: reg:
maxItems: 1 maxItems: 1
...@@ -34,24 +28,6 @@ required: ...@@ -34,24 +28,6 @@ required:
- compatible - compatible
- reg - reg
patternProperties:
'^mdio@[0-1]$':
type: object
properties:
reg:
maxItems: 1
"#address-cells":
const: 1
"#size-cells":
const: 0
required:
- reg
- "#address-cells"
- "#size-cells"
unevaluatedProperties: false unevaluatedProperties: false
examples: examples:
......
...@@ -52,10 +52,8 @@ properties: ...@@ -52,10 +52,8 @@ properties:
patternProperties: patternProperties:
"^mdio@[0-1]$": "^mdio@[0-1]$":
type: object $ref: /schemas/net/mdio.yaml#
unevaluatedProperties: false
allOf:
- $ref: "http://devicetree.org/schemas/net/mdio.yaml#"
properties: properties:
compatible: compatible:
......
...@@ -58,33 +58,14 @@ properties: ...@@ -58,33 +58,14 @@ properties:
B68 on the QCA832x and B49 on the QCA833x. B68 on the QCA832x and B49 on the QCA833x.
mdio: mdio:
type: object $ref: /schemas/net/mdio.yaml#
unevaluatedProperties: false
description: Qca8k switch have an internal mdio to access switch port. description: Qca8k switch have an internal mdio to access switch port.
If this is not present, the legacy mapping is used and the If this is not present, the legacy mapping is used and the
internal mdio access is used. internal mdio access is used.
With the legacy mapping the reg corresponding to the internal With the legacy mapping the reg corresponding to the internal
mdio is the switch reg with an offset of -1. mdio is the switch reg with an offset of -1.
properties:
'#address-cells':
const: 1
'#size-cells':
const: 0
patternProperties:
"^(ethernet-)?phy@[0-4]$":
type: object
allOf:
- $ref: "http://devicetree.org/schemas/net/mdio.yaml#"
properties:
reg:
maxItems: 1
required:
- reg
patternProperties: patternProperties:
"^(ethernet-)?ports$": "^(ethernet-)?ports$":
type: object type: object
......
...@@ -165,7 +165,8 @@ properties: ...@@ -165,7 +165,8 @@ properties:
req_bit is the gpr bit offset for ENET stop request. req_bit is the gpr bit offset for ENET stop request.
mdio: mdio:
type: object $ref: mdio.yaml#
unevaluatedProperties: false
description: description:
Specifies the mdio bus in the FEC, used as a container for phy nodes. Specifies the mdio bus in the FEC, used as a container for phy nodes.
......
...@@ -117,7 +117,7 @@ examples: ...@@ -117,7 +117,7 @@ examples:
snps,mtl-tx-config = <&mtl_tx_setup>; snps,mtl-tx-config = <&mtl_tx_setup>;
snps,tso; snps,tso;
mdio0 { mdio {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
compatible = "snps,dwmac-mdio"; compatible = "snps,dwmac-mdio";
......
...@@ -48,8 +48,8 @@ properties: ...@@ -48,8 +48,8 @@ properties:
and the instance to use in the second cell and the instance to use in the second cell
mdio: mdio:
type: object $ref: mdio.yaml#
$ref: "mdio.yaml#" unevaluatedProperties: false
description: optional node for embedded MDIO controller description: optional node for embedded MDIO controller
required: required:
......
...@@ -62,6 +62,7 @@ properties: ...@@ -62,6 +62,7 @@ properties:
mdio: mdio:
$ref: mdio.yaml# $ref: mdio.yaml#
unevaluatedProperties: false
required: required:
- compatible - compatible
......
...@@ -15,9 +15,6 @@ description: |+ ...@@ -15,9 +15,6 @@ description: |+
bus multiplexer/switch will have one child node for each child bus. bus multiplexer/switch will have one child node for each child bus.
properties: properties:
$nodename:
pattern: '^mdio-mux[\-@]?'
mdio-parent-bus: mdio-parent-bus:
$ref: /schemas/types.yaml#/definitions/phandle $ref: /schemas/types.yaml#/definitions/phandle
description: description:
...@@ -32,12 +29,12 @@ properties: ...@@ -32,12 +29,12 @@ properties:
patternProperties: patternProperties:
'^mdio@[0-9a-f]+$': '^mdio@[0-9a-f]+$':
type: object $ref: mdio.yaml#
unevaluatedProperties: false
properties: properties:
reg: reg:
maxItems: 1 maxItems: 1
description: The sub-bus number.
additionalProperties: true additionalProperties: true
......
...@@ -48,9 +48,8 @@ properties: ...@@ -48,9 +48,8 @@ properties:
to control the MII mode. to control the MII mode.
mdio: mdio:
type: object $ref: mdio.yaml#
description: unevaluatedProperties: false
Creates and registers an MDIO bus.
required: required:
- compatible - compatible
......
...@@ -34,14 +34,6 @@ properties: ...@@ -34,14 +34,6 @@ properties:
interrupts: interrupts:
maxItems: 1 maxItems: 1
'#address-cells':
description: number of address cells for the MDIO bus
const: 1
'#size-cells':
description: number of size cells on the MDIO bus
const: 0
clocks: clocks:
items: items:
- description: MAC main clock - description: MAC main clock
...@@ -62,6 +54,10 @@ properties: ...@@ -62,6 +54,10 @@ properties:
- const: mac - const: mac
- const: mdio - const: mdio
mdio:
$ref: mdio.yaml#
unevaluatedProperties: false
required: required:
- compatible - compatible
- reg - reg
...@@ -110,9 +106,6 @@ examples: ...@@ -110,9 +106,6 @@ examples:
#size-cells = <0>; #size-cells = <0>;
switch10: switch@10 { switch10: switch@10 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "qca,ar9331-switch"; compatible = "qca,ar9331-switch";
reg = <0x10>; reg = <0x10>;
resets = <&rst 8>; resets = <&rst 8>;
......
...@@ -286,7 +286,8 @@ properties: ...@@ -286,7 +286,8 @@ properties:
MAC2MAC connection. MAC2MAC connection.
mdio: mdio:
type: object $ref: mdio.yaml#
unevaluatedProperties: false
description: description:
Creates and registers an MDIO bus. Creates and registers an MDIO bus.
......
...@@ -72,6 +72,7 @@ properties: ...@@ -72,6 +72,7 @@ properties:
mdio: mdio:
$ref: mdio.yaml# $ref: mdio.yaml#
unevaluatedProperties: false
required: required:
- compatible - compatible
......
...@@ -71,7 +71,7 @@ examples: ...@@ -71,7 +71,7 @@ examples:
phy-mode = "rgmii-id"; phy-mode = "rgmii-id";
phy-handle = <&phy0>; phy-handle = <&phy0>;
mdio0 { mdio {
#address-cells = <0x1>; #address-cells = <0x1>;
#size-cells = <0x0>; #size-cells = <0x0>;
compatible = "snps,dwmac-mdio"; compatible = "snps,dwmac-mdio";
......
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