xref: /linux/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml (revision 9410645520e9b820069761f3450ef6661418e279)
1b331b8efSEzequiel Garcia# SPDX-License-Identifier: GPL-2.0
2b331b8efSEzequiel Garcia%YAML 1.2
3b331b8efSEzequiel Garcia---
43079bfdbSRob Herring$id: http://devicetree.org/schemas/net/rockchip-dwmac.yaml#
53079bfdbSRob Herring$schema: http://devicetree.org/meta-schemas/core.yaml#
6b331b8efSEzequiel Garcia
7b331b8efSEzequiel Garciatitle: Rockchip 10/100/1000 Ethernet driver(GMAC)
8b331b8efSEzequiel Garcia
9b331b8efSEzequiel Garciamaintainers:
10b331b8efSEzequiel Garcia  - David Wu <david.wu@rock-chips.com>
11b331b8efSEzequiel Garcia
12b331b8efSEzequiel Garcia# We need a select here so we don't match all nodes with 'snps,dwmac'
13b331b8efSEzequiel Garciaselect:
14b331b8efSEzequiel Garcia  properties:
15b331b8efSEzequiel Garcia    compatible:
16b331b8efSEzequiel Garcia      contains:
17b331b8efSEzequiel Garcia        enum:
18b331b8efSEzequiel Garcia          - rockchip,px30-gmac
19b331b8efSEzequiel Garcia          - rockchip,rk3128-gmac
20b331b8efSEzequiel Garcia          - rockchip,rk3228-gmac
21b331b8efSEzequiel Garcia          - rockchip,rk3288-gmac
222cc8c910STobias Schramm          - rockchip,rk3308-gmac
23b331b8efSEzequiel Garcia          - rockchip,rk3328-gmac
24b331b8efSEzequiel Garcia          - rockchip,rk3366-gmac
25b331b8efSEzequiel Garcia          - rockchip,rk3368-gmac
26b331b8efSEzequiel Garcia          - rockchip,rk3399-gmac
27f9da1c9dSEzequiel Garcia          - rockchip,rk3568-gmac
28*299e2aefSDetlev Casanova          - rockchip,rk3576-gmac
29a2b77831SSebastian Reichel          - rockchip,rk3588-gmac
30b331b8efSEzequiel Garcia          - rockchip,rv1108-gmac
31b36fe2f4SAnand Moon          - rockchip,rv1126-gmac
32b331b8efSEzequiel Garcia  required:
33b331b8efSEzequiel Garcia    - compatible
34b331b8efSEzequiel Garcia
35b331b8efSEzequiel GarciaallOf:
3661ab5a06SKrzysztof Kozlowski  - $ref: snps,dwmac.yaml#
37b331b8efSEzequiel Garcia
38b331b8efSEzequiel Garciaproperties:
39b331b8efSEzequiel Garcia  compatible:
40f9da1c9dSEzequiel Garcia    oneOf:
41f9da1c9dSEzequiel Garcia      - items:
42b331b8efSEzequiel Garcia          - enum:
43b331b8efSEzequiel Garcia              - rockchip,px30-gmac
44b331b8efSEzequiel Garcia              - rockchip,rk3128-gmac
45b331b8efSEzequiel Garcia              - rockchip,rk3228-gmac
46b331b8efSEzequiel Garcia              - rockchip,rk3288-gmac
472cc8c910STobias Schramm              - rockchip,rk3308-gmac
48b331b8efSEzequiel Garcia              - rockchip,rk3328-gmac
49b331b8efSEzequiel Garcia              - rockchip,rk3366-gmac
50b331b8efSEzequiel Garcia              - rockchip,rk3368-gmac
51b331b8efSEzequiel Garcia              - rockchip,rk3399-gmac
52b331b8efSEzequiel Garcia              - rockchip,rv1108-gmac
53f9da1c9dSEzequiel Garcia      - items:
54f9da1c9dSEzequiel Garcia          - enum:
55f9da1c9dSEzequiel Garcia              - rockchip,rk3568-gmac
56*299e2aefSDetlev Casanova              - rockchip,rk3576-gmac
57a2b77831SSebastian Reichel              - rockchip,rk3588-gmac
58e471d83eSAnand Moon              - rockchip,rv1126-gmac
59f9da1c9dSEzequiel Garcia          - const: snps,dwmac-4.20a
60b331b8efSEzequiel Garcia
61b331b8efSEzequiel Garcia  clocks:
62b331b8efSEzequiel Garcia    minItems: 5
63b331b8efSEzequiel Garcia    maxItems: 8
64b331b8efSEzequiel Garcia
65b331b8efSEzequiel Garcia  clock-names:
66b331b8efSEzequiel Garcia    contains:
67b331b8efSEzequiel Garcia      enum:
68b331b8efSEzequiel Garcia        - stmmaceth
69b331b8efSEzequiel Garcia        - mac_clk_tx
70b331b8efSEzequiel Garcia        - mac_clk_rx
71b331b8efSEzequiel Garcia        - aclk_mac
72b331b8efSEzequiel Garcia        - pclk_mac
73b331b8efSEzequiel Garcia        - clk_mac_ref
74b331b8efSEzequiel Garcia        - clk_mac_refout
75b331b8efSEzequiel Garcia        - clk_mac_speed
76b331b8efSEzequiel Garcia
77b331b8efSEzequiel Garcia  clock_in_out:
78b331b8efSEzequiel Garcia    description:
79b331b8efSEzequiel Garcia      For RGMII, it must be "input", means main clock(125MHz)
80b331b8efSEzequiel Garcia      is not sourced from SoC's PLL, but input from PHY.
81b331b8efSEzequiel Garcia      For RMII, "input" means PHY provides the reference clock(50MHz),
82b331b8efSEzequiel Garcia      "output" means GMAC provides the reference clock.
83b331b8efSEzequiel Garcia    $ref: /schemas/types.yaml#/definitions/string
84b331b8efSEzequiel Garcia    enum: [input, output]
8551318bf4SEugen Hristev    default: input
86b331b8efSEzequiel Garcia
87b331b8efSEzequiel Garcia  rockchip,grf:
88b331b8efSEzequiel Garcia    description: The phandle of the syscon node for the general register file.
89b331b8efSEzequiel Garcia    $ref: /schemas/types.yaml#/definitions/phandle
90b331b8efSEzequiel Garcia
91a2b77831SSebastian Reichel  rockchip,php-grf:
92a2b77831SSebastian Reichel    description:
93a2b77831SSebastian Reichel      The phandle of the syscon node for the peripheral general register file.
94a2b77831SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/phandle
95a2b77831SSebastian Reichel
96b331b8efSEzequiel Garcia  tx_delay:
975416d792SEugen Hristev    description: Delay value for TXD timing.
98b331b8efSEzequiel Garcia    $ref: /schemas/types.yaml#/definitions/uint32
995416d792SEugen Hristev    minimum: 0
1005416d792SEugen Hristev    maximum: 0x7F
1015416d792SEugen Hristev    default: 0x30
102b331b8efSEzequiel Garcia
103b331b8efSEzequiel Garcia  rx_delay:
1045416d792SEugen Hristev    description: Delay value for RXD timing.
105b331b8efSEzequiel Garcia    $ref: /schemas/types.yaml#/definitions/uint32
1065416d792SEugen Hristev    minimum: 0
1075416d792SEugen Hristev    maximum: 0x7F
1085416d792SEugen Hristev    default: 0x10
109b331b8efSEzequiel Garcia
110b331b8efSEzequiel Garcia  phy-supply:
111b331b8efSEzequiel Garcia    description: PHY regulator
112b331b8efSEzequiel Garcia
113b331b8efSEzequiel Garciarequired:
114b331b8efSEzequiel Garcia  - compatible
115b331b8efSEzequiel Garcia  - clocks
116b331b8efSEzequiel Garcia  - clock-names
117b331b8efSEzequiel Garcia
118b331b8efSEzequiel GarciaunevaluatedProperties: false
119b331b8efSEzequiel Garcia
120b331b8efSEzequiel Garciaexamples:
121b331b8efSEzequiel Garcia  - |
122b331b8efSEzequiel Garcia    #include <dt-bindings/interrupt-controller/arm-gic.h>
123b331b8efSEzequiel Garcia    #include <dt-bindings/clock/rk3288-cru.h>
124b331b8efSEzequiel Garcia
125b331b8efSEzequiel Garcia    gmac: ethernet@ff290000 {
126b331b8efSEzequiel Garcia        compatible = "rockchip,rk3288-gmac";
127b331b8efSEzequiel Garcia        reg = <0xff290000 0x10000>;
128b331b8efSEzequiel Garcia        interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>;
129b331b8efSEzequiel Garcia        interrupt-names = "macirq";
130b331b8efSEzequiel Garcia        clocks = <&cru SCLK_MAC>,
131b331b8efSEzequiel Garcia                 <&cru SCLK_MAC_RX>, <&cru SCLK_MAC_TX>,
132b331b8efSEzequiel Garcia                 <&cru SCLK_MACREF>, <&cru SCLK_MACREF_OUT>,
133b331b8efSEzequiel Garcia                 <&cru ACLK_GMAC>, <&cru PCLK_GMAC>;
134b331b8efSEzequiel Garcia        clock-names = "stmmaceth",
135b331b8efSEzequiel Garcia                      "mac_clk_rx", "mac_clk_tx",
136b331b8efSEzequiel Garcia                      "clk_mac_ref", "clk_mac_refout",
137b331b8efSEzequiel Garcia                      "aclk_mac", "pclk_mac";
138b331b8efSEzequiel Garcia        assigned-clocks = <&cru SCLK_MAC>;
139b331b8efSEzequiel Garcia        assigned-clock-parents = <&ext_gmac>;
140b331b8efSEzequiel Garcia
141b331b8efSEzequiel Garcia        rockchip,grf = <&grf>;
142220d63f2SSascha Hauer        phy-mode = "rgmii-id";
143b331b8efSEzequiel Garcia        clock_in_out = "input";
144b331b8efSEzequiel Garcia    };
145