xref: /freebsd/sys/contrib/device-tree/Bindings/net/allwinner,sun8i-a83t-emac.yaml (revision 7ef62cebc2f965b0f640263e179276928885e33d)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/net/allwinner,sun8i-a83t-emac.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
7*7ef62cebSEmmanuel Vadottitle: Allwinner A83t EMAC
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotmaintainers:
10c66ec88fSEmmanuel Vadot  - Chen-Yu Tsai <wens@csie.org>
11c66ec88fSEmmanuel Vadot  - Maxime Ripard <mripard@kernel.org>
12c66ec88fSEmmanuel Vadot
13c66ec88fSEmmanuel Vadotproperties:
14c66ec88fSEmmanuel Vadot  compatible:
15c66ec88fSEmmanuel Vadot    oneOf:
16c66ec88fSEmmanuel Vadot      - const: allwinner,sun8i-a83t-emac
17c66ec88fSEmmanuel Vadot      - const: allwinner,sun8i-h3-emac
188cc087a1SEmmanuel Vadot      - const: allwinner,sun8i-r40-gmac
19c66ec88fSEmmanuel Vadot      - const: allwinner,sun8i-v3s-emac
20c66ec88fSEmmanuel Vadot      - const: allwinner,sun50i-a64-emac
21c66ec88fSEmmanuel Vadot      - items:
22354d7675SEmmanuel Vadot          - enum:
23354d7675SEmmanuel Vadot              - allwinner,sun20i-d1-emac
24354d7675SEmmanuel Vadot              - allwinner,sun50i-h6-emac
25b97ee269SEmmanuel Vadot              - allwinner,sun50i-h616-emac0
26c66ec88fSEmmanuel Vadot          - const: allwinner,sun50i-a64-emac
27c66ec88fSEmmanuel Vadot
28c66ec88fSEmmanuel Vadot  reg:
29c66ec88fSEmmanuel Vadot    maxItems: 1
30c66ec88fSEmmanuel Vadot
31c66ec88fSEmmanuel Vadot  interrupts:
32c66ec88fSEmmanuel Vadot    maxItems: 1
33c66ec88fSEmmanuel Vadot
34c66ec88fSEmmanuel Vadot  interrupt-names:
35c66ec88fSEmmanuel Vadot    const: macirq
36c66ec88fSEmmanuel Vadot
37c66ec88fSEmmanuel Vadot  clocks:
38c66ec88fSEmmanuel Vadot    maxItems: 1
39c66ec88fSEmmanuel Vadot
40c66ec88fSEmmanuel Vadot  clock-names:
41c66ec88fSEmmanuel Vadot    const: stmmaceth
42c66ec88fSEmmanuel Vadot
43c66ec88fSEmmanuel Vadot  syscon:
445def4c47SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/phandle
45c66ec88fSEmmanuel Vadot    description:
46c66ec88fSEmmanuel Vadot      Phandle to the device containing the EMAC or GMAC clock
47c66ec88fSEmmanuel Vadot      register
48c66ec88fSEmmanuel Vadot
49c66ec88fSEmmanuel Vadotrequired:
50c66ec88fSEmmanuel Vadot  - compatible
51c66ec88fSEmmanuel Vadot  - reg
52c66ec88fSEmmanuel Vadot  - interrupts
53c66ec88fSEmmanuel Vadot  - interrupt-names
54c66ec88fSEmmanuel Vadot  - clocks
55c66ec88fSEmmanuel Vadot  - clock-names
56c66ec88fSEmmanuel Vadot  - resets
57c66ec88fSEmmanuel Vadot  - reset-names
58c66ec88fSEmmanuel Vadot  - phy-handle
59c66ec88fSEmmanuel Vadot  - phy-mode
60c66ec88fSEmmanuel Vadot  - syscon
61c66ec88fSEmmanuel Vadot
62c66ec88fSEmmanuel VadotallOf:
63c66ec88fSEmmanuel Vadot  - $ref: "snps,dwmac.yaml#"
64c66ec88fSEmmanuel Vadot  - if:
65c66ec88fSEmmanuel Vadot      properties:
66c66ec88fSEmmanuel Vadot        compatible:
67c66ec88fSEmmanuel Vadot          contains:
68c66ec88fSEmmanuel Vadot            enum:
69c66ec88fSEmmanuel Vadot              - allwinner,sun8i-a83t-emac
70c66ec88fSEmmanuel Vadot              - allwinner,sun8i-h3-emac
71c66ec88fSEmmanuel Vadot              - allwinner,sun8i-v3s-emac
72c66ec88fSEmmanuel Vadot              - allwinner,sun50i-a64-emac
73c66ec88fSEmmanuel Vadot
74c66ec88fSEmmanuel Vadot    then:
75c66ec88fSEmmanuel Vadot      properties:
76c66ec88fSEmmanuel Vadot        allwinner,tx-delay-ps:
77c66ec88fSEmmanuel Vadot          default: 0
78c66ec88fSEmmanuel Vadot          minimum: 0
79c66ec88fSEmmanuel Vadot          maximum: 700
80c66ec88fSEmmanuel Vadot          multipleOf: 100
81c66ec88fSEmmanuel Vadot          description:
82c66ec88fSEmmanuel Vadot            External RGMII PHY TX clock delay chain value in ps.
83c66ec88fSEmmanuel Vadot
84c66ec88fSEmmanuel Vadot        allwinner,rx-delay-ps:
85c66ec88fSEmmanuel Vadot          default: 0
86c66ec88fSEmmanuel Vadot          minimum: 0
87c66ec88fSEmmanuel Vadot          maximum: 3100
88c66ec88fSEmmanuel Vadot          multipleOf: 100
89c66ec88fSEmmanuel Vadot          description:
90c66ec88fSEmmanuel Vadot            External RGMII PHY TX clock delay chain value in ps.
91c66ec88fSEmmanuel Vadot
92c66ec88fSEmmanuel Vadot  - if:
93c66ec88fSEmmanuel Vadot      properties:
94c66ec88fSEmmanuel Vadot        compatible:
95c66ec88fSEmmanuel Vadot          contains:
96c66ec88fSEmmanuel Vadot            enum:
978cc087a1SEmmanuel Vadot              - allwinner,sun8i-r40-gmac
98c66ec88fSEmmanuel Vadot
99c66ec88fSEmmanuel Vadot    then:
100c66ec88fSEmmanuel Vadot      properties:
101c66ec88fSEmmanuel Vadot        allwinner,rx-delay-ps:
102c66ec88fSEmmanuel Vadot          default: 0
103c66ec88fSEmmanuel Vadot          minimum: 0
104c66ec88fSEmmanuel Vadot          maximum: 700
105c66ec88fSEmmanuel Vadot          multipleOf: 100
106c66ec88fSEmmanuel Vadot          description:
107c66ec88fSEmmanuel Vadot            External RGMII PHY TX clock delay chain value in ps.
108c66ec88fSEmmanuel Vadot
109c66ec88fSEmmanuel Vadot  - if:
110c66ec88fSEmmanuel Vadot      properties:
111c66ec88fSEmmanuel Vadot        compatible:
112c66ec88fSEmmanuel Vadot          contains:
113c66ec88fSEmmanuel Vadot            enum:
114c66ec88fSEmmanuel Vadot              - allwinner,sun8i-h3-emac
115c66ec88fSEmmanuel Vadot              - allwinner,sun8i-v3s-emac
116c66ec88fSEmmanuel Vadot
117c66ec88fSEmmanuel Vadot    then:
118c66ec88fSEmmanuel Vadot      properties:
119c66ec88fSEmmanuel Vadot        allwinner,leds-active-low:
1205def4c47SEmmanuel Vadot          $ref: /schemas/types.yaml#/definitions/flag
121c66ec88fSEmmanuel Vadot          description:
122c66ec88fSEmmanuel Vadot            EPHY LEDs are active low.
123c66ec88fSEmmanuel Vadot
124c66ec88fSEmmanuel Vadot        mdio-mux:
125c66ec88fSEmmanuel Vadot          type: object
126e67e8565SEmmanuel Vadot          unevaluatedProperties: false
127c66ec88fSEmmanuel Vadot
128c66ec88fSEmmanuel Vadot          properties:
129c66ec88fSEmmanuel Vadot            compatible:
130c66ec88fSEmmanuel Vadot              const: allwinner,sun8i-h3-mdio-mux
131c66ec88fSEmmanuel Vadot
132c66ec88fSEmmanuel Vadot            mdio-parent-bus:
1335def4c47SEmmanuel Vadot              $ref: /schemas/types.yaml#/definitions/phandle
134c66ec88fSEmmanuel Vadot              description:
135c66ec88fSEmmanuel Vadot                Phandle to EMAC MDIO.
136c66ec88fSEmmanuel Vadot
137c66ec88fSEmmanuel Vadot            "#address-cells":
138c66ec88fSEmmanuel Vadot              const: 1
139c66ec88fSEmmanuel Vadot
140c66ec88fSEmmanuel Vadot            "#size-cells":
141c66ec88fSEmmanuel Vadot              const: 0
142c66ec88fSEmmanuel Vadot
143e67e8565SEmmanuel Vadot            mdio@1:
144e67e8565SEmmanuel Vadot              $ref: mdio.yaml#
145e67e8565SEmmanuel Vadot              unevaluatedProperties: false
146e67e8565SEmmanuel Vadot              description: Internal MDIO Bus
147e67e8565SEmmanuel Vadot
148e67e8565SEmmanuel Vadot              properties:
149c66ec88fSEmmanuel Vadot                compatible:
150c66ec88fSEmmanuel Vadot                  const: allwinner,sun8i-h3-mdio-internal
151c66ec88fSEmmanuel Vadot
152c66ec88fSEmmanuel Vadot                reg:
153c66ec88fSEmmanuel Vadot                  const: 1
154c66ec88fSEmmanuel Vadot
155c66ec88fSEmmanuel Vadot              patternProperties:
156c66ec88fSEmmanuel Vadot                "^ethernet-phy@[0-9a-f]$":
157c66ec88fSEmmanuel Vadot                  type: object
158c66ec88fSEmmanuel Vadot                  description:
159c66ec88fSEmmanuel Vadot                    Integrated PHY node
160c66ec88fSEmmanuel Vadot
161c66ec88fSEmmanuel Vadot                  properties:
162c66ec88fSEmmanuel Vadot                    clocks:
163c66ec88fSEmmanuel Vadot                      maxItems: 1
164c66ec88fSEmmanuel Vadot
165c66ec88fSEmmanuel Vadot                    resets:
166c66ec88fSEmmanuel Vadot                      maxItems: 1
167c66ec88fSEmmanuel Vadot
168c66ec88fSEmmanuel Vadot                  required:
169c66ec88fSEmmanuel Vadot                    - clocks
170c66ec88fSEmmanuel Vadot                    - resets
171c66ec88fSEmmanuel Vadot
172c66ec88fSEmmanuel Vadot
173c66ec88fSEmmanuel Vadot            mdio@2:
174e67e8565SEmmanuel Vadot              $ref: mdio.yaml#
175e67e8565SEmmanuel Vadot              unevaluatedProperties: false
176c66ec88fSEmmanuel Vadot              description: External MDIO Bus (H3 only)
177c66ec88fSEmmanuel Vadot
178c66ec88fSEmmanuel Vadot              properties:
179c66ec88fSEmmanuel Vadot                reg:
180c66ec88fSEmmanuel Vadot                  const: 2
181c66ec88fSEmmanuel Vadot
182c66ec88fSEmmanuel Vadot          required:
183c66ec88fSEmmanuel Vadot            - compatible
184c66ec88fSEmmanuel Vadot            - mdio-parent-bus
185c66ec88fSEmmanuel Vadot            - mdio@1
186c66ec88fSEmmanuel Vadot
187c66ec88fSEmmanuel VadotunevaluatedProperties: false
188c66ec88fSEmmanuel Vadot
189c66ec88fSEmmanuel Vadotexamples:
190c66ec88fSEmmanuel Vadot  - |
191c66ec88fSEmmanuel Vadot    ethernet@1c0b000 {
192c66ec88fSEmmanuel Vadot        compatible = "allwinner,sun8i-h3-emac";
193c66ec88fSEmmanuel Vadot        syscon = <&syscon>;
194c66ec88fSEmmanuel Vadot        reg = <0x01c0b000 0x104>;
195c66ec88fSEmmanuel Vadot        interrupts = <0 82 1>;
196c66ec88fSEmmanuel Vadot        interrupt-names = "macirq";
197c66ec88fSEmmanuel Vadot        resets = <&ccu 12>;
198c66ec88fSEmmanuel Vadot        reset-names = "stmmaceth";
199c66ec88fSEmmanuel Vadot        clocks = <&ccu 27>;
200c66ec88fSEmmanuel Vadot        clock-names = "stmmaceth";
201c66ec88fSEmmanuel Vadot
202c66ec88fSEmmanuel Vadot        phy-handle = <&int_mii_phy>;
203c66ec88fSEmmanuel Vadot        phy-mode = "mii";
204c66ec88fSEmmanuel Vadot        allwinner,leds-active-low;
205c66ec88fSEmmanuel Vadot
206c66ec88fSEmmanuel Vadot        mdio1: mdio {
207c66ec88fSEmmanuel Vadot            #address-cells = <1>;
208c66ec88fSEmmanuel Vadot            #size-cells = <0>;
209c66ec88fSEmmanuel Vadot            compatible = "snps,dwmac-mdio";
210c66ec88fSEmmanuel Vadot        };
211c66ec88fSEmmanuel Vadot
212c66ec88fSEmmanuel Vadot        mdio-mux {
213c66ec88fSEmmanuel Vadot            compatible = "allwinner,sun8i-h3-mdio-mux";
214c66ec88fSEmmanuel Vadot            #address-cells = <1>;
215c66ec88fSEmmanuel Vadot            #size-cells = <0>;
216c66ec88fSEmmanuel Vadot
217c66ec88fSEmmanuel Vadot            mdio-parent-bus = <&mdio1>;
218c66ec88fSEmmanuel Vadot
219c66ec88fSEmmanuel Vadot            int_mii_phy: mdio@1 {
220c66ec88fSEmmanuel Vadot                compatible = "allwinner,sun8i-h3-mdio-internal";
221c66ec88fSEmmanuel Vadot                reg = <1>;
222c66ec88fSEmmanuel Vadot                #address-cells = <1>;
223c66ec88fSEmmanuel Vadot                #size-cells = <0>;
224c66ec88fSEmmanuel Vadot
225c66ec88fSEmmanuel Vadot                ethernet-phy@1 {
226c66ec88fSEmmanuel Vadot                    reg = <1>;
227c66ec88fSEmmanuel Vadot                    clocks = <&ccu 67>;
228c66ec88fSEmmanuel Vadot                    resets = <&ccu 39>;
229c66ec88fSEmmanuel Vadot                    phy-is-integrated;
230c66ec88fSEmmanuel Vadot                };
231c66ec88fSEmmanuel Vadot            };
232c66ec88fSEmmanuel Vadot
233c66ec88fSEmmanuel Vadot            mdio@2 {
234c66ec88fSEmmanuel Vadot                reg = <2>;
235c66ec88fSEmmanuel Vadot                #address-cells = <1>;
236c66ec88fSEmmanuel Vadot                #size-cells = <0>;
237c66ec88fSEmmanuel Vadot            };
238c66ec88fSEmmanuel Vadot        };
239c66ec88fSEmmanuel Vadot    };
240c66ec88fSEmmanuel Vadot
241c66ec88fSEmmanuel Vadot  - |
242c66ec88fSEmmanuel Vadot    ethernet@1c0b000 {
243c66ec88fSEmmanuel Vadot        compatible = "allwinner,sun8i-h3-emac";
244c66ec88fSEmmanuel Vadot        syscon = <&syscon>;
245c66ec88fSEmmanuel Vadot        reg = <0x01c0b000 0x104>;
246c66ec88fSEmmanuel Vadot        interrupts = <0 82 1>;
247c66ec88fSEmmanuel Vadot        interrupt-names = "macirq";
248c66ec88fSEmmanuel Vadot        resets = <&ccu 12>;
249c66ec88fSEmmanuel Vadot        reset-names = "stmmaceth";
250c66ec88fSEmmanuel Vadot        clocks = <&ccu 27>;
251c66ec88fSEmmanuel Vadot        clock-names = "stmmaceth";
252c66ec88fSEmmanuel Vadot
253c66ec88fSEmmanuel Vadot        phy-handle = <&ext_rgmii_phy>;
254c66ec88fSEmmanuel Vadot        phy-mode = "rgmii";
255c66ec88fSEmmanuel Vadot        allwinner,leds-active-low;
256c66ec88fSEmmanuel Vadot
257c66ec88fSEmmanuel Vadot        mdio2: mdio {
258c66ec88fSEmmanuel Vadot            #address-cells = <1>;
259c66ec88fSEmmanuel Vadot            #size-cells = <0>;
260c66ec88fSEmmanuel Vadot            compatible = "snps,dwmac-mdio";
261c66ec88fSEmmanuel Vadot        };
262c66ec88fSEmmanuel Vadot
263c66ec88fSEmmanuel Vadot        mdio-mux {
264c66ec88fSEmmanuel Vadot            compatible = "allwinner,sun8i-h3-mdio-mux";
265c66ec88fSEmmanuel Vadot            #address-cells = <1>;
266c66ec88fSEmmanuel Vadot            #size-cells = <0>;
267c66ec88fSEmmanuel Vadot            mdio-parent-bus = <&mdio2>;
268c66ec88fSEmmanuel Vadot
269c66ec88fSEmmanuel Vadot            mdio@1 {
270c66ec88fSEmmanuel Vadot                compatible = "allwinner,sun8i-h3-mdio-internal";
271c66ec88fSEmmanuel Vadot                reg = <1>;
272c66ec88fSEmmanuel Vadot                #address-cells = <1>;
273c66ec88fSEmmanuel Vadot                #size-cells = <0>;
274c66ec88fSEmmanuel Vadot
275c66ec88fSEmmanuel Vadot                ethernet-phy@1 {
276c66ec88fSEmmanuel Vadot                    reg = <1>;
277c66ec88fSEmmanuel Vadot                    clocks = <&ccu 67>;
278c66ec88fSEmmanuel Vadot                    resets = <&ccu 39>;
279c66ec88fSEmmanuel Vadot                };
280c66ec88fSEmmanuel Vadot            };
281c66ec88fSEmmanuel Vadot
282c66ec88fSEmmanuel Vadot            mdio@2 {
283c66ec88fSEmmanuel Vadot                reg = <2>;
284c66ec88fSEmmanuel Vadot                #address-cells = <1>;
285c66ec88fSEmmanuel Vadot                #size-cells = <0>;
286c66ec88fSEmmanuel Vadot
287c66ec88fSEmmanuel Vadot                ext_rgmii_phy: ethernet-phy@1 {
288c66ec88fSEmmanuel Vadot                    reg = <1>;
289c66ec88fSEmmanuel Vadot                };
290c66ec88fSEmmanuel Vadot            };
291c66ec88fSEmmanuel Vadot        };
292c66ec88fSEmmanuel Vadot    };
293c66ec88fSEmmanuel Vadot
294c66ec88fSEmmanuel Vadot  - |
295c66ec88fSEmmanuel Vadot    ethernet@1c0b000 {
296c66ec88fSEmmanuel Vadot        compatible = "allwinner,sun8i-a83t-emac";
297c66ec88fSEmmanuel Vadot        syscon = <&syscon>;
298c66ec88fSEmmanuel Vadot        reg = <0x01c0b000 0x104>;
299c66ec88fSEmmanuel Vadot        interrupts = <0 82 1>;
300c66ec88fSEmmanuel Vadot        interrupt-names = "macirq";
301c66ec88fSEmmanuel Vadot        resets = <&ccu 13>;
302c66ec88fSEmmanuel Vadot        reset-names = "stmmaceth";
303c66ec88fSEmmanuel Vadot        clocks = <&ccu 27>;
304c66ec88fSEmmanuel Vadot        clock-names = "stmmaceth";
305c66ec88fSEmmanuel Vadot        phy-handle = <&ext_rgmii_phy1>;
306c66ec88fSEmmanuel Vadot        phy-mode = "rgmii";
307c66ec88fSEmmanuel Vadot
308c66ec88fSEmmanuel Vadot        mdio {
309c66ec88fSEmmanuel Vadot            compatible = "snps,dwmac-mdio";
310c66ec88fSEmmanuel Vadot            #address-cells = <1>;
311c66ec88fSEmmanuel Vadot            #size-cells = <0>;
312c66ec88fSEmmanuel Vadot
313c66ec88fSEmmanuel Vadot            ext_rgmii_phy1: ethernet-phy@1 {
314c66ec88fSEmmanuel Vadot                reg = <1>;
315c66ec88fSEmmanuel Vadot            };
316c66ec88fSEmmanuel Vadot        };
317c66ec88fSEmmanuel Vadot    };
318c66ec88fSEmmanuel Vadot
319c66ec88fSEmmanuel Vadot...
320