1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2017 T-Chip Intelligent Technology Co., Ltd
4 */
5
6/dts-v1/;
7#include "rk3328.dtsi"
8
9/ {
10	model = "Firefly roc-rk3328-cc";
11	compatible = "firefly,roc-rk3328-cc", "rockchip,rk3328";
12
13	chosen {
14		stdout-path = "serial2:1500000n8";
15	};
16
17	gmac_clkin: external-gmac-clock {
18		compatible = "fixed-clock";
19		clock-frequency = <125000000>;
20		clock-output-names = "gmac_clkin";
21		#clock-cells = <0>;
22	};
23
24	dc_12v: dc-12v {
25		compatible = "regulator-fixed";
26		regulator-name = "dc_12v";
27		regulator-always-on;
28		regulator-boot-on;
29		regulator-min-microvolt = <12000000>;
30		regulator-max-microvolt = <12000000>;
31	};
32
33	vcc_sd: sdmmc-regulator {
34		compatible = "regulator-fixed";
35		gpio = <&gpio0 RK_PD6 GPIO_ACTIVE_LOW>;
36		pinctrl-names = "default";
37		pinctrl-0 = <&sdmmc0m1_gpio>;
38		regulator-name = "vcc_sd";
39		regulator-min-microvolt = <3300000>;
40		regulator-max-microvolt = <3300000>;
41		vin-supply = <&vcc_io>;
42	};
43
44	vcc_sdio: sdmmcio-regulator {
45		compatible = "regulator-gpio";
46		gpios = <&grf_gpio 0 GPIO_ACTIVE_HIGH>;
47		states = <1800000 0x1
48			  3300000 0x0>;
49		regulator-name = "vcc_sdio";
50		regulator-type = "voltage";
51		regulator-min-microvolt = <1800000>;
52		regulator-max-microvolt = <3300000>;
53		regulator-always-on;
54		vin-supply = <&vcc_sys>;
55	};
56
57	vcc_host1_5v: vcc_otg_5v: vcc-host1-5v-regulator {
58		compatible = "regulator-fixed";
59		enable-active-high;
60		gpio = <&gpio1 RK_PD2 GPIO_ACTIVE_HIGH>;
61		pinctrl-names = "default";
62		pinctrl-0 = <&usb20_host_drv>;
63		regulator-name = "vcc_host1_5v";
64		regulator-always-on;
65		vin-supply = <&vcc_sys>;
66	};
67
68	vcc_sys: vcc-sys {
69		compatible = "regulator-fixed";
70		regulator-name = "vcc_sys";
71		regulator-always-on;
72		regulator-boot-on;
73		regulator-min-microvolt = <5000000>;
74		regulator-max-microvolt = <5000000>;
75		vin-supply = <&dc_12v>;
76	};
77
78	vcc_phy: vcc-phy-regulator {
79		compatible = "regulator-fixed";
80		regulator-name = "vcc_phy";
81		regulator-always-on;
82		regulator-boot-on;
83	};
84};
85
86&cpu0 {
87	cpu-supply = <&vdd_arm>;
88};
89
90&emmc {
91	bus-width = <8>;
92	cap-mmc-highspeed;
93	non-removable;
94	pinctrl-names = "default";
95	pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
96	status = "okay";
97};
98
99&gmac2io {
100	assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
101	assigned-clock-parents = <&gmac_clkin>, <&gmac_clkin>;
102	clock_in_out = "input";
103	phy-supply = <&vcc_phy>;
104	phy-mode = "rgmii";
105	pinctrl-names = "default";
106	pinctrl-0 = <&rgmiim1_pins>;
107	snps,force_thresh_dma_mode;
108	snps,reset-gpio = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>;
109	snps,reset-active-low;
110	snps,reset-delays-us = <0 10000 50000>;
111	tx_delay = <0x25>;
112	rx_delay = <0x11>;
113	status = "okay";
114};
115
116&i2c1 {
117	status = "okay";
118
119	rk805: pmic@18 {
120		compatible = "rockchip,rk805";
121		reg = <0x18>;
122		interrupt-parent = <&gpio1>;
123		interrupts = <24 IRQ_TYPE_LEVEL_LOW>;
124		#clock-cells = <1>;
125		clock-output-names = "xin32k", "rk805-clkout2";
126		gpio-controller;
127		#gpio-cells = <2>;
128		pinctrl-names = "default";
129		pinctrl-0 = <&pmic_int_l>;
130		rockchip,system-power-controller;
131		wakeup-source;
132
133		vcc1-supply = <&vcc_sys>;
134		vcc2-supply = <&vcc_sys>;
135		vcc3-supply = <&vcc_sys>;
136		vcc4-supply = <&vcc_sys>;
137		vcc5-supply = <&vcc_io>;
138		vcc6-supply = <&vcc_io>;
139
140		regulators {
141			vdd_logic: DCDC_REG1 {
142				regulator-name = "vdd_logic";
143				regulator-min-microvolt = <712500>;
144				regulator-max-microvolt = <1450000>;
145				regulator-always-on;
146				regulator-boot-on;
147				regulator-state-mem {
148					regulator-on-in-suspend;
149					regulator-suspend-microvolt = <1000000>;
150				};
151			};
152
153			vdd_arm: DCDC_REG2 {
154				regulator-name = "vdd_arm";
155				regulator-min-microvolt = <712500>;
156				regulator-max-microvolt = <1450000>;
157				regulator-always-on;
158				regulator-boot-on;
159				regulator-state-mem {
160					regulator-on-in-suspend;
161					regulator-suspend-microvolt = <950000>;
162				};
163			};
164
165			vcc_ddr: DCDC_REG3 {
166				regulator-name = "vcc_ddr";
167				regulator-always-on;
168				regulator-boot-on;
169				regulator-state-mem {
170					regulator-on-in-suspend;
171				};
172			};
173
174			vcc_io: DCDC_REG4 {
175				regulator-name = "vcc_io";
176				regulator-min-microvolt = <3300000>;
177				regulator-max-microvolt = <3300000>;
178				regulator-always-on;
179				regulator-boot-on;
180				regulator-state-mem {
181					regulator-on-in-suspend;
182					regulator-suspend-microvolt = <3300000>;
183				};
184			};
185
186			vcc_18: LDO_REG1 {
187				regulator-name = "vcc_18";
188				regulator-min-microvolt = <1800000>;
189				regulator-max-microvolt = <1800000>;
190				regulator-always-on;
191				regulator-boot-on;
192				regulator-state-mem {
193					regulator-on-in-suspend;
194					regulator-suspend-microvolt = <1800000>;
195				};
196			};
197
198			vcc18_emmc: LDO_REG2 {
199				regulator-name = "vcc18_emmc";
200				regulator-min-microvolt = <1800000>;
201				regulator-max-microvolt = <1800000>;
202				regulator-always-on;
203				regulator-boot-on;
204				regulator-state-mem {
205					regulator-on-in-suspend;
206					regulator-suspend-microvolt = <1800000>;
207				};
208			};
209
210			vdd_10: LDO_REG3 {
211				regulator-name = "vdd_10";
212				regulator-min-microvolt = <1000000>;
213				regulator-max-microvolt = <1000000>;
214				regulator-always-on;
215				regulator-boot-on;
216				regulator-state-mem {
217					regulator-on-in-suspend;
218					regulator-suspend-microvolt = <1000000>;
219				};
220			};
221		};
222	};
223};
224
225&io_domains {
226	status = "okay";
227
228	vccio1-supply = <&vcc_io>;
229	vccio2-supply = <&vcc18_emmc>;
230	vccio3-supply = <&vcc_sdio>;
231	vccio4-supply = <&vcc_18>;
232	vccio5-supply = <&vcc_io>;
233	vccio6-supply = <&vcc_io>;
234	pmuio-supply = <&vcc_io>;
235};
236
237&pinctrl {
238	pmic {
239		pmic_int_l: pmic-int-l {
240			rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_up>;
241		};
242	};
243
244	usb2 {
245		usb20_host_drv: usb20-host-drv {
246			rockchip,pins = <1 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
247		};
248	};
249};
250
251&sdmmc {
252	bus-width = <4>;
253	cap-mmc-highspeed;
254	cap-sd-highspeed;
255	disable-wp;
256	max-frequency = <150000000>;
257	pinctrl-names = "default";
258	pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_dectn &sdmmc0_bus4>;
259	sd-uhs-sdr12;
260	sd-uhs-sdr25;
261	sd-uhs-sdr50;
262	sd-uhs-sdr104;
263	vmmc-supply = <&vcc_sd>;
264	vqmmc-supply = <&vcc_sdio>;
265	status = "okay";
266};
267
268&tsadc {
269	status = "okay";
270};
271
272&u2phy {
273	status = "okay";
274};
275
276&u2phy_host {
277	status = "okay";
278};
279
280&u2phy_otg {
281	status = "okay";
282};
283
284&uart2 {
285	status = "okay";
286};
287
288&usb20_otg {
289	status = "okay";
290};
291
292&usb_host0_ehci {
293	status = "okay";
294};
295
296&usb_host0_ohci {
297	status = "okay";
298};
299