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_pin>;
38		regulator-boot-on;
39		regulator-name = "vcc_sd";
40		regulator-min-microvolt = <3300000>;
41		regulator-max-microvolt = <3300000>;
42		vin-supply = <&vcc_io>;
43	};
44
45	vcc_sdio: sdmmcio-regulator {
46		compatible = "regulator-gpio";
47		gpios = <&grf_gpio 0 GPIO_ACTIVE_HIGH>;
48		states = <1800000 0x1
49			  3300000 0x0>;
50		regulator-name = "vcc_sdio";
51		regulator-type = "voltage";
52		regulator-min-microvolt = <1800000>;
53		regulator-max-microvolt = <3300000>;
54		regulator-always-on;
55		vin-supply = <&vcc_sys>;
56	};
57
58	vcc_host1_5v: vcc_otg_5v: vcc-host1-5v-regulator {
59		compatible = "regulator-fixed";
60		enable-active-high;
61		gpio = <&gpio1 RK_PD2 GPIO_ACTIVE_HIGH>;
62		pinctrl-names = "default";
63		pinctrl-0 = <&usb20_host_drv>;
64		regulator-name = "vcc_host1_5v";
65		regulator-always-on;
66		vin-supply = <&vcc_sys>;
67	};
68
69	vcc_sys: vcc-sys {
70		compatible = "regulator-fixed";
71		regulator-name = "vcc_sys";
72		regulator-always-on;
73		regulator-boot-on;
74		regulator-min-microvolt = <5000000>;
75		regulator-max-microvolt = <5000000>;
76		vin-supply = <&dc_12v>;
77	};
78
79	vcc_phy: vcc-phy-regulator {
80		compatible = "regulator-fixed";
81		regulator-name = "vcc_phy";
82		regulator-always-on;
83		regulator-boot-on;
84	};
85
86	leds {
87		compatible = "gpio-leds";
88
89		power_led: led-0 {
90			label = "firefly:blue:power";
91			linux,default-trigger = "heartbeat";
92			gpios = <&rk805 1 GPIO_ACTIVE_LOW>;
93			default-state = "on";
94			mode = <0x23>;
95		};
96
97		user_led: led-1 {
98			label = "firefly:yellow:user";
99			linux,default-trigger = "mmc1";
100			gpios = <&rk805 0 GPIO_ACTIVE_LOW>;
101			default-state = "off";
102			mode = <0x05>;
103		};
104	};
105};
106
107&analog_sound {
108	status = "okay";
109};
110
111&codec {
112	status = "okay";
113};
114
115&cpu0 {
116	cpu-supply = <&vdd_arm>;
117};
118
119&cpu1 {
120	cpu-supply = <&vdd_arm>;
121};
122
123&cpu2 {
124	cpu-supply = <&vdd_arm>;
125};
126
127&cpu3 {
128	cpu-supply = <&vdd_arm>;
129};
130
131&emmc {
132	bus-width = <8>;
133	cap-mmc-highspeed;
134	max-frequency = <150000000>;
135	mmc-ddr-1_8v;
136	mmc-hs200-1_8v;
137	non-removable;
138	pinctrl-names = "default";
139	pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
140	vmmc-supply = <&vcc_io>;
141	vqmmc-supply = <&vcc18_emmc>;
142	status = "okay";
143};
144
145&gmac2io {
146	assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
147	assigned-clock-parents = <&gmac_clkin>, <&gmac_clkin>;
148	clock_in_out = "input";
149	phy-supply = <&vcc_phy>;
150	phy-mode = "rgmii";
151	pinctrl-names = "default";
152	pinctrl-0 = <&rgmiim1_pins>;
153	snps,aal;
154	snps,reset-gpio = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>;
155	snps,reset-active-low;
156	snps,reset-delays-us = <0 10000 50000>;
157	snps,rxpbl = <0x4>;
158	snps,txpbl = <0x4>;
159	tx_delay = <0x24>;
160	rx_delay = <0x18>;
161	status = "okay";
162};
163
164&hdmi {
165	status = "okay";
166};
167
168&hdmiphy {
169	status = "okay";
170};
171
172&hdmi_sound {
173	status = "okay";
174};
175
176&i2c1 {
177	status = "okay";
178
179	rk805: pmic@18 {
180		compatible = "rockchip,rk805";
181		reg = <0x18>;
182		interrupt-parent = <&gpio1>;
183		interrupts = <24 IRQ_TYPE_LEVEL_LOW>;
184		#clock-cells = <1>;
185		clock-output-names = "xin32k", "rk805-clkout2";
186		gpio-controller;
187		#gpio-cells = <2>;
188		pinctrl-names = "default";
189		pinctrl-0 = <&pmic_int_l>;
190		rockchip,system-power-controller;
191		wakeup-source;
192
193		vcc1-supply = <&vcc_sys>;
194		vcc2-supply = <&vcc_sys>;
195		vcc3-supply = <&vcc_sys>;
196		vcc4-supply = <&vcc_sys>;
197		vcc5-supply = <&vcc_io>;
198		vcc6-supply = <&vcc_io>;
199
200		regulators {
201			vdd_logic: DCDC_REG1 {
202				regulator-name = "vdd_logic";
203				regulator-min-microvolt = <712500>;
204				regulator-max-microvolt = <1450000>;
205				regulator-always-on;
206				regulator-boot-on;
207				regulator-state-mem {
208					regulator-on-in-suspend;
209					regulator-suspend-microvolt = <1000000>;
210				};
211			};
212
213			vdd_arm: DCDC_REG2 {
214				regulator-name = "vdd_arm";
215				regulator-min-microvolt = <712500>;
216				regulator-max-microvolt = <1450000>;
217				regulator-always-on;
218				regulator-boot-on;
219				regulator-state-mem {
220					regulator-on-in-suspend;
221					regulator-suspend-microvolt = <950000>;
222				};
223			};
224
225			vcc_ddr: DCDC_REG3 {
226				regulator-name = "vcc_ddr";
227				regulator-always-on;
228				regulator-boot-on;
229				regulator-state-mem {
230					regulator-on-in-suspend;
231				};
232			};
233
234			vcc_io: DCDC_REG4 {
235				regulator-name = "vcc_io";
236				regulator-min-microvolt = <3300000>;
237				regulator-max-microvolt = <3300000>;
238				regulator-always-on;
239				regulator-boot-on;
240				regulator-state-mem {
241					regulator-on-in-suspend;
242					regulator-suspend-microvolt = <3300000>;
243				};
244			};
245
246			vcc_18: LDO_REG1 {
247				regulator-name = "vcc_18";
248				regulator-min-microvolt = <1800000>;
249				regulator-max-microvolt = <1800000>;
250				regulator-always-on;
251				regulator-boot-on;
252				regulator-state-mem {
253					regulator-on-in-suspend;
254					regulator-suspend-microvolt = <1800000>;
255				};
256			};
257
258			vcc18_emmc: LDO_REG2 {
259				regulator-name = "vcc18_emmc";
260				regulator-min-microvolt = <1800000>;
261				regulator-max-microvolt = <1800000>;
262				regulator-always-on;
263				regulator-boot-on;
264				regulator-state-mem {
265					regulator-on-in-suspend;
266					regulator-suspend-microvolt = <1800000>;
267				};
268			};
269
270			vdd_10: LDO_REG3 {
271				regulator-name = "vdd_10";
272				regulator-min-microvolt = <1000000>;
273				regulator-max-microvolt = <1000000>;
274				regulator-always-on;
275				regulator-boot-on;
276				regulator-state-mem {
277					regulator-on-in-suspend;
278					regulator-suspend-microvolt = <1000000>;
279				};
280			};
281		};
282	};
283};
284
285&i2s0 {
286	status = "okay";
287};
288
289&i2s1 {
290	status = "okay";
291};
292
293&io_domains {
294	status = "okay";
295
296	vccio1-supply = <&vcc_io>;
297	vccio2-supply = <&vcc18_emmc>;
298	vccio3-supply = <&vcc_sdio>;
299	vccio4-supply = <&vcc_18>;
300	vccio5-supply = <&vcc_io>;
301	vccio6-supply = <&vcc_io>;
302	pmuio-supply = <&vcc_io>;
303};
304
305&pinctrl {
306	pmic {
307		pmic_int_l: pmic-int-l {
308			rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_up>;
309		};
310	};
311
312	usb2 {
313		usb20_host_drv: usb20-host-drv {
314			rockchip,pins = <1 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
315		};
316	};
317};
318
319&sdmmc {
320	bus-width = <4>;
321	cap-mmc-highspeed;
322	cap-sd-highspeed;
323	disable-wp;
324	max-frequency = <150000000>;
325	pinctrl-names = "default";
326	pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_dectn &sdmmc0_bus4>;
327	sd-uhs-sdr12;
328	sd-uhs-sdr25;
329	sd-uhs-sdr50;
330	sd-uhs-sdr104;
331	vmmc-supply = <&vcc_sd>;
332	vqmmc-supply = <&vcc_sdio>;
333	status = "okay";
334};
335
336&tsadc {
337	status = "okay";
338};
339
340&u2phy {
341	status = "okay";
342};
343
344&u2phy_host {
345	status = "okay";
346};
347
348&u2phy_otg {
349	status = "okay";
350};
351
352&uart2 {
353	status = "okay";
354};
355
356&usb20_otg {
357	dr_mode = "host";
358	status = "okay";
359};
360
361&usb_host0_ehci {
362	status = "okay";
363};
364
365&usb_host0_ohci {
366	status = "okay";
367};
368
369&vop {
370	status = "okay";
371};
372
373&vop_mmu {
374	status = "okay";
375};
376