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