Add a binding for SoC-e FPGA-based Ethernet switch IP cores. The compatible identifies a register layout characterized by the core and feature identification registers at the encoded offsets. The concrete synthesis-time configuration is then autodetected from these registers. Describe the Ethernet ports and the optional integrated MDIO controller with its generic MMIO mux and child buses. Signed-off-by: Vasilij Strassheim --- .../devicetree/bindings/net/dsa/soce,swip.yaml | 162 +++++++++++++++++++++ 1 file changed, 162 insertions(+) diff --git a/Documentation/devicetree/bindings/net/dsa/soce,swip.yaml b/Documentation/devicetree/bindings/net/dsa/soce,swip.yaml new file mode 100644 index 000000000000..d614fb2a29d3 --- /dev/null +++ b/Documentation/devicetree/bindings/net/dsa/soce,swip.yaml @@ -0,0 +1,162 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/dsa/soce,swip.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: SoC-e ethernet switch IP core for FPGAs + +maintainers: + - Vasilij Strassheim + +description: + SoC-e Ethernet switch IP cores are FPGA-based switches whose features + and number of ports are selected at synthesis time. Ports can connect + to CPUs, external PHYs, FPGA logic, or other switch cores. An integrated + MDIO controller accesses the per-port external buses through a mux. + +$ref: dsa.yaml# + +properties: + compatible: + const: soce,swip-00-04-0c-10 + description: + Register layout with the core version register at offset 0x00 and + feature identification registers at offsets 0x04, 0x0c, and 0x10. + Switch instances using this register layout are autodetected from + these registers and use this compatible regardless of their + synthesis-time feature and port configuration. + + reg: + maxItems: 1 + + '#address-cells': + const: 1 + + '#size-cells': + const: 1 + + ranges: true + + mdio@204: + $ref: /schemas/net/soce,swip-mdio.yaml# + unevaluatedProperties: false + description: + Integrated MDIO controller bus on the master side of the mux. + + mdio-mux@202: + $ref: /schemas/net/mdio-mux-mmioreg.yaml# + unevaluatedProperties: false + + ethernet-ports: + type: object + patternProperties: + '^ethernet-port@[0-9a-f]+$': + type: object + $ref: dsa-port.yaml# + unevaluatedProperties: false + + properties: + reg: + maximum: 30 + description: + Switch port index. Supported switch configurations have + up to 31 ports, numbered from 0 through 30. + + phy-mode: + enum: + - mii + - gmii + - rmii + - rgmii + - rgmii-id + - rgmii-rxid + - rgmii-txid + + required: + - reg + - phy-mode + +required: + - compatible + - reg + - ethernet-ports + +unevaluatedProperties: false + +examples: + - | + ethernet-switch@80020000 { + compatible = "soce,swip-00-04-0c-10"; + reg = <0x80020000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x80020000 0x10000>; + + mdio_parent: mdio@204 { + compatible = "soce,swip-mdio-23-02"; + reg = <0x204 0xc>, <0x200 0x4>; + reg-names = "data", "control"; + #address-cells = <1>; + #size-cells = <0>; + }; + + mdio-mux@202 { + compatible = "mdio-mux-mmioreg", "mdio-mux"; + reg = <0x202 0x2>; + mux-mask = <0x07ff>; + mdio-parent-bus = <&mdio_parent>; + #address-cells = <1>; + #size-cells = <0>; + + mdio@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + + switchphy0: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + }; + }; + + mdio@1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + switchphy1: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + }; + }; + }; + + ethernet-ports { + #address-cells = <1>; + #size-cells = <0>; + + ethernet-port@0 { + reg = <0>; + phy-handle = <&switchphy0>; + phy-mode = "rgmii-id"; + }; + + ethernet-port@1 { + reg = <1>; + phy-handle = <&switchphy1>; + phy-mode = "rgmii-id"; + }; + + ethernet-port@2 { + reg = <2>; + ethernet = <ð0>; + phy-mode = "gmii"; + + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + }; + }; -- 2.39.5