xref: /linux/Documentation/devicetree/bindings/net/cdns,macb.yaml (revision 8bfdfbb258913047b5d5384ec2a6b049af1bf437)
14e5b6de1SGeert Uytterhoeven# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
24e5b6de1SGeert Uytterhoeven%YAML 1.2
34e5b6de1SGeert Uytterhoeven---
44e5b6de1SGeert Uytterhoeven$id: http://devicetree.org/schemas/net/cdns,macb.yaml#
54e5b6de1SGeert Uytterhoeven$schema: http://devicetree.org/meta-schemas/core.yaml#
64e5b6de1SGeert Uytterhoeven
74e5b6de1SGeert Uytterhoeventitle: Cadence MACB/GEM Ethernet controller
84e5b6de1SGeert Uytterhoeven
94e5b6de1SGeert Uytterhoevenmaintainers:
104e5b6de1SGeert Uytterhoeven  - Nicolas Ferre <nicolas.ferre@microchip.com>
114e5b6de1SGeert Uytterhoeven  - Claudiu Beznea <claudiu.beznea@microchip.com>
124e5b6de1SGeert Uytterhoeven
134e5b6de1SGeert Uytterhoevenproperties:
144e5b6de1SGeert Uytterhoeven  compatible:
154e5b6de1SGeert Uytterhoeven    oneOf:
164e5b6de1SGeert Uytterhoeven      - items:
174e5b6de1SGeert Uytterhoeven          - enum:
184e5b6de1SGeert Uytterhoeven              - cdns,at91rm9200-emac  # Atmel at91rm9200 SoC
194e5b6de1SGeert Uytterhoeven          - const: cdns,emac          # Generic
204e5b6de1SGeert Uytterhoeven
214e5b6de1SGeert Uytterhoeven      - items:
224e5b6de1SGeert Uytterhoeven          - enum:
234e5b6de1SGeert Uytterhoeven              - cdns,zynq-gem         # Xilinx Zynq-7xxx SoC
244e5b6de1SGeert Uytterhoeven              - cdns,zynqmp-gem       # Xilinx Zynq Ultrascale+ MPSoC
254e5b6de1SGeert Uytterhoeven          - const: cdns,gem           # Generic
264e5b6de1SGeert Uytterhoeven
274e5b6de1SGeert Uytterhoeven      - items:
284e5b6de1SGeert Uytterhoeven          - enum:
294e5b6de1SGeert Uytterhoeven              - cdns,at91sam9260-macb # Atmel at91sam9 SoCs
304e5b6de1SGeert Uytterhoeven              - cdns,sam9x60-macb     # Microchip sam9x60 SoC
314e5b6de1SGeert Uytterhoeven          - const: cdns,macb          # Generic
324e5b6de1SGeert Uytterhoeven
334e5b6de1SGeert Uytterhoeven      - items:
344e5b6de1SGeert Uytterhoeven          - enum:
354e5b6de1SGeert Uytterhoeven              - atmel,sama5d3-macb    # 10/100Mbit IP on Atmel sama5d3 SoCs
364e5b6de1SGeert Uytterhoeven          - enum:
374e5b6de1SGeert Uytterhoeven              - cdns,at91sam9260-macb # Atmel at91sam9 SoCs.
384e5b6de1SGeert Uytterhoeven          - const: cdns,macb          # Generic
394e5b6de1SGeert Uytterhoeven
404e5b6de1SGeert Uytterhoeven      - enum:
414e5b6de1SGeert Uytterhoeven          - atmel,sama5d29-gem        # GEM XL IP (10/100) on Atmel sama5d29 SoCs
424e5b6de1SGeert Uytterhoeven          - atmel,sama5d2-gem         # GEM IP (10/100) on Atmel sama5d2 SoCs
434e5b6de1SGeert Uytterhoeven          - atmel,sama5d3-gem         # Gigabit IP on Atmel sama5d3 SoCs
444e5b6de1SGeert Uytterhoeven          - atmel,sama5d4-gem         # GEM IP (10/100) on Atmel sama5d4 SoCs
454e5b6de1SGeert Uytterhoeven          - cdns,np4-macb             # NP4 SoC devices
464e5b6de1SGeert Uytterhoeven          - microchip,sama7g5-emac    # Microchip SAMA7G5 ethernet interface
474e5b6de1SGeert Uytterhoeven          - microchip,sama7g5-gem     # Microchip SAMA7G5 gigabit ethernet interface
484e5b6de1SGeert Uytterhoeven          - sifive,fu540-c000-gem     # SiFive FU540-C000 SoC
494e5b6de1SGeert Uytterhoeven          - cdns,emac                 # Generic
504e5b6de1SGeert Uytterhoeven          - cdns,gem                  # Generic
514e5b6de1SGeert Uytterhoeven          - cdns,macb                 # Generic
524e5b6de1SGeert Uytterhoeven
534e5b6de1SGeert Uytterhoeven  reg:
544e5b6de1SGeert Uytterhoeven    minItems: 1
554e5b6de1SGeert Uytterhoeven    items:
564e5b6de1SGeert Uytterhoeven      - description: Basic register set
574e5b6de1SGeert Uytterhoeven      - description: GEMGXL Management block registers on SiFive FU540-C000 SoC
584e5b6de1SGeert Uytterhoeven
594e5b6de1SGeert Uytterhoeven  interrupts:
604e5b6de1SGeert Uytterhoeven    minItems: 1
614e5b6de1SGeert Uytterhoeven    maxItems: 8
624e5b6de1SGeert Uytterhoeven    description: One interrupt per available hardware queue
634e5b6de1SGeert Uytterhoeven
644e5b6de1SGeert Uytterhoeven  clocks:
654e5b6de1SGeert Uytterhoeven    minItems: 1
664e5b6de1SGeert Uytterhoeven    maxItems: 5
674e5b6de1SGeert Uytterhoeven
684e5b6de1SGeert Uytterhoeven  clock-names:
694e5b6de1SGeert Uytterhoeven    minItems: 1
704e5b6de1SGeert Uytterhoeven    items:
714e5b6de1SGeert Uytterhoeven      - enum: [ ether_clk, hclk, pclk ]
724e5b6de1SGeert Uytterhoeven      - enum: [ hclk, pclk ]
734e5b6de1SGeert Uytterhoeven      - const: tx_clk
744e5b6de1SGeert Uytterhoeven      - enum: [ rx_clk, tsu_clk ]
754e5b6de1SGeert Uytterhoeven      - const: tsu_clk
764e5b6de1SGeert Uytterhoeven
774e5b6de1SGeert Uytterhoeven  local-mac-address: true
784e5b6de1SGeert Uytterhoeven
794e5b6de1SGeert Uytterhoeven  phy-mode: true
804e5b6de1SGeert Uytterhoeven
814e5b6de1SGeert Uytterhoeven  phy-handle: true
824e5b6de1SGeert Uytterhoeven
83f4ea385aSRobert Hancock  phys:
84f4ea385aSRobert Hancock    maxItems: 1
85f4ea385aSRobert Hancock
86f4ea385aSRobert Hancock  resets:
87f4ea385aSRobert Hancock    maxItems: 1
88f4ea385aSRobert Hancock    description:
89f4ea385aSRobert Hancock      Recommended with ZynqMP, specify reset control for this
90f4ea385aSRobert Hancock      controller instance with zynqmp-reset driver.
91f4ea385aSRobert Hancock
92f4ea385aSRobert Hancock  reset-names:
93f4ea385aSRobert Hancock    maxItems: 1
94f4ea385aSRobert Hancock
954e5b6de1SGeert Uytterhoeven  fixed-link: true
964e5b6de1SGeert Uytterhoeven
974e5b6de1SGeert Uytterhoeven  iommus:
984e5b6de1SGeert Uytterhoeven    maxItems: 1
994e5b6de1SGeert Uytterhoeven
1004e5b6de1SGeert Uytterhoeven  power-domains:
1014e5b6de1SGeert Uytterhoeven    maxItems: 1
1024e5b6de1SGeert Uytterhoeven
1034e5b6de1SGeert Uytterhoeven  '#address-cells':
1044e5b6de1SGeert Uytterhoeven    const: 1
1054e5b6de1SGeert Uytterhoeven
1064e5b6de1SGeert Uytterhoeven  '#size-cells':
1074e5b6de1SGeert Uytterhoeven    const: 0
1084e5b6de1SGeert Uytterhoeven
1094e5b6de1SGeert Uytterhoeven  mdio:
1104e5b6de1SGeert Uytterhoeven    type: object
1114e5b6de1SGeert Uytterhoeven    description:
1124e5b6de1SGeert Uytterhoeven      Node containing PHY children. If this node is not present, then PHYs will
1134e5b6de1SGeert Uytterhoeven      be direct children.
1144e5b6de1SGeert Uytterhoeven
1154e5b6de1SGeert UytterhoevenpatternProperties:
1164e5b6de1SGeert Uytterhoeven  "^ethernet-phy@[0-9a-f]$":
1174e5b6de1SGeert Uytterhoeven    type: object
1184e5b6de1SGeert Uytterhoeven    $ref: ethernet-phy.yaml#
1194e5b6de1SGeert Uytterhoeven
1204e5b6de1SGeert Uytterhoeven    properties:
1214e5b6de1SGeert Uytterhoeven      reset-gpios: true
1224e5b6de1SGeert Uytterhoeven
1234e5b6de1SGeert Uytterhoeven      magic-packet:
1244e71ed98SRob Herring        type: boolean
1254e5b6de1SGeert Uytterhoeven        description:
1264e5b6de1SGeert Uytterhoeven          Indicates that the hardware supports waking up via magic packet.
1274e5b6de1SGeert Uytterhoeven
1284e5b6de1SGeert Uytterhoeven    unevaluatedProperties: false
1294e5b6de1SGeert Uytterhoeven
1304e5b6de1SGeert Uytterhoevenrequired:
1314e5b6de1SGeert Uytterhoeven  - compatible
1324e5b6de1SGeert Uytterhoeven  - reg
1334e5b6de1SGeert Uytterhoeven  - interrupts
1344e5b6de1SGeert Uytterhoeven  - clocks
1354e5b6de1SGeert Uytterhoeven  - clock-names
1364e5b6de1SGeert Uytterhoeven  - phy-mode
1374e5b6de1SGeert Uytterhoeven
1384e5b6de1SGeert UytterhoevenallOf:
1394e5b6de1SGeert Uytterhoeven  - $ref: ethernet-controller.yaml#
1404e5b6de1SGeert Uytterhoeven
1414e5b6de1SGeert Uytterhoeven  - if:
1424e5b6de1SGeert Uytterhoeven      not:
1434e5b6de1SGeert Uytterhoeven        properties:
1444e5b6de1SGeert Uytterhoeven          compatible:
1454e5b6de1SGeert Uytterhoeven            contains:
1464e5b6de1SGeert Uytterhoeven              const: sifive,fu540-c000-gem
1474e5b6de1SGeert Uytterhoeven    then:
1484e5b6de1SGeert Uytterhoeven      properties:
1494e5b6de1SGeert Uytterhoeven        reg:
1504e5b6de1SGeert Uytterhoeven          maxItems: 1
1514e5b6de1SGeert Uytterhoeven
1524e5b6de1SGeert UytterhoevenunevaluatedProperties: false
1534e5b6de1SGeert Uytterhoeven
1544e5b6de1SGeert Uytterhoevenexamples:
1554e5b6de1SGeert Uytterhoeven  - |
1564e5b6de1SGeert Uytterhoeven    macb0: ethernet@fffc4000 {
157*8bfdfbb2SHans-Christian Noren Egtvedt            compatible = "cdns,macb";
1584e5b6de1SGeert Uytterhoeven            reg = <0xfffc4000 0x4000>;
1594e5b6de1SGeert Uytterhoeven            interrupts = <21>;
1604e5b6de1SGeert Uytterhoeven            phy-mode = "rmii";
1614e5b6de1SGeert Uytterhoeven            local-mac-address = [3a 0e 03 04 05 06];
1624e5b6de1SGeert Uytterhoeven            clock-names = "pclk", "hclk", "tx_clk";
1634e5b6de1SGeert Uytterhoeven            clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>;
1644e5b6de1SGeert Uytterhoeven            #address-cells = <1>;
1654e5b6de1SGeert Uytterhoeven            #size-cells = <0>;
1664e5b6de1SGeert Uytterhoeven
1674e5b6de1SGeert Uytterhoeven            ethernet-phy@1 {
1684e5b6de1SGeert Uytterhoeven                    reg = <0x1>;
1694e5b6de1SGeert Uytterhoeven                    reset-gpios = <&pioE 6 1>;
1704e5b6de1SGeert Uytterhoeven            };
1714e5b6de1SGeert Uytterhoeven    };
172f4ea385aSRobert Hancock
173f4ea385aSRobert Hancock  - |
174f4ea385aSRobert Hancock    #include <dt-bindings/clock/xlnx-zynqmp-clk.h>
175f4ea385aSRobert Hancock    #include <dt-bindings/power/xlnx-zynqmp-power.h>
176f4ea385aSRobert Hancock    #include <dt-bindings/reset/xlnx-zynqmp-resets.h>
177f4ea385aSRobert Hancock    #include <dt-bindings/phy/phy.h>
178f4ea385aSRobert Hancock
179f4ea385aSRobert Hancock    bus {
180f4ea385aSRobert Hancock            #address-cells = <2>;
181f4ea385aSRobert Hancock            #size-cells = <2>;
182f4ea385aSRobert Hancock            gem1: ethernet@ff0c0000 {
183f4ea385aSRobert Hancock                    compatible = "cdns,zynqmp-gem", "cdns,gem";
184f4ea385aSRobert Hancock                    interrupt-parent = <&gic>;
185f4ea385aSRobert Hancock                    interrupts = <0 59 4>, <0 59 4>;
186f4ea385aSRobert Hancock                    reg = <0x0 0xff0c0000 0x0 0x1000>;
187f4ea385aSRobert Hancock                    clocks = <&zynqmp_clk LPD_LSBUS>, <&zynqmp_clk GEM1_REF>,
188f4ea385aSRobert Hancock                             <&zynqmp_clk GEM1_TX>, <&zynqmp_clk GEM1_RX>,
189f4ea385aSRobert Hancock                             <&zynqmp_clk GEM_TSU>;
190f4ea385aSRobert Hancock                    clock-names = "pclk", "hclk", "tx_clk", "rx_clk", "tsu_clk";
191f4ea385aSRobert Hancock                    #address-cells = <1>;
192f4ea385aSRobert Hancock                    #size-cells = <0>;
193f4ea385aSRobert Hancock                    iommus = <&smmu 0x875>;
194f4ea385aSRobert Hancock                    power-domains = <&zynqmp_firmware PD_ETH_1>;
195f4ea385aSRobert Hancock                    resets = <&zynqmp_reset ZYNQMP_RESET_GEM1>;
196f4ea385aSRobert Hancock                    reset-names = "gem1_rst";
197f4ea385aSRobert Hancock                    status = "okay";
198f4ea385aSRobert Hancock                    phy-mode = "sgmii";
199f4ea385aSRobert Hancock                    phys = <&psgtr 1 PHY_TYPE_SGMII 1 1>;
200f4ea385aSRobert Hancock                    fixed-link {
201f4ea385aSRobert Hancock                            speed = <1000>;
202f4ea385aSRobert Hancock                            full-duplex;
203f4ea385aSRobert Hancock                            pause;
204f4ea385aSRobert Hancock                    };
205f4ea385aSRobert Hancock            };
206f4ea385aSRobert Hancock    };
207