Commit 4fe67dd2 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge branch 'dt-bindings-net-realtek-rtl9301-switch'

Chris Packham says:

====================
dt-bindings: net: realtek,rtl9301-switch (schema part)

This is my attempt at trying to sort out the mess I've created with the RTL9300
switch dt-bindings. Some context is available on [1] and [2].

The first patch just moves the binding from mfd/ to net/ (with an adjustment of
the internal path name). The next two patches are successors to patches already
sent as part of the series [3].

[1] - https://lore.kernel.org/lkml/20250204-eccentric-deer-of-felicity-02b7ee@krzk-bin/
[2] - https://lore.kernel.org/lkml/4e3c5d83-d215-4eff-bf02-6d420592df8f@alliedtelesis.co.nz/
[3] - https://lore.kernel.org/lkml/20250204030249.1965444-1-chris.packham@alliedtelesis.co.nz/
====================

Link: https://patch.msgid.link/20250218195216.1034220-1-chris.packham@alliedtelesis.co.nz


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents a8503556 96757457
Loading
Loading
Loading
Loading
+86 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/realtek,rtl9301-mdio.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Realtek RTL9300 MDIO Controller

maintainers:
  - Chris Packham <chris.packham@alliedtelesis.co.nz>

properties:
  compatible:
    oneOf:
      - items:
          - enum:
              - realtek,rtl9302b-mdio
              - realtek,rtl9302c-mdio
              - realtek,rtl9303-mdio
          - const: realtek,rtl9301-mdio
      - const: realtek,rtl9301-mdio

  '#address-cells':
    const: 1

  '#size-cells':
    const: 0

  reg:
    maxItems: 1

patternProperties:
  '^mdio-bus@[0-3]$':
    $ref: mdio.yaml#

    properties:
      reg:
        maxItems: 1

    required:
      - reg

    patternProperties:
      '^ethernet-phy@[a-f0-9]+$':
        type: object
        $ref: ethernet-phy.yaml#
        unevaluatedProperties: false

    unevaluatedProperties: false

required:
  - compatible
  - reg

unevaluatedProperties: false

examples:
  - |
    mdio-controller@ca00 {
      compatible = "realtek,rtl9301-mdio";
      reg = <0xca00 0x200>;
      #address-cells = <1>;
      #size-cells = <0>;

      mdio-bus@0 {
        reg = <0>;
        #address-cells = <1>;
        #size-cells = <0>;

        ethernet-phy@0 {
          compatible = "ethernet-phy-ieee802.3-c45";
          reg = <0>;
        };
      };

      mdio-bus@1 {
        reg = <1>;
        #address-cells = <1>;
        #size-cells = <0>;

        ethernet-phy@0 {
          compatible = "ethernet-phy-ieee802.3-c45";
          reg = <0>;
        };
      };
    };
+62 −1
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/mfd/realtek,rtl9301-switch.yaml#
$id: http://devicetree.org/schemas/net/realtek,rtl9301-switch.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Realtek Switch with Internal CPU
@@ -14,6 +14,8 @@ description:
  number of different peripherals are accessed through a common register block,
  represented here as a syscon node.

$ref: ethernet-switch.yaml#/$defs/ethernet-ports

properties:
  compatible:
    items:
@@ -28,12 +30,23 @@ properties:
  reg:
    maxItems: 1

  interrupts:
    maxItems: 2

  interrupt-names:
    items:
      - const: switch
      - const: nic

  '#address-cells':
    const: 1

  '#size-cells':
    const: 1

  ethernet-ports:
    type: object

patternProperties:
  'reboot@[0-9a-f]+$':
    $ref: /schemas/power/reset/syscon-reboot.yaml#
@@ -41,9 +54,14 @@ patternProperties:
  'i2c@[0-9a-f]+$':
    $ref: /schemas/i2c/realtek,rtl9301-i2c.yaml#

  'mdio-controller@[0-9a-f]+$':
    $ref: realtek,rtl9301-mdio.yaml#

required:
  - compatible
  - reg
  - interrupts
  - interrupt-names

additionalProperties: false

@@ -52,6 +70,9 @@ examples:
    ethernet-switch@1b000000 {
      compatible = "realtek,rtl9301-switch", "syscon", "simple-mfd";
      reg = <0x1b000000 0x10000>;
      interrupt-parent = <&intc>;
      interrupts = <23>, <24>;
      interrupt-names = "switch", "nic";
      #address-cells = <1>;
      #size-cells = <1>;

@@ -110,5 +131,45 @@ examples:
          };
        };
      };

      mdio-controller@ca00 {
        compatible = "realtek,rtl9301-mdio";
        reg = <0xca00 0x200>;
        #address-cells = <1>;
        #size-cells = <0>;

        mdio-bus@0 {
          reg = <0>;
          #address-cells = <1>;
          #size-cells = <0>;

          phy1: ethernet-phy@0 {
            reg = <0>;
          };
        };
        mdio-bus@1 {
          reg = <1>;
          #address-cells = <1>;
          #size-cells = <0>;

          phy2: ethernet-phy@0 {
            reg = <0>;
          };
        };
      };

      ethernet-ports {
        #address-cells = <1>;
        #size-cells = <0>;

        port@0 {
          reg = <0>;
          phy-handle = <&phy1>;
        };
        port@1 {
          reg = <1>;
          phy-handle = <&phy2>;
        };
      };
    };