1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2019 Fuzhou Rockchip Electronics Co., Ltd
4 */
5
6/dts-v1/;
7#include "rk3308.dtsi"
8
9/ {
10	model = "Firefly ROC-RK3308-CC board";
11	compatible = "firefly,roc-rk3308-cc", "rockchip,rk3308";
12	chosen {
13		stdout-path = "serial2:1500000n8";
14	};
15
16	ir_rx {
17		compatible = "gpio-ir-receiver";
18		gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_HIGH>;
19		pinctrl-names = "default";
20		pinctrl-0 = <&ir_recv_pin>;
21	};
22
23	ir_tx {
24		compatible = "pwm-ir-tx";
25		pwms = <&pwm5 0 25000 0>;
26	};
27
28	leds {
29		compatible = "gpio-leds";
30		power {
31			label = "firefly:red:power";
32			linux,default-trigger = "ir-power-click";
33			default-state = "on";
34			gpios = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>;
35		};
36
37		user {
38			label = "firefly:blue:user";
39			linux,default-trigger = "ir-user-click";
40			default-state = "off";
41			gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_HIGH>;
42		};
43	};
44
45	typec_vcc5v: typec-vcc5v {
46		compatible = "regulator-fixed";
47		regulator-name = "typec_vcc5v";
48		regulator-always-on;
49		regulator-boot-on;
50		regulator-min-microvolt = <5000000>;
51		regulator-max-microvolt = <5000000>;
52	};
53
54	vcc5v0_sys: vcc5v0-sys {
55		compatible = "regulator-fixed";
56		regulator-name = "vcc5v0_sys";
57		regulator-min-microvolt = <5000000>;
58		regulator-max-microvolt = <5000000>;
59		regulator-always-on;
60		regulator-boot-on;
61		vin-supply = <&typec_vcc5v>;
62	};
63
64	vdd_core: vdd-core {
65		compatible = "pwm-regulator";
66		pwms = <&pwm0 0 5000 1>;
67		regulator-name = "vdd_core";
68		regulator-min-microvolt = <827000>;
69		regulator-max-microvolt = <1340000>;
70		regulator-init-microvolt = <1015000>;
71		regulator-always-on;
72		regulator-boot-on;
73		regulator-settling-time-up-us = <250>;
74		pwm-supply = <&vcc5v0_sys>;
75	};
76
77	vdd_log: vdd-log {
78		compatible = "regulator-fixed";
79		regulator-name = "vdd_log";
80		regulator-always-on;
81		regulator-boot-on;
82		regulator-min-microvolt = <1050000>;
83		regulator-max-microvolt = <1050000>;
84		vin-supply = <&vcc5v0_sys>;
85	};
86
87	vcc_io: vcc-io {
88		compatible = "regulator-fixed";
89		regulator-name = "vcc_io";
90		regulator-min-microvolt = <3300000>;
91		regulator-max-microvolt = <3300000>;
92		regulator-always-on;
93		regulator-boot-on;
94		vin-supply = <&vcc5v0_sys>;
95	};
96
97	vcc_sdmmc: vcc-sdmmc {
98		compatible = "regulator-gpio";
99		regulator-name = "vcc_sdmmc";
100		regulator-min-microvolt = <1800000>;
101		regulator-max-microvolt = <3300000>;
102		gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_HIGH>;
103		states = <1800000 0x0
104			  3300000 0x1>;
105		vin-supply = <&vcc5v0_sys>;
106	};
107
108	vcc_sd: vcc-sd {
109		compatible = "regulator-fixed";
110		gpio = <&gpio4 RK_PD6 GPIO_ACTIVE_LOW>;
111		regulator-name = "vcc_sd";
112		regulator-min-microvolt = <3300000>;
113		regulator-max-microvolt = <3300000>;
114		regulator-always-on;
115		regulator-boot-on;
116		vim-supply = <&vcc_io>;
117	};
118
119};
120
121&cpu0 {
122	cpu-supply = <&vdd_core>;
123};
124
125&emmc {
126	bus-width = <8>;
127	cap-mmc-highspeed;
128	supports-emmc;
129	disable-wp;
130	non-removable;
131	num-slots = <1>;
132	status = "okay";
133};
134
135&i2c1 {
136	clock-frequency = <400000>;
137	status = "okay";
138
139	rtc: rtc@51 {
140		compatible = "nxp,pcf8563";
141		reg = <0x51>;
142		#clock-cells = <0>;
143	};
144};
145
146&mac {
147	assigned-clocks = <&cru SCLK_MAC>;
148	assigned-clock-parents = <&mac_clkin>;
149	clock_in_out = "input";
150	pinctrl-names = "default";
151	pinctrl-0 = <&rmiim1_pins &macm1_refclk>;
152	status = "okay";
153};
154
155&pwm5 {
156	status = "okay";
157	pinctrl-names = "active";
158	pinctrl-0 = <&pwm5_pin_pull_down>;
159};
160
161&pinctrl {
162	pinctrl-names = "default";
163	pinctrl-0 = <&rtc_32k>;
164
165	ir-receiver {
166		ir_recv_pin: ir-recv-pin  {
167			rockchip,pins = <0 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>;
168		};
169	};
170
171	buttons {
172		pwr_key: pwr-key {
173			rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>;
174		};
175	};
176};
177
178&pwm0 {
179	status = "okay";
180	pinctrl-0 = <&pwm0_pin_pull_down>;
181};
182
183&sdmmc {
184	bus-width = <4>;
185	cap-mmc-highspeed;
186	cap-sd-highspeed;
187	supports-sd;
188	card-detect-delay = <300>;
189	sd-uhs-sdr25;
190	sd-uhs-sdr50;
191	sd-uhs-sdr104;
192	vmmc-supply = <&vcc_sd>;
193	vqmmc-supply = <&vcc_sdmmc>;
194	status = "okay";
195};
196
197&uart2 {
198	status = "okay";
199};
200