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,reset-gpio = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>;
108	snps,reset-active-low;
109	snps,reset-delays-us = <0 10000 50000>;
110	tx_delay = <0x25>;
111	rx_delay = <0x11>;
112	status = "okay";
113};
114
115&i2c1 {
116	status = "okay";
117
118	rk805: pmic@18 {
119		compatible = "rockchip,rk805";
120		reg = <0x18>;
121		interrupt-parent = <&gpio1>;
122		interrupts = <24 IRQ_TYPE_LEVEL_LOW>;
123		#clock-cells = <1>;
124		clock-output-names = "xin32k", "rk805-clkout2";
125		gpio-controller;
126		#gpio-cells = <2>;
127		pinctrl-names = "default";
128		pinctrl-0 = <&pmic_int_l>;
129		rockchip,system-power-controller;
130		wakeup-source;
131
132		vcc1-supply = <&vcc_sys>;
133		vcc2-supply = <&vcc_sys>;
134		vcc3-supply = <&vcc_sys>;
135		vcc4-supply = <&vcc_sys>;
136		vcc5-supply = <&vcc_io>;
137		vcc6-supply = <&vcc_io>;
138
139		regulators {
140			vdd_logic: DCDC_REG1 {
141				regulator-name = "vdd_logic";
142				regulator-min-microvolt = <712500>;
143				regulator-max-microvolt = <1450000>;
144				regulator-always-on;
145				regulator-boot-on;
146				regulator-state-mem {
147					regulator-on-in-suspend;
148					regulator-suspend-microvolt = <1000000>;
149				};
150			};
151
152			vdd_arm: DCDC_REG2 {
153				regulator-name = "vdd_arm";
154				regulator-min-microvolt = <712500>;
155				regulator-max-microvolt = <1450000>;
156				regulator-always-on;
157				regulator-boot-on;
158				regulator-state-mem {
159					regulator-on-in-suspend;
160					regulator-suspend-microvolt = <950000>;
161				};
162			};
163
164			vcc_ddr: DCDC_REG3 {
165				regulator-name = "vcc_ddr";
166				regulator-always-on;
167				regulator-boot-on;
168				regulator-state-mem {
169					regulator-on-in-suspend;
170				};
171			};
172
173			vcc_io: DCDC_REG4 {
174				regulator-name = "vcc_io";
175				regulator-min-microvolt = <3300000>;
176				regulator-max-microvolt = <3300000>;
177				regulator-always-on;
178				regulator-boot-on;
179				regulator-state-mem {
180					regulator-on-in-suspend;
181					regulator-suspend-microvolt = <3300000>;
182				};
183			};
184
185			vcc_18: LDO_REG1 {
186				regulator-name = "vcc_18";
187				regulator-min-microvolt = <1800000>;
188				regulator-max-microvolt = <1800000>;
189				regulator-always-on;
190				regulator-boot-on;
191				regulator-state-mem {
192					regulator-on-in-suspend;
193					regulator-suspend-microvolt = <1800000>;
194				};
195			};
196
197			vcc18_emmc: LDO_REG2 {
198				regulator-name = "vcc18_emmc";
199				regulator-min-microvolt = <1800000>;
200				regulator-max-microvolt = <1800000>;
201				regulator-always-on;
202				regulator-boot-on;
203				regulator-state-mem {
204					regulator-on-in-suspend;
205					regulator-suspend-microvolt = <1800000>;
206				};
207			};
208
209			vdd_10: LDO_REG3 {
210				regulator-name = "vdd_10";
211				regulator-min-microvolt = <1000000>;
212				regulator-max-microvolt = <1000000>;
213				regulator-always-on;
214				regulator-boot-on;
215				regulator-state-mem {
216					regulator-on-in-suspend;
217					regulator-suspend-microvolt = <1000000>;
218				};
219			};
220		};
221	};
222};
223
224&io_domains {
225	status = "okay";
226
227	vccio1-supply = <&vcc_io>;
228	vccio2-supply = <&vcc18_emmc>;
229	vccio3-supply = <&vcc_sdio>;
230	vccio4-supply = <&vcc_18>;
231	vccio5-supply = <&vcc_io>;
232	vccio6-supply = <&vcc_io>;
233	pmuio-supply = <&vcc_io>;
234};
235
236&pinctrl {
237	pmic {
238		pmic_int_l: pmic-int-l {
239			rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_up>;
240		};
241	};
242
243	usb2 {
244		usb20_host_drv: usb20-host-drv {
245			rockchip,pins = <1 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
246		};
247	};
248};
249
250&sdmmc {
251	bus-width = <4>;
252	cap-mmc-highspeed;
253	cap-sd-highspeed;
254	disable-wp;
255	max-frequency = <150000000>;
256	pinctrl-names = "default";
257	pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_dectn &sdmmc0_bus4>;
258	sd-uhs-sdr12;
259	sd-uhs-sdr25;
260	sd-uhs-sdr50;
261	sd-uhs-sdr104;
262	vmmc-supply = <&vcc_sd>;
263	vqmmc-supply = <&vcc_sdio>;
264	status = "okay";
265};
266
267&tsadc {
268	status = "okay";
269};
270
271&u2phy {
272	status = "okay";
273};
274
275&u2phy_host {
276	status = "okay";
277};
278
279&u2phy_otg {
280	status = "okay";
281};
282
283&uart2 {
284	status = "okay";
285};
286
287&usb20_otg {
288	status = "okay";
289};
290
291&usb_host0_ehci {
292	status = "okay";
293};
294
295&usb_host0_ohci {
296	status = "okay";
297};
298