1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Hardkernel Odroid XU3/XU3-Lite/XU4 boards common device tree source
4 *
5 * Copyright (c) 2013 Samsung Electronics Co., Ltd.
6 *		http://www.samsung.com
7 * Copyright (c) 2014 Collabora Ltd.
8 * Copyright (c) 2015 Lukasz Majewski <l.majewski@samsung.com>
9 *                    Anand Moon <linux.amoon@gmail.com>
10 */
11
12#include <dt-bindings/input/input.h>
13#include "exynos5422-odroid-core.dtsi"
14
15/ {
16	aliases {
17		mmc0 = &mmc_0;
18	};
19
20	gpio-keys {
21		compatible = "gpio-keys";
22		pinctrl-names = "default";
23		pinctrl-0 = <&power_key>;
24
25		power-key {
26			/*
27			 * The power button (SW2) is connected to the PWRON
28			 * pin (active high) of the S2MPS11 PMIC, which acts
29			 * as a 16ms debouce filter and signal inverter with
30			 * output on ONOB pin (active low). ONOB PMIC pin is
31			 * then connected to XEINT3 SoC pin.
32			 */
33			gpios = <&gpx0 3 GPIO_ACTIVE_LOW>;
34			linux,code = <KEY_POWER>;
35			label = "power key";
36			debounce-interval = <0>;
37			wakeup-source;
38		};
39	};
40
41	emmc_pwrseq: pwrseq {
42		pinctrl-0 = <&emmc_nrst_pin>;
43		pinctrl-names = "default";
44		compatible = "mmc-pwrseq-emmc";
45		reset-gpios = <&gpd1 0 GPIO_ACTIVE_LOW>;
46	};
47
48	fan0: pwm-fan {
49		compatible = "pwm-fan";
50		pwms = <&pwm 0 20972 0>;
51		#cooling-cells = <2>;
52		cooling-levels = <0 130 170 230>;
53	};
54
55	thermal-zones {
56		cpu0_thermal: cpu0-thermal {
57			thermal-sensors = <&tmu_cpu0>;
58			polling-delay-passive = <0>;
59			polling-delay = <0>;
60			trips {
61				cpu0_alert0: cpu-alert-0 {
62					temperature = <50000>; /* millicelsius */
63					hysteresis = <5000>; /* millicelsius */
64					type = "active";
65				};
66				cpu0_alert1: cpu-alert-1 {
67					temperature = <60000>; /* millicelsius */
68					hysteresis = <5000>; /* millicelsius */
69					type = "active";
70				};
71				cpu0_alert2: cpu-alert-2 {
72					temperature = <70000>; /* millicelsius */
73					hysteresis = <5000>; /* millicelsius */
74					type = "active";
75				};
76				cpu0_crit0: cpu-crit-0 {
77					temperature = <120000>; /* millicelsius */
78					hysteresis = <0>; /* millicelsius */
79					type = "critical";
80				};
81				cpu0_alert3: cpu-alert-3 {
82					temperature = <70000>; /* millicelsius */
83					hysteresis = <10000>; /* millicelsius */
84					type = "passive";
85				};
86				cpu0_alert4: cpu-alert-4 {
87					temperature = <85000>; /* millicelsius */
88					hysteresis = <10000>; /* millicelsius */
89					type = "passive";
90				};
91			};
92			cooling-maps {
93				map0 {
94					trip = <&cpu0_alert0>;
95					cooling-device = <&fan0 0 1>;
96				};
97				map1 {
98					trip = <&cpu0_alert1>;
99					cooling-device = <&fan0 1 2>;
100				};
101				map2 {
102					trip = <&cpu0_alert2>;
103					cooling-device = <&fan0 2 3>;
104				};
105				/*
106				 * When reaching cpu0_alert3, reduce CPU
107				 * by 2 steps. On Exynos5422/5800 that would
108				 * (usually) be: 1800 MHz and 1200 MHz.
109				 */
110				map3 {
111					trip = <&cpu0_alert3>;
112					cooling-device = <&cpu0 0 2>,
113							 <&cpu1 0 2>,
114							 <&cpu2 0 2>,
115							 <&cpu3 0 2>,
116							 <&cpu4 0 2>,
117							 <&cpu5 0 2>,
118							 <&cpu6 0 2>,
119							 <&cpu7 0 2>;
120				};
121				/*
122				 * When reaching cpu0_alert4, reduce CPU
123				 * further, down to 600 MHz (14 steps for big,
124				 * 8 steps for LITTLE).
125				 */
126				cpu0_cooling_map4: map4 {
127					trip = <&cpu0_alert4>;
128					cooling-device = <&cpu0 3 8>,
129							 <&cpu1 3 8>,
130							 <&cpu2 3 8>,
131							 <&cpu3 3 8>,
132							 <&cpu4 3 14>,
133							 <&cpu5 3 14>,
134							 <&cpu6 3 14>,
135							 <&cpu7 3 14>;
136				};
137			};
138		};
139		cpu1_thermal: cpu1-thermal {
140			thermal-sensors = <&tmu_cpu1>;
141			polling-delay-passive = <0>;
142			polling-delay = <0>;
143			trips {
144				cpu1_alert0: cpu-alert-0 {
145					temperature = <50000>;
146					hysteresis = <5000>;
147					type = "active";
148				};
149				cpu1_alert1: cpu-alert-1 {
150					temperature = <60000>;
151					hysteresis = <5000>;
152					type = "active";
153				};
154				cpu1_alert2: cpu-alert-2 {
155					temperature = <70000>;
156					hysteresis = <5000>;
157					type = "active";
158				};
159				cpu1_crit0: cpu-crit-0 {
160					temperature = <120000>;
161					hysteresis = <0>;
162					type = "critical";
163				};
164				cpu1_alert3: cpu-alert-3 {
165					temperature = <70000>;
166					hysteresis = <10000>;
167					type = "passive";
168				};
169				cpu1_alert4: cpu-alert-4 {
170					temperature = <85000>;
171					hysteresis = <10000>;
172					type = "passive";
173				};
174			};
175			cooling-maps {
176				map0 {
177					trip = <&cpu1_alert0>;
178					cooling-device = <&fan0 0 1>;
179				};
180				map1 {
181					trip = <&cpu1_alert1>;
182					cooling-device = <&fan0 1 2>;
183				};
184				map2 {
185					trip = <&cpu1_alert2>;
186					cooling-device = <&fan0 2 3>;
187				};
188				map3 {
189					trip = <&cpu1_alert3>;
190					cooling-device = <&cpu0 0 2>,
191							 <&cpu1 0 2>,
192							 <&cpu2 0 2>,
193							 <&cpu3 0 2>,
194							 <&cpu4 0 2>,
195							 <&cpu5 0 2>,
196							 <&cpu6 0 2>,
197							 <&cpu7 0 2>;
198				};
199				cpu1_cooling_map4: map4 {
200					trip = <&cpu1_alert4>;
201					cooling-device = <&cpu0 3 8>,
202							 <&cpu1 3 8>,
203							 <&cpu2 3 8>,
204							 <&cpu3 3 8>,
205							 <&cpu4 3 14>,
206							 <&cpu5 3 14>,
207							 <&cpu6 3 14>,
208							 <&cpu7 3 14>;
209				};
210			};
211		};
212		cpu2_thermal: cpu2-thermal {
213			thermal-sensors = <&tmu_cpu2>;
214			polling-delay-passive = <0>;
215			polling-delay = <0>;
216			trips {
217				cpu2_alert0: cpu-alert-0 {
218					temperature = <50000>;
219					hysteresis = <5000>;
220					type = "active";
221				};
222				cpu2_alert1: cpu-alert-1 {
223					temperature = <60000>;
224					hysteresis = <5000>;
225					type = "active";
226				};
227				cpu2_alert2: cpu-alert-2 {
228					temperature = <70000>;
229					hysteresis = <5000>;
230					type = "active";
231				};
232				cpu2_crit0: cpu-crit-0 {
233					temperature = <120000>;
234					hysteresis = <0>;
235					type = "critical";
236				};
237				cpu2_alert3: cpu-alert-3 {
238					temperature = <70000>;
239					hysteresis = <10000>;
240					type = "passive";
241				};
242				cpu2_alert4: cpu-alert-4 {
243					temperature = <85000>;
244					hysteresis = <10000>;
245					type = "passive";
246				};
247			};
248			cooling-maps {
249				map0 {
250					trip = <&cpu2_alert0>;
251					cooling-device = <&fan0 0 1>;
252				};
253				map1 {
254					trip = <&cpu2_alert1>;
255					cooling-device = <&fan0 1 2>;
256				};
257				map2 {
258					trip = <&cpu2_alert2>;
259					cooling-device = <&fan0 2 3>;
260				};
261				map3 {
262					trip = <&cpu2_alert3>;
263					cooling-device = <&cpu0 0 2>,
264							 <&cpu1 0 2>,
265							 <&cpu2 0 2>,
266							 <&cpu3 0 2>,
267							 <&cpu4 0 2>,
268							 <&cpu5 0 2>,
269							 <&cpu6 0 2>,
270							 <&cpu7 0 2>;
271				};
272				cpu2_cooling_map4: map4 {
273					trip = <&cpu2_alert4>;
274					cooling-device = <&cpu0 3 8>,
275							 <&cpu1 3 8>,
276							 <&cpu2 3 8>,
277							 <&cpu3 3 8>,
278							 <&cpu4 3 14>,
279							 <&cpu5 3 14>,
280							 <&cpu6 3 14>,
281							 <&cpu7 3 14>;
282				};
283			};
284		};
285		cpu3_thermal: cpu3-thermal {
286			thermal-sensors = <&tmu_cpu3>;
287			polling-delay-passive = <0>;
288			polling-delay = <0>;
289			trips {
290				cpu3_alert0: cpu-alert-0 {
291					temperature = <50000>;
292					hysteresis = <5000>;
293					type = "active";
294				};
295				cpu3_alert1: cpu-alert-1 {
296					temperature = <60000>;
297					hysteresis = <5000>;
298					type = "active";
299				};
300				cpu3_alert2: cpu-alert-2 {
301					temperature = <70000>;
302					hysteresis = <5000>;
303					type = "active";
304				};
305				cpu3_crit0: cpu-crit-0 {
306					temperature = <120000>;
307					hysteresis = <0>;
308					type = "critical";
309				};
310				cpu3_alert3: cpu-alert-3 {
311					temperature = <70000>;
312					hysteresis = <10000>;
313					type = "passive";
314				};
315				cpu3_alert4: cpu-alert-4 {
316					temperature = <85000>;
317					hysteresis = <10000>;
318					type = "passive";
319				};
320			};
321			cooling-maps {
322				map0 {
323					trip = <&cpu3_alert0>;
324					cooling-device = <&fan0 0 1>;
325				};
326				map1 {
327					trip = <&cpu3_alert1>;
328					cooling-device = <&fan0 1 2>;
329				};
330				map2 {
331					trip = <&cpu3_alert2>;
332					cooling-device = <&fan0 2 3>;
333				};
334				map3 {
335					trip = <&cpu3_alert3>;
336					cooling-device = <&cpu0 0 2>,
337							 <&cpu1 0 2>,
338							 <&cpu2 0 2>,
339							 <&cpu3 0 2>,
340							 <&cpu4 0 2>,
341							 <&cpu5 0 2>,
342							 <&cpu6 0 2>,
343							 <&cpu7 0 2>;
344				};
345				cpu3_cooling_map4: map4 {
346					trip = <&cpu3_alert4>;
347					cooling-device = <&cpu0 3 8>,
348							 <&cpu1 3 8>,
349							 <&cpu2 3 8>,
350							 <&cpu3 3 8>,
351							 <&cpu4 3 14>,
352							 <&cpu5 3 14>,
353							 <&cpu6 3 14>,
354							 <&cpu7 3 14>;
355				};
356			};
357		};
358		gpu_thermal: gpu-thermal {
359			thermal-sensors = <&tmu_gpu>;
360			polling-delay-passive = <0>;
361			polling-delay = <0>;
362			trips {
363				gpu_alert0: gpu-alert-0 {
364					temperature = <50000>;
365					hysteresis = <5000>;
366					type = "active";
367				};
368				gpu_alert1: gpu-alert-1 {
369					temperature = <60000>;
370					hysteresis = <5000>;
371					type = "active";
372				};
373				gpu_alert2: gpu-alert-2 {
374					temperature = <70000>;
375					hysteresis = <5000>;
376					type = "active";
377				};
378				gpu_crit0: gpu-crit-0 {
379					temperature = <120000>;
380					hysteresis = <0>;
381					type = "critical";
382				};
383				gpu_alert3: gpu-alert-3 {
384					temperature = <70000>;
385					hysteresis = <10000>;
386					type = "passive";
387				};
388				gpu_alert4: gpu-alert-4 {
389					temperature = <85000>;
390					hysteresis = <10000>;
391					type = "passive";
392				};
393			};
394			cooling-maps {
395				map0 {
396					trip = <&gpu_alert0>;
397					cooling-device = <&fan0 0 1>;
398				};
399				map1 {
400					trip = <&gpu_alert1>;
401					cooling-device = <&fan0 1 2>;
402				};
403				map2 {
404					trip = <&gpu_alert2>;
405					cooling-device = <&fan0 2 3>;
406				};
407				map3 {
408					trip = <&gpu_alert3>;
409					cooling-device = <&gpu 0 2>;
410				};
411				map4 {
412					trip = <&gpu_alert4>;
413					cooling-device = <&gpu 3 6>;
414				};
415			};
416		};
417	};
418};
419
420&buck10_reg {
421	/* Supplies vmmc-supply of mmc_0 */
422	regulator-always-on;
423	regulator-boot-on;
424};
425
426&hdmi {
427	status = "okay";
428	ddc = <&i2c_2>;
429	hpd-gpios = <&gpx3 7 GPIO_ACTIVE_HIGH>;
430	pinctrl-names = "default";
431	pinctrl-0 = <&hdmi_hpd_irq>;
432
433	vdd_osc-supply = <&ldo7_reg>;
434	vdd_pll-supply = <&ldo6_reg>;
435	vdd-supply = <&ldo6_reg>;
436};
437
438&hdmicec {
439	status = "okay";
440	needs-hpd;
441};
442
443&i2c_2 {
444	samsung,i2c-sda-delay = <100>;
445	samsung,i2c-max-bus-freq = <66000>;
446	/* used by HDMI DDC */
447	status = "okay";
448};
449
450&ldo26_reg {
451	regulator-min-microvolt = <3000000>;
452	regulator-max-microvolt = <3000000>;
453	regulator-always-on;
454};
455
456&mixer {
457	status = "okay";
458};
459
460&mmc_0 {
461	status = "okay";
462	mmc-pwrseq = <&emmc_pwrseq>;
463	card-detect-delay = <200>;
464	samsung,dw-mshc-ciu-div = <3>;
465	samsung,dw-mshc-sdr-timing = <0 4>;
466	samsung,dw-mshc-ddr-timing = <0 2>;
467	samsung,dw-mshc-hs400-timing = <0 2>;
468	samsung,read-strobe-delay = <90>;
469	pinctrl-names = "default";
470	pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus1 &sd0_bus4 &sd0_bus8 &sd0_cd &sd0_rclk>;
471	bus-width = <8>;
472	cap-mmc-highspeed;
473	mmc-ddr-1_8v;
474	mmc-hs200-1_8v;
475	mmc-hs400-1_8v;
476	max-frequency = <200000000>;
477	vmmc-supply = <&ldo18_reg>;
478	vqmmc-supply = <&ldo3_reg>;
479};
480
481&pinctrl_0 {
482	power_key: power-key-pins {
483		samsung,pins = "gpx0-3";
484		samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
485		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
486		samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
487	};
488
489	hdmi_hpd_irq: hdmi-hpd-irq-pins {
490		samsung,pins = "gpx3-7";
491		samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
492		samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
493		samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
494	};
495};
496
497&pinctrl_1 {
498	emmc_nrst_pin: emmc-nrst-pins {
499		samsung,pins = "gpd1-0";
500		samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
501		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
502		samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
503	};
504};
505