xref: /rk3399_rockchip-uboot/arch/arm/dts/rk3308-evb.dts (revision 87e4c6020eff05133e40ab8b7b0e37e6a2be37e4)
1/*
2 * (C) Copyright 2018 Rockchip Electronics Co., Ltd
3 *
4 * SPDX-License-Identifier:     GPL-2.0+
5 */
6
7/dts-v1/;
8#include "rk3308.dtsi"
9#include "rk3308-u-boot.dtsi"
10#include <dt-bindings/input/input.h>
11#include <linux/media-bus-format.h>
12
13/ {
14	model = "Rockchip RK3308 EVB";
15	compatible = "rockchip,rk3308-evb", "rockchip,rk3308";
16
17	adc-keys0 {
18		u-boot,dm-pre-reloc;
19		compatible = "adc-keys";
20		io-channels = <&saradc 0>;
21		io-channel-names = "buttons";
22		poll-interval = <100>;
23		keyup-threshold-microvolt = <1800000>;
24
25		vol-up-key {
26			u-boot,dm-pre-reloc;
27			linux,code = <KEY_VOLUMEUP>;
28			label = "volume up";
29			press-threshold-microvolt = <18000>;
30		};
31	};
32
33	adc-keys1 {
34		u-boot,dm-pre-reloc;
35		compatible = "adc-keys";
36		io-channels = <&saradc 1>;
37		io-channel-names = "buttons";
38		poll-interval = <100>;
39		keyup-threshold-microvolt = <1800000>;
40
41		esc-key {
42			linux,code = <KEY_MUTE>;
43			label = "mute";
44			press-threshold-microvolt = <1130000>;
45		};
46
47		home-key {
48			linux,code = <KEY_MODE>;
49			label = "mode";
50			press-threshold-microvolt = <901000>;
51		};
52
53		menu-key {
54			linux,code = <KEY_PLAY>;
55			label = "play";
56			press-threshold-microvolt = <624000>;
57		};
58
59		vol-down-key {
60			linux,code = <KEY_VOLUMEDOWN>;
61			label = "volume down";
62			press-threshold-microvolt = <300000>;
63		};
64
65		vol-up-key {
66			u-boot,dm-pre-reloc;
67			linux,code = <KEY_VOLUMEUP>;
68			label = "volume up";
69			press-threshold-microvolt = <18000>;
70		};
71	};
72
73	backlight: backlight {
74		status = "disabled";
75		compatible = "pwm-backlight";
76		pwms = <&pwm1 0 25000 0>;
77		brightness-levels = <
78			  0   1   2   3   4   5   6   7
79			  8   9  10  11  12  13  14  15
80			 16  17  18  19  20  21  22  23
81			 24  25  26  27  28  29  30  31
82			 32  33  34  35  36  37  38  39
83			 40  41  42  43  44  45  46  47
84			 48  49  50  51  52  53  54  55
85			 56  57  58  59  60  61  62  63
86			 64  65  66  67  68  69  70  71
87			 72  73  74  75  76  77  78  79
88			 80  81  82  83  84  85  86  87
89			 88  89  90  91  92  93  94  95
90			 96  97  98  99 100 101 102 103
91			104 105 106 107 108 109 110 111
92			112 113 114 115 116 117 118 119
93			120 121 122 123 124 125 126 127
94			128 129 130 131 132 133 134 135
95			136 137 138 139 140 141 142 143
96			144 145 146 147 148 149 150 151
97			152 153 154 155 156 157 158 159
98			160 161 162 163 164 165 166 167
99			168 169 170 171 172 173 174 175
100			176 177 178 179 180 181 182 183
101			184 185 186 187 188 189 190 191
102			192 193 194 195 196 197 198 199
103			200 201 202 203 204 205 206 207
104			208 209 210 211 212 213 214 215
105			216 217 218 219 220 221 222 223
106			224 225 226 227 228 229 230 231
107			232 233 234 235 236 237 238 239
108			240 241 242 243 244 245 246 247
109			248 249 250 251 252 253 254 255>;
110		default-brightness-level = <200>;
111	};
112
113	panel: panel {
114		compatible = "simple-panel";
115		bus-format = <MEDIA_BUS_FMT_RGB666_1X18>;
116		backlight = <&backlight>;
117		/* enable-gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_LOW>; */
118		enable-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
119		enable-delay-ms = <20>;
120		reset-gpios = <&gpio0 RK_PC4 GPIO_ACTIVE_LOW>;
121		reset-value = <0>;
122		reset-delay-ms = <10>;
123		prepare-delay-ms = <20>;
124		unprepare-delay-ms = <20>;
125		disable-delay-ms = <20>;
126		/* spi-sdo-gpios = <&gpio3 RK_PD2 GPIO_ACTIVE_HIGH>; */
127		spi-sdi-gpios = <&gpio1 RK_PC7 GPIO_ACTIVE_HIGH>;
128		spi-scl-gpios = <&gpio1 RK_PD0 GPIO_ACTIVE_HIGH>;
129		spi-cs-gpios = <&gpio1 RK_PD1 GPIO_ACTIVE_HIGH>;
130		width-mm = <217>;
131		height-mm = <136>;
132		rockchip,data-mapping = "vesa";
133		rockchip,data-width = <18>;
134		rockchip,output = "rgb";
135		rgb-mode = "p666";
136		status = "disabled";
137		pinctrl-names = "default";
138		pinctrl-0 = <&spi_init_cmd>;
139		rockchip,cmd-type = "spi";
140
141		/* type:0 is cmd, 1 is data */
142		panel-init-sequence = [
143			/* type delay num val1 val2 val3 */
144			  00   00  01  e0
145			  01   00  01  00
146			  01   00  01  07
147			  01   00  01  0f
148			  01   00  01  0d
149			  01   00  01  1b
150			  01   00  01  0a
151			  01   00  01  3c
152			  01   00  01  78
153			  01   00  01  4a
154			  01   00  01  07
155			  01   00  01  0e
156			  01   00  01  09
157			  01   00  01  1b
158			  01   00  01  1e
159			  01   00  01  0f
160			  00   00  01  e1
161			  01   00  01  00
162			  01   00  01  22
163			  01   00  01  24
164			  01   00  01  06
165			  01   00  01  12
166			  01   00  01  07
167			  01   00  01  36
168			  01   00  01  47
169			  01   00  01  47
170			  01   00  01  06
171			  01   00  01  0a
172			  01   00  01  07
173			  01   00  01  30
174			  01   00  01  37
175			  01   00  01  0f
176
177			  00   00  01  c0
178			  01   00  01  10
179			  01   00  01  10
180
181			  00   00  01  c1
182			  01   00  01  41
183
184			  00   00  01  c5
185			  01   00  01  00
186			  01   00  01  22
187			  01   00  01  80
188
189			  00   00  01  36
190			  01   00  01  48
191
192			  00   00  01  3a  /* interface mode control */
193			  01   00  01  66
194
195			  00   00  01  b0  /* interface mode control */
196			  01   00  01  00
197
198			  00   00  01  b1  /* frame rate 70hz */
199			  01   00  01  b0
200			  01   00  01  11
201			  00   00  01  b4
202			  01   00  01  02
203			  00   00  01  B6  /* RGB/MCU Interface Control */
204			  01   00  01  32  /* 02 mcu, 32 rgb */
205			  01   00  01  02
206
207			  00   00  01  b7
208			  01   00  01  c6
209
210			  00   00  01  be
211			  01   00  01  00
212			  01   00  01  04
213
214			  00   00  01  e9
215			  01   00  01  00
216
217			  00   00  01  f7
218			  01   00  01  a9
219			  01   00  01  51
220			  01   00  01  2c
221			  01   00  01  82
222
223			  00   78  01  11
224			  00   00  01  29
225		];
226
227		panel-exit-sequence = [
228			/* type delay num val1 val2 val3 */
229			00   0a  01  28
230			00   78  01  10
231		];
232
233		display-timings {
234			native-mode = <&kd050fwfba002_timing>;
235
236			kd050fwfba002_timing: timing0 {
237				clock-frequency = <11000000>;
238				hactive = <320>;
239				vactive = <480>;
240				hback-porch = <10>;
241				hfront-porch = <4>;
242				vback-porch = <10>;
243				vfront-porch = <4>;
244				hsync-len = <20>;
245				vsync-len = <20>;
246				hsync-active = <0>;
247				vsync-active = <0>;
248				de-active = <0>;
249				pixelclk-active = <0>;
250			};
251		};
252
253		port {
254			panel_in_rgb: endpoint {
255				remote-endpoint = <&rgb_out_panel>;
256			};
257		};
258	};
259
260	vdd_log: vdd_core: vdd-core {
261		compatible = "pwm-regulator";
262		pwms = <&pwm0 0 5000 1>;
263		regulator-name = "vdd_core";
264		regulator-min-microvolt = <847000>;
265		regulator-max-microvolt = <1366000>;
266		regulator-init-microvolt  = <1044000>;
267		regulator-always-on;
268		regulator-boot-on;
269		status = "okay";
270	};
271
272	vcc_phy: vcc-phy-regulator {
273		compatible = "regulator-fixed";
274		regulator-name = "vcc_phy";
275		regulator-always-on;
276		regulator-boot-on;
277	};
278};
279
280&display_subsystem {
281	status = "disabled";
282};
283
284&emmc {
285	cap-mmc-highspeed;
286	supports-emmc;
287	non-removable;
288	num-slots = <1>;
289	status = "okay";
290};
291
292&mac {
293	phy-supply = <&vcc_phy>;
294	assigned-clocks = <&cru SCLK_MAC>;
295	assigned-clock-parents = <&mac_clkin>;
296	clock_in_out = "input";
297	pinctrl-names = "default";
298	pinctrl-0 = <&rmii_pins &mac_refclk>;
299	snps,reset-gpio = <&gpio4 RK_PC0 GPIO_ACTIVE_LOW>;
300	snps,reset-active-low;
301	snps,reset-delays-us = <0 50000 50000>;
302	status = "disabled";
303};
304
305&pwm0 {
306	status = "okay";
307};
308
309&pwm1 {
310	status = "disabled";
311};
312
313&u2phy {
314	status = "okay";
315};
316
317&u2phy_otg {
318	status = "okay";
319};
320
321&u2phy_host {
322	status = "okay";
323};
324
325&usb_host0_ehci {
326	status = "okay";
327};
328
329&usb_host0_ohci {
330	status = "okay";
331};
332
333&usb20_otg {
334	status = "okay";
335};
336
337&route_rgb {
338	status = "disabled";
339};
340
341&vop {
342	status = "disabled";
343};
344
345&rgb {
346	status = "disabled";
347
348	ports {
349		rgb_out: port@1 {
350			reg = <1>;
351			#address-cells = <1>;
352			#size-cells = <0>;
353
354			rgb_out_panel: endpoint@0 {
355				reg = <0>;
356				remote-endpoint = <&panel_in_rgb>;
357			};
358		};
359	};
360};
361
362&pinctrl {
363	spi_panel {
364		spi_init_cmd: spi-init-cmd {
365			rockchip,pins =
366				/* spi sdi */
367				<1 RK_PC7 RK_FUNC_GPIO &pcfg_pull_none>,
368				/* spi scl */
369				<1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>,
370				/* spi cs */
371				<1 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
372		};
373	};
374};
375