]>
Commit | Line | Data |
---|---|---|
2bf209b8 CL |
1 | * Allwinner sun8i GMAC ethernet controller |
2 | ||
3 | This device is a platform glue layer for stmmac. | |
4 | Please see stmmac.txt for the other unchanged properties. | |
5 | ||
6 | Required properties: | |
079573e3 | 7 | - compatible: must be one of the following string: |
2bf209b8 CL |
8 | "allwinner,sun8i-a83t-emac" |
9 | "allwinner,sun8i-h3-emac" | |
10 | "allwinner,sun8i-v3s-emac" | |
11 | "allwinner,sun50i-a64-emac" | |
12 | - reg: address and length of the register for the device. | |
13 | - interrupts: interrupt for the device | |
079573e3 | 14 | - interrupt-names: must be "macirq" |
2bf209b8 | 15 | - clocks: A phandle to the reference clock for this device |
079573e3 | 16 | - clock-names: must be "stmmaceth" |
2bf209b8 | 17 | - resets: A phandle to the reset control for this device |
079573e3 | 18 | - reset-names: must be "stmmaceth" |
2bf209b8 CL |
19 | - phy-mode: See ethernet.txt |
20 | - phy-handle: See ethernet.txt | |
21 | - #address-cells: shall be 1 | |
22 | - #size-cells: shall be 0 | |
23 | - syscon: A phandle to the syscon of the SoC with one of the following | |
24 | compatible string: | |
9ed3fec3 | 25 | - allwinner,sun8i-a83t-system-controller |
2bf209b8 CL |
26 | - allwinner,sun8i-h3-system-controller |
27 | - allwinner,sun8i-v3s-system-controller | |
28 | - allwinner,sun50i-a64-system-controller | |
2bf209b8 CL |
29 | |
30 | Optional properties: | |
a4a78a97 CYT |
31 | - allwinner,tx-delay-ps: TX clock delay chain value in ps. |
32 | Range is 0-700. Default is 0. | |
33 | - allwinner,rx-delay-ps: RX clock delay chain value in ps. | |
34 | Range is 0-3100. Default is 0. | |
35 | Both delay properties need to be a multiple of 100. They control the | |
36 | clock delay for external RGMII PHY. They do not apply to the internal | |
37 | PHY or external non-RGMII PHYs. | |
2bf209b8 CL |
38 | |
39 | Optional properties for the following compatibles: | |
40 | - "allwinner,sun8i-h3-emac", | |
41 | - "allwinner,sun8i-v3s-emac": | |
42 | - allwinner,leds-active-low: EPHY LEDs are active low | |
43 | ||
44 | Required child node of emac: | |
079573e3 | 45 | - mdio bus node: should be named mdio with compatible "snps,dwmac-mdio" |
2bf209b8 CL |
46 | |
47 | Required properties of the mdio node: | |
48 | - #address-cells: shall be 1 | |
49 | - #size-cells: shall be 0 | |
50 | ||
079573e3 | 51 | The device node referenced by "phy" or "phy-handle" must be a child node |
2bf209b8 CL |
52 | of the mdio node. See phy.txt for the generic PHY bindings. |
53 | ||
079573e3 CL |
54 | The following compatibles require that the emac node have a mdio-mux child |
55 | node called "mdio-mux": | |
56 | - "allwinner,sun8i-h3-emac" | |
57 | - "allwinner,sun8i-v3s-emac": | |
58 | Required properties for the mdio-mux node: | |
59 | - compatible = "allwinner,sun8i-h3-mdio-mux" | |
60 | - mdio-parent-bus: a phandle to EMAC mdio | |
61 | - one child mdio for the integrated mdio with the compatible | |
62 | "allwinner,sun8i-h3-mdio-internal" | |
63 | - one child mdio for the external mdio if present (V3s have none) | |
64 | Required properties for the mdio-mux children node: | |
65 | - reg: 1 for internal MDIO bus, 2 for external MDIO bus | |
66 | ||
67 | The following compatibles require a PHY node representing the integrated | |
68 | PHY, under the integrated MDIO bus node if an mdio-mux node is used: | |
2bf209b8 CL |
69 | - "allwinner,sun8i-h3-emac", |
70 | - "allwinner,sun8i-v3s-emac": | |
079573e3 CL |
71 | |
72 | Additional information regarding generic multiplexer properties can be found | |
73 | at Documentation/devicetree/bindings/net/mdio-mux.txt | |
74 | ||
75 | Required properties of the integrated phy node: | |
2bf209b8 CL |
76 | - clocks: a phandle to the reference clock for the EPHY |
77 | - resets: a phandle to the reset control for the EPHY | |
079573e3 | 78 | - Must be a child of the integrated mdio |
2bf209b8 | 79 | |
079573e3 | 80 | Example with integrated PHY: |
2bf209b8 CL |
81 | emac: ethernet@1c0b000 { |
82 | compatible = "allwinner,sun8i-h3-emac"; | |
83 | syscon = <&syscon>; | |
84 | reg = <0x01c0b000 0x104>; | |
85 | interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>; | |
86 | interrupt-names = "macirq"; | |
87 | resets = <&ccu RST_BUS_EMAC>; | |
88 | reset-names = "stmmaceth"; | |
89 | clocks = <&ccu CLK_BUS_EMAC>; | |
90 | clock-names = "stmmaceth"; | |
91 | #address-cells = <1>; | |
92 | #size-cells = <0>; | |
93 | ||
94 | phy-handle = <&int_mii_phy>; | |
95 | phy-mode = "mii"; | |
96 | allwinner,leds-active-low; | |
079573e3 CL |
97 | |
98 | mdio: mdio { | |
99 | #address-cells = <1>; | |
100 | #size-cells = <0>; | |
101 | compatible = "snps,dwmac-mdio"; | |
102 | }; | |
103 | ||
104 | mdio-mux { | |
105 | compatible = "mdio-mux", "allwinner,sun8i-h3-mdio-mux"; | |
106 | #address-cells = <1>; | |
107 | #size-cells = <0>; | |
108 | ||
109 | mdio-parent-bus = <&mdio>; | |
110 | ||
111 | int_mdio: mdio@1 { | |
112 | compatible = "allwinner,sun8i-h3-mdio-internal"; | |
113 | reg = <1>; | |
114 | #address-cells = <1>; | |
115 | #size-cells = <0>; | |
116 | int_mii_phy: ethernet-phy@1 { | |
117 | reg = <1>; | |
118 | clocks = <&ccu CLK_BUS_EPHY>; | |
119 | resets = <&ccu RST_BUS_EPHY>; | |
120 | phy-is-integrated; | |
121 | }; | |
122 | }; | |
123 | ext_mdio: mdio@2 { | |
124 | reg = <2>; | |
125 | #address-cells = <1>; | |
126 | #size-cells = <0>; | |
127 | }; | |
128 | }; | |
129 | }; | |
130 | ||
131 | Example with external PHY: | |
132 | emac: ethernet@1c0b000 { | |
133 | compatible = "allwinner,sun8i-h3-emac"; | |
134 | syscon = <&syscon>; | |
135 | reg = <0x01c0b000 0x104>; | |
136 | interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>; | |
137 | interrupt-names = "macirq"; | |
138 | resets = <&ccu RST_BUS_EMAC>; | |
139 | reset-names = "stmmaceth"; | |
140 | clocks = <&ccu CLK_BUS_EMAC>; | |
141 | clock-names = "stmmaceth"; | |
142 | #address-cells = <1>; | |
143 | #size-cells = <0>; | |
144 | ||
145 | phy-handle = <&ext_rgmii_phy>; | |
146 | phy-mode = "rgmii"; | |
147 | allwinner,leds-active-low; | |
148 | ||
149 | mdio: mdio { | |
150 | #address-cells = <1>; | |
151 | #size-cells = <0>; | |
152 | compatible = "snps,dwmac-mdio"; | |
153 | }; | |
154 | ||
155 | mdio-mux { | |
156 | compatible = "allwinner,sun8i-h3-mdio-mux"; | |
157 | #address-cells = <1>; | |
158 | #size-cells = <0>; | |
159 | ||
160 | mdio-parent-bus = <&mdio>; | |
161 | ||
162 | int_mdio: mdio@1 { | |
163 | compatible = "allwinner,sun8i-h3-mdio-internal"; | |
164 | reg = <1>; | |
165 | #address-cells = <1>; | |
166 | #size-cells = <0>; | |
167 | int_mii_phy: ethernet-phy@1 { | |
168 | reg = <1>; | |
169 | clocks = <&ccu CLK_BUS_EPHY>; | |
170 | resets = <&ccu RST_BUS_EPHY>; | |
171 | }; | |
172 | }; | |
173 | ext_mdio: mdio@2 { | |
174 | reg = <2>; | |
175 | #address-cells = <1>; | |
176 | #size-cells = <0>; | |
177 | ext_rgmii_phy: ethernet-phy@1 { | |
178 | reg = <1>; | |
179 | }; | |
180 | }: | |
181 | }; | |
182 | }; | |
183 | ||
184 | Example with SoC without integrated PHY | |
185 | ||
186 | emac: ethernet@1c0b000 { | |
187 | compatible = "allwinner,sun8i-a83t-emac"; | |
188 | syscon = <&syscon>; | |
189 | reg = <0x01c0b000 0x104>; | |
190 | interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>; | |
191 | interrupt-names = "macirq"; | |
192 | resets = <&ccu RST_BUS_EMAC>; | |
193 | reset-names = "stmmaceth"; | |
194 | clocks = <&ccu CLK_BUS_EMAC>; | |
195 | clock-names = "stmmaceth"; | |
196 | #address-cells = <1>; | |
197 | #size-cells = <0>; | |
198 | ||
199 | phy-handle = <&ext_rgmii_phy>; | |
200 | phy-mode = "rgmii"; | |
201 | ||
2bf209b8 | 202 | mdio: mdio { |
079573e3 | 203 | compatible = "snps,dwmac-mdio"; |
2bf209b8 CL |
204 | #address-cells = <1>; |
205 | #size-cells = <0>; | |
079573e3 | 206 | ext_rgmii_phy: ethernet-phy@1 { |
2bf209b8 | 207 | reg = <1>; |
2bf209b8 CL |
208 | }; |
209 | }; | |
210 | }; |