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
31		power_led: led-0 {
32			label = "firefly:red:power";
33			linux,default-trigger = "ir-power-click";
34			default-state = "on";
35			gpios = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>;
36		};
37
38		user_led: led-1 {
39			label = "firefly:blue:user";
40			linux,default-trigger = "ir-user-click";
41			default-state = "off";
42			gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_HIGH>;
43		};
44	};
45
46	typec_vcc5v: typec-vcc5v {
47		compatible = "regulator-fixed";
48		regulator-name = "typec_vcc5v";
49		regulator-min-microvolt = <5000000>;
50		regulator-max-microvolt = <5000000>;
51		regulator-always-on;
52		regulator-boot-on;
53	};
54
55	vcc5v0_sys: vcc5v0-sys {
56		compatible = "regulator-fixed";
57		regulator-name = "vcc5v0_sys";
58		regulator-min-microvolt = <5000000>;
59		regulator-max-microvolt = <5000000>;
60		regulator-always-on;
61		regulator-boot-on;
62		vin-supply = <&typec_vcc5v>;
63	};
64
65	vcc_io: vcc-io {
66		compatible = "regulator-fixed";
67		regulator-name = "vcc_io";
68		regulator-min-microvolt = <3300000>;
69		regulator-max-microvolt = <3300000>;
70		regulator-always-on;
71		regulator-boot-on;
72		vin-supply = <&vcc5v0_sys>;
73	};
74
75	vcc_sdmmc: vcc-sdmmc {
76		compatible = "regulator-gpio";
77		regulator-name = "vcc_sdmmc";
78		regulator-min-microvolt = <1800000>;
79		regulator-max-microvolt = <3300000>;
80		gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_HIGH>;
81		states = <1800000 0x0
82			  3300000 0x1>;
83		vin-supply = <&vcc5v0_sys>;
84	};
85
86	vcc_sd: vcc-sd {
87		compatible = "regulator-fixed";
88		gpio = <&gpio4 RK_PD6 GPIO_ACTIVE_LOW>;
89		regulator-name = "vcc_sd";
90		regulator-min-microvolt = <3300000>;
91		regulator-max-microvolt = <3300000>;
92		regulator-always-on;
93		regulator-boot-on;
94		vim-supply = <&vcc_io>;
95	};
96
97	vdd_core: vdd-core {
98		compatible = "pwm-regulator";
99		pwms = <&pwm0 0 5000 1>;
100		regulator-name = "vdd_core";
101		regulator-min-microvolt = <827000>;
102		regulator-max-microvolt = <1340000>;
103		regulator-init-microvolt = <1015000>;
104		regulator-settling-time-up-us = <250>;
105		regulator-always-on;
106		regulator-boot-on;
107		pwm-supply = <&vcc5v0_sys>;
108	};
109
110	vdd_log: vdd-log {
111		compatible = "regulator-fixed";
112		regulator-name = "vdd_log";
113		regulator-min-microvolt = <1050000>;
114		regulator-max-microvolt = <1050000>;
115		regulator-always-on;
116		regulator-boot-on;
117		vin-supply = <&vcc5v0_sys>;
118	};
119};
120
121&cpu0 {
122	cpu-supply = <&vdd_core>;
123};
124
125&emmc {
126	cap-mmc-highspeed;
127	mmc-hs200-1_8v;
128	non-removable;
129	status = "okay";
130};
131
132&i2c1 {
133	clock-frequency = <400000>;
134	status = "okay";
135
136	rtc: rtc@51 {
137		compatible = "nxp,pcf8563";
138		reg = <0x51>;
139		#clock-cells = <0>;
140	};
141};
142
143&pwm5 {
144	status = "okay";
145	pinctrl-names = "active";
146	pinctrl-0 = <&pwm5_pin_pull_down>;
147};
148
149&pinctrl {
150	pinctrl-names = "default";
151	pinctrl-0 = <&rtc_32k>;
152
153	ir-receiver {
154		ir_recv_pin: ir-recv-pin  {
155			rockchip,pins = <0 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>;
156		};
157	};
158
159	buttons {
160		pwr_key: pwr-key {
161			rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>;
162		};
163	};
164};
165
166&pwm0 {
167	status = "okay";
168	pinctrl-0 = <&pwm0_pin_pull_down>;
169};
170
171&sdmmc {
172	cap-mmc-highspeed;
173	cap-sd-highspeed;
174	card-detect-delay = <300>;
175	sd-uhs-sdr25;
176	sd-uhs-sdr50;
177	sd-uhs-sdr104;
178	vmmc-supply = <&vcc_sd>;
179	vqmmc-supply = <&vcc_sdmmc>;
180	status = "okay";
181};
182
183&uart2 {
184	status = "okay";
185};
186