]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - arch/arm64/boot/dts/rockchip/rk3328-rock64.dts
arm64: dts: rockchip: fix rock64 gmac2io stability issues
[mirror_ubuntu-bionic-kernel.git] / arch / arm64 / boot / dts / rockchip / rk3328-rock64.dts
1 /*
2 * Copyright (c) 2017 PINE64
3 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPL or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 * a) This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Or, alternatively,
20 *
21 * b) Permission is hereby granted, free of charge, to any person
22 * obtaining a copy of this software and associated documentation
23 * files (the "Software"), to deal in the Software without
24 * restriction, including without limitation the rights to use,
25 * copy, modify, merge, publish, distribute, sublicense, and/or
26 * sell copies of the Software, and to permit persons to whom the
27 * Software is furnished to do so, subject to the following
28 * conditions:
29 *
30 * The above copyright notice and this permission notice shall be
31 * included in all copies or substantial portions of the Software.
32 *
33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40 * OTHER DEALINGS IN THE SOFTWARE.
41 */
42
43 /dts-v1/;
44 #include "rk3328.dtsi"
45
46 / {
47 model = "Pine64 Rock64";
48 compatible = "pine64,rock64", "rockchip,rk3328";
49
50 chosen {
51 stdout-path = "serial2:1500000n8";
52 };
53
54 gmac_clkin: external-gmac-clock {
55 compatible = "fixed-clock";
56 clock-frequency = <125000000>;
57 clock-output-names = "gmac_clkin";
58 #clock-cells = <0>;
59 };
60
61 vcc_sd: sdmmc-regulator {
62 compatible = "regulator-fixed";
63 gpio = <&gpio0 RK_PD6 GPIO_ACTIVE_LOW>;
64 pinctrl-names = "default";
65 pinctrl-0 = <&sdmmc0m1_gpio>;
66 regulator-name = "vcc_sd";
67 regulator-min-microvolt = <3300000>;
68 regulator-max-microvolt = <3300000>;
69 vin-supply = <&vcc_io>;
70 };
71
72 vcc_host_5v: vcc-host-5v-regulator {
73 compatible = "regulator-fixed";
74 enable-active-high;
75 gpio = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>;
76 pinctrl-names = "default";
77 pinctrl-0 = <&usb30_host_drv>;
78 regulator-name = "vcc_host_5v";
79 regulator-always-on;
80 vin-supply = <&vcc_sys>;
81 };
82
83 vcc_host1_5v: vcc_otg_5v: vcc-host1-5v-regulator {
84 compatible = "regulator-fixed";
85 enable-active-high;
86 gpio = <&gpio0 RK_PD3 GPIO_ACTIVE_HIGH>;
87 pinctrl-names = "default";
88 pinctrl-0 = <&usb20_host_drv>;
89 regulator-name = "vcc_host1_5v";
90 regulator-always-on;
91 vin-supply = <&vcc_sys>;
92 };
93
94 vcc_sys: vcc-sys {
95 compatible = "regulator-fixed";
96 regulator-name = "vcc_sys";
97 regulator-always-on;
98 regulator-boot-on;
99 regulator-min-microvolt = <5000000>;
100 regulator-max-microvolt = <5000000>;
101 };
102 };
103
104 &cpu0 {
105 cpu-supply = <&vdd_arm>;
106 };
107
108 &cpu1 {
109 cpu-supply = <&vdd_arm>;
110 };
111
112 &cpu2 {
113 cpu-supply = <&vdd_arm>;
114 };
115
116 &cpu3 {
117 cpu-supply = <&vdd_arm>;
118 };
119
120 &emmc {
121 bus-width = <8>;
122 cap-mmc-highspeed;
123 non-removable;
124 pinctrl-names = "default";
125 pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
126 vmmc-supply = <&vcc_io>;
127 vqmmc-supply = <&vcc18_emmc>;
128 status = "okay";
129 };
130
131 &gmac2io {
132 assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
133 assigned-clock-parents = <&gmac_clkin>, <&gmac_clkin>;
134 clock_in_out = "input";
135 /* shows instability at 1GBit right now */
136 max-speed = <100>;
137 phy-supply = <&vcc_io>;
138 phy-mode = "rgmii";
139 pinctrl-names = "default";
140 pinctrl-0 = <&rgmiim1_pins>;
141 snps,force_thresh_dma_mode;
142 snps,reset-gpio = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>;
143 snps,reset-active-low;
144 snps,reset-delays-us = <0 10000 50000>;
145 tx_delay = <0x24>;
146 rx_delay = <0x18>;
147 status = "okay";
148 };
149
150 &i2c1 {
151 status = "okay";
152
153 rk805: rk805@18 {
154 compatible = "rockchip,rk805";
155 reg = <0x18>;
156 interrupt-parent = <&gpio2>;
157 interrupts = <6 IRQ_TYPE_LEVEL_LOW>;
158 #clock-cells = <1>;
159 clock-output-names = "xin32k", "rk805-clkout2";
160 pinctrl-names = "default";
161 pinctrl-0 = <&pmic_int_l>;
162 rockchip,system-power-controller;
163 wakeup-source;
164
165 vcc1-supply = <&vcc_sys>;
166 vcc2-supply = <&vcc_sys>;
167 vcc3-supply = <&vcc_sys>;
168 vcc4-supply = <&vcc_sys>;
169 vcc5-supply = <&vcc_io>;
170 vcc6-supply = <&vcc_sys>;
171
172 regulators {
173 vdd_logic: DCDC_REG1 {
174 regulator-name = "vdd_logic";
175 regulator-min-microvolt = <712500>;
176 regulator-max-microvolt = <1450000>;
177 regulator-ramp-delay = <12500>;
178 regulator-always-on;
179 regulator-boot-on;
180 regulator-state-mem {
181 regulator-on-in-suspend;
182 regulator-suspend-microvolt = <1000000>;
183 };
184 };
185
186 vdd_arm: DCDC_REG2 {
187 regulator-name = "vdd_arm";
188 regulator-min-microvolt = <712500>;
189 regulator-max-microvolt = <1450000>;
190 regulator-ramp-delay = <12500>;
191 regulator-always-on;
192 regulator-boot-on;
193 regulator-state-mem {
194 regulator-on-in-suspend;
195 regulator-suspend-microvolt = <950000>;
196 };
197 };
198
199 vcc_ddr: DCDC_REG3 {
200 regulator-name = "vcc_ddr";
201 regulator-always-on;
202 regulator-boot-on;
203 regulator-state-mem {
204 regulator-on-in-suspend;
205 };
206 };
207
208 vcc_io: DCDC_REG4 {
209 regulator-name = "vcc_io";
210 regulator-min-microvolt = <3300000>;
211 regulator-max-microvolt = <3300000>;
212 regulator-always-on;
213 regulator-boot-on;
214 regulator-state-mem {
215 regulator-on-in-suspend;
216 regulator-suspend-microvolt = <3300000>;
217 };
218 };
219
220 vcc_18: LDO_REG1 {
221 regulator-name = "vdd_18";
222 regulator-min-microvolt = <1800000>;
223 regulator-max-microvolt = <1800000>;
224 regulator-always-on;
225 regulator-boot-on;
226 regulator-state-mem {
227 regulator-on-in-suspend;
228 regulator-suspend-microvolt = <1800000>;
229 };
230 };
231
232 vcc18_emmc: LDO_REG2 {
233 regulator-name = "vcc_18emmc";
234 regulator-min-microvolt = <1800000>;
235 regulator-max-microvolt = <1800000>;
236 regulator-always-on;
237 regulator-boot-on;
238 regulator-state-mem {
239 regulator-on-in-suspend;
240 regulator-suspend-microvolt = <1800000>;
241 };
242 };
243
244 vdd_10: LDO_REG3 {
245 regulator-name = "vdd_10";
246 regulator-min-microvolt = <1000000>;
247 regulator-max-microvolt = <1000000>;
248 regulator-always-on;
249 regulator-boot-on;
250 regulator-state-mem {
251 regulator-on-in-suspend;
252 regulator-suspend-microvolt = <1000000>;
253 };
254 };
255 };
256 };
257 };
258
259 &io_domains {
260 status = "okay";
261
262 vccio1-supply = <&vcc_io>;
263 vccio2-supply = <&vcc18_emmc>;
264 vccio3-supply = <&vcc_io>;
265 vccio4-supply = <&vcc_18>;
266 vccio5-supply = <&vcc_io>;
267 vccio6-supply = <&vcc_io>;
268 pmuio-supply = <&vcc_io>;
269 };
270
271 &pinctrl {
272 pmic {
273 pmic_int_l: pmic-int-l {
274 rockchip,pins = <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>;
275 };
276 };
277
278 usb2 {
279 usb20_host_drv: usb20-host-drv {
280 rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
281 };
282 };
283
284 usb3 {
285 usb30_host_drv: usb30-host-drv {
286 rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
287 };
288 };
289 };
290
291 &sdmmc {
292 bus-width = <4>;
293 cap-mmc-highspeed;
294 cap-sd-highspeed;
295 disable-wp;
296 max-frequency = <150000000>;
297 pinctrl-names = "default";
298 pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_dectn &sdmmc0_bus4>;
299 vmmc-supply = <&vcc_sd>;
300 status = "okay";
301 };
302
303 &tsadc {
304 rockchip,hw-tshut-mode = <0>;
305 rockchip,hw-tshut-polarity = <0>;
306 status = "okay";
307 };
308
309 &uart2 {
310 status = "okay";
311 };
312
313 &u2phy {
314 status = "okay";
315
316 u2phy_host: host-port {
317 status = "okay";
318 };
319
320 u2phy_otg: otg-port {
321 status = "okay";
322 };
323 };
324
325 &usb20_otg {
326 dr_mode = "host";
327 status = "okay";
328 };
329
330 &usb_host0_ehci {
331 status = "okay";
332 };
333
334 &usb_host0_ohci {
335 status = "okay";
336 };