xref: /linux/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2.dtsi (revision 55d0969c451159cff86949b38c39171cab962069)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2020 David Bauer <mail@david-bauer.net>
4 */
5
6/dts-v1/;
7
8#include <dt-bindings/input/input.h>
9#include <dt-bindings/gpio/gpio.h>
10#include "rk3328.dtsi"
11
12/ {
13	aliases {
14		ethernet0 = &gmac2io;
15		ethernet1 = &rtl8153;
16		mmc0 = &sdmmc;
17	};
18
19	chosen {
20		stdout-path = "serial2:1500000n8";
21	};
22
23	gmac_clk: gmac-clock {
24		compatible = "fixed-clock";
25		clock-frequency = <125000000>;
26		clock-output-names = "gmac_clkin";
27		#clock-cells = <0>;
28	};
29
30	keys {
31		compatible = "gpio-keys";
32		pinctrl-0 = <&reset_button_pin>;
33		pinctrl-names = "default";
34
35		key-reset {
36			label = "reset";
37			gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_LOW>;
38			linux,code = <KEY_RESTART>;
39			debounce-interval = <50>;
40		};
41	};
42
43	leds {
44		compatible = "gpio-leds";
45		pinctrl-0 = <&lan_led_pin>,  <&sys_led_pin>, <&wan_led_pin>;
46		pinctrl-names = "default";
47
48		lan_led: led-0 {
49			gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>;
50			label = "nanopi-r2s:green:lan";
51		};
52
53		sys_led: led-1 {
54			gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
55			label = "nanopi-r2s:red:sys";
56			default-state = "on";
57		};
58
59		wan_led: led-2 {
60			gpios = <&gpio2 RK_PC2 GPIO_ACTIVE_HIGH>;
61			label = "nanopi-r2s:green:wan";
62		};
63	};
64
65	vcc_io_sdio: sdmmcio-regulator {
66		compatible = "regulator-gpio";
67		enable-active-high;
68		gpios = <&gpio1 RK_PD4 GPIO_ACTIVE_HIGH>;
69		pinctrl-0 = <&sdio_vcc_pin>;
70		pinctrl-names = "default";
71		regulator-name = "vcc_io_sdio";
72		regulator-always-on;
73		regulator-min-microvolt = <1800000>;
74		regulator-max-microvolt = <3300000>;
75		regulator-settling-time-us = <5000>;
76		regulator-type = "voltage";
77		startup-delay-us = <2000>;
78		states = <1800000 0x1>,
79			 <3300000 0x0>;
80		vin-supply = <&vcc_io_33>;
81	};
82
83	vcc_sd: sdmmc-regulator {
84		compatible = "regulator-fixed";
85		gpio = <&gpio0 RK_PD6 GPIO_ACTIVE_LOW>;
86		pinctrl-0 = <&sdmmc0m1_pin>;
87		pinctrl-names = "default";
88		regulator-name = "vcc_sd";
89		regulator-boot-on;
90		regulator-min-microvolt = <3300000>;
91		regulator-max-microvolt = <3300000>;
92		vin-supply = <&vcc_io_33>;
93	};
94
95	vdd_5v: vdd-5v {
96		compatible = "regulator-fixed";
97		regulator-name = "vdd_5v";
98		regulator-always-on;
99		regulator-boot-on;
100		regulator-min-microvolt = <5000000>;
101		regulator-max-microvolt = <5000000>;
102	};
103
104	vdd_5v_lan: vdd-5v-lan {
105		compatible = "regulator-fixed";
106		enable-active-high;
107		gpio = <&gpio2 RK_PC6 GPIO_ACTIVE_HIGH>;
108		pinctrl-0 = <&lan_vdd_pin>;
109		pinctrl-names = "default";
110		regulator-name = "vdd_5v_lan";
111		regulator-always-on;
112		regulator-boot-on;
113		vin-supply = <&vdd_5v>;
114	};
115};
116
117&cpu0 {
118	cpu-supply = <&vdd_arm>;
119};
120
121&cpu1 {
122	cpu-supply = <&vdd_arm>;
123};
124
125&cpu2 {
126	cpu-supply = <&vdd_arm>;
127};
128
129&cpu3 {
130	cpu-supply = <&vdd_arm>;
131};
132
133&display_subsystem {
134	status = "disabled";
135};
136
137&gmac2io {
138	assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
139	assigned-clock-parents = <&gmac_clk>, <&gmac_clk>;
140	clock_in_out = "input";
141	phy-mode = "rgmii";
142	phy-supply = <&vcc_io_33>;
143	pinctrl-0 = <&rgmiim1_pins>;
144	pinctrl-names = "default";
145	snps,aal;
146
147	mdio {
148		compatible = "snps,dwmac-mdio";
149		#address-cells = <1>;
150		#size-cells = <0>;
151	};
152};
153
154&i2c1 {
155	status = "okay";
156
157	rk805: pmic@18 {
158		compatible = "rockchip,rk805";
159		reg = <0x18>;
160		interrupt-parent = <&gpio1>;
161		interrupts = <24 IRQ_TYPE_LEVEL_LOW>;
162		#clock-cells = <1>;
163		clock-output-names = "xin32k", "rk805-clkout2";
164		gpio-controller;
165		#gpio-cells = <2>;
166		pinctrl-0 = <&pmic_int_l>;
167		pinctrl-names = "default";
168		system-power-controller;
169		wakeup-source;
170
171		vcc1-supply = <&vdd_5v>;
172		vcc2-supply = <&vdd_5v>;
173		vcc3-supply = <&vdd_5v>;
174		vcc4-supply = <&vdd_5v>;
175		vcc5-supply = <&vcc_io_33>;
176		vcc6-supply = <&vdd_5v>;
177
178		regulators {
179			vdd_log: DCDC_REG1 {
180				regulator-name = "vdd_log";
181				regulator-always-on;
182				regulator-boot-on;
183				regulator-min-microvolt = <712500>;
184				regulator-max-microvolt = <1450000>;
185				regulator-ramp-delay = <12500>;
186
187				regulator-state-mem {
188					regulator-on-in-suspend;
189					regulator-suspend-microvolt = <1000000>;
190				};
191			};
192
193			vdd_arm: DCDC_REG2 {
194				regulator-name = "vdd_arm";
195				regulator-always-on;
196				regulator-boot-on;
197				regulator-min-microvolt = <712500>;
198				regulator-max-microvolt = <1450000>;
199				regulator-ramp-delay = <12500>;
200
201				regulator-state-mem {
202					regulator-on-in-suspend;
203					regulator-suspend-microvolt = <950000>;
204				};
205			};
206
207			vcc_ddr: DCDC_REG3 {
208				regulator-name = "vcc_ddr";
209				regulator-always-on;
210				regulator-boot-on;
211
212				regulator-state-mem {
213					regulator-on-in-suspend;
214				};
215			};
216
217			vcc_io_33: DCDC_REG4 {
218				regulator-name = "vcc_io_33";
219				regulator-always-on;
220				regulator-boot-on;
221				regulator-min-microvolt = <3300000>;
222				regulator-max-microvolt = <3300000>;
223
224				regulator-state-mem {
225					regulator-on-in-suspend;
226					regulator-suspend-microvolt = <3300000>;
227				};
228			};
229
230			vcc_18: LDO_REG1 {
231				regulator-name = "vcc_18";
232				regulator-always-on;
233				regulator-boot-on;
234				regulator-min-microvolt = <1800000>;
235				regulator-max-microvolt = <1800000>;
236
237				regulator-state-mem {
238					regulator-on-in-suspend;
239					regulator-suspend-microvolt = <1800000>;
240				};
241			};
242
243			vcc18_emmc: LDO_REG2 {
244				regulator-name = "vcc18_emmc";
245				regulator-always-on;
246				regulator-boot-on;
247				regulator-min-microvolt = <1800000>;
248				regulator-max-microvolt = <1800000>;
249
250				regulator-state-mem {
251					regulator-on-in-suspend;
252					regulator-suspend-microvolt = <1800000>;
253				};
254			};
255
256			vdd_10: LDO_REG3 {
257				regulator-name = "vdd_10";
258				regulator-always-on;
259				regulator-boot-on;
260				regulator-min-microvolt = <1000000>;
261				regulator-max-microvolt = <1000000>;
262
263				regulator-state-mem {
264					regulator-on-in-suspend;
265					regulator-suspend-microvolt = <1000000>;
266				};
267			};
268		};
269	};
270};
271
272&io_domains {
273	pmuio-supply = <&vcc_io_33>;
274	vccio1-supply = <&vcc_io_33>;
275	vccio2-supply = <&vcc18_emmc>;
276	vccio3-supply = <&vcc_io_sdio>;
277	vccio4-supply = <&vcc_18>;
278	vccio5-supply = <&vcc_io_33>;
279	vccio6-supply = <&vcc_io_33>;
280	status = "okay";
281};
282
283&pinctrl {
284	button {
285		reset_button_pin: reset-button-pin {
286			rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
287		};
288	};
289
290	gmac2io {
291		eth_phy_reset_pin: eth-phy-reset-pin {
292			rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>;
293		};
294	};
295
296	leds {
297		lan_led_pin: lan-led-pin {
298			rockchip,pins = <2 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
299		};
300
301		sys_led_pin: sys-led-pin {
302			rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
303		};
304
305		wan_led_pin: wan-led-pin {
306			rockchip,pins = <2 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
307		};
308	};
309
310	lan {
311		lan_vdd_pin: lan-vdd-pin {
312			rockchip,pins = <2 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
313		};
314	};
315
316	pmic {
317		pmic_int_l: pmic-int-l {
318			rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_up>;
319		};
320	};
321
322	sd {
323		sdio_vcc_pin: sdio-vcc-pin {
324			rockchip,pins = <1 RK_PD4 RK_FUNC_GPIO &pcfg_pull_up>;
325		};
326	};
327};
328
329&pwm2 {
330	status = "okay";
331};
332
333&sdmmc {
334	bus-width = <4>;
335	cap-sd-highspeed;
336	disable-wp;
337	pinctrl-0 = <&sdmmc0_clk>, <&sdmmc0_cmd>, <&sdmmc0_dectn>, <&sdmmc0_bus4>;
338	pinctrl-names = "default";
339	sd-uhs-sdr12;
340	sd-uhs-sdr25;
341	sd-uhs-sdr50;
342	sd-uhs-sdr104;
343	vmmc-supply = <&vcc_sd>;
344	vqmmc-supply = <&vcc_io_sdio>;
345	status = "okay";
346};
347
348&tsadc {
349	rockchip,hw-tshut-mode = <0>;
350	rockchip,hw-tshut-polarity = <0>;
351	status = "okay";
352};
353
354&u2phy {
355	status = "okay";
356};
357
358&u2phy_host {
359	status = "okay";
360};
361
362&u2phy_otg {
363	status = "okay";
364};
365
366&uart2 {
367	status = "okay";
368};
369
370&usb20_otg {
371	status = "okay";
372	dr_mode = "host";
373};
374
375&usbdrd3 {
376	dr_mode = "host";
377	status = "okay";
378	#address-cells = <1>;
379	#size-cells = <0>;
380
381	/* Second port is for USB 3.0 */
382	rtl8153: device@2 {
383		compatible = "usbbda,8153";
384		reg = <2>;
385	};
386};
387
388&usb_host0_ehci {
389	status = "okay";
390};
391
392&usb_host0_ohci {
393	status = "okay";
394};
395