Commit b2d28642 authored by Rob Herring's avatar Rob Herring
Browse files

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
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -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
+11 −14
Original line number Original line Diff line number Diff line
@@ -122,6 +122,7 @@ allOf:


        mdio-mux:
        mdio-mux:
          type: object
          type: object
          unevaluatedProperties: false


          properties:
          properties:
            compatible:
            compatible:
@@ -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:




            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


+1 −25
Original line number Original line Diff line number Diff line
@@ -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:
  - 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:
+2 −4
Original line number Original line Diff line number Diff line
@@ -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:
+2 −21
Original line number Original line Diff line number Diff line
@@ -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
Loading