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 = <250>;
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				/*
82				 * Exynos542x supports only 4 trip-points
83				 * so for these polling mode is required.
84				 * Start polling at temperature level of last
85				 * interrupt-driven trip: cpu0_alert2
86				 */
87				cpu0_alert3: cpu-alert-3 {
88					temperature = <70000>; /* millicelsius */
89					hysteresis = <10000>; /* millicelsius */
90					type = "passive";
91				};
92				cpu0_alert4: cpu-alert-4 {
93					temperature = <85000>; /* millicelsius */
94					hysteresis = <10000>; /* millicelsius */
95					type = "passive";
96				};
97			};
98			cooling-maps {
99				map0 {
100					trip = <&cpu0_alert0>;
101					cooling-device = <&fan0 0 1>;
102				};
103				map1 {
104					trip = <&cpu0_alert1>;
105					cooling-device = <&fan0 1 2>;
106				};
107				map2 {
108					trip = <&cpu0_alert2>;
109					cooling-device = <&fan0 2 3>;
110				};
111				/*
112				 * When reaching cpu0_alert3, reduce CPU
113				 * by 2 steps. On Exynos5422/5800 that would
114				 * (usually) be: 1800 MHz and 1200 MHz.
115				 */
116				map3 {
117					trip = <&cpu0_alert3>;
118					cooling-device = <&cpu0 0 2>,
119							 <&cpu1 0 2>,
120							 <&cpu2 0 2>,
121							 <&cpu3 0 2>,
122							 <&cpu4 0 2>,
123							 <&cpu5 0 2>,
124							 <&cpu6 0 2>,
125							 <&cpu7 0 2>;
126				};
127				/*
128				 * When reaching cpu0_alert4, reduce CPU
129				 * further, down to 600 MHz (14 steps for big,
130				 * 8 steps for LITTLE).
131				 */
132				cpu0_cooling_map4: map4 {
133					trip = <&cpu0_alert4>;
134					cooling-device = <&cpu0 3 8>,
135							 <&cpu1 3 8>,
136							 <&cpu2 3 8>,
137							 <&cpu3 3 8>,
138							 <&cpu4 3 14>,
139							 <&cpu5 3 14>,
140							 <&cpu6 3 14>,
141							 <&cpu7 3 14>;
142				};
143			};
144		};
145		cpu1_thermal: cpu1-thermal {
146			thermal-sensors = <&tmu_cpu1>;
147			polling-delay-passive = <250>;
148			polling-delay = <0>;
149			trips {
150				cpu1_alert0: cpu-alert-0 {
151					temperature = <50000>;
152					hysteresis = <5000>;
153					type = "active";
154				};
155				cpu1_alert1: cpu-alert-1 {
156					temperature = <60000>;
157					hysteresis = <5000>;
158					type = "active";
159				};
160				cpu1_alert2: cpu-alert-2 {
161					temperature = <70000>;
162					hysteresis = <5000>;
163					type = "active";
164				};
165				cpu1_crit0: cpu-crit-0 {
166					temperature = <120000>;
167					hysteresis = <0>;
168					type = "critical";
169				};
170				cpu1_alert3: cpu-alert-3 {
171					temperature = <70000>;
172					hysteresis = <10000>;
173					type = "passive";
174				};
175				cpu1_alert4: cpu-alert-4 {
176					temperature = <85000>;
177					hysteresis = <10000>;
178					type = "passive";
179				};
180			};
181			cooling-maps {
182				map0 {
183					trip = <&cpu1_alert0>;
184					cooling-device = <&fan0 0 1>;
185				};
186				map1 {
187					trip = <&cpu1_alert1>;
188					cooling-device = <&fan0 1 2>;
189				};
190				map2 {
191					trip = <&cpu1_alert2>;
192					cooling-device = <&fan0 2 3>;
193				};
194				map3 {
195					trip = <&cpu1_alert3>;
196					cooling-device = <&cpu0 0 2>,
197							 <&cpu1 0 2>,
198							 <&cpu2 0 2>,
199							 <&cpu3 0 2>,
200							 <&cpu4 0 2>,
201							 <&cpu5 0 2>,
202							 <&cpu6 0 2>,
203							 <&cpu7 0 2>;
204				};
205				cpu1_cooling_map4: map4 {
206					trip = <&cpu1_alert4>;
207					cooling-device = <&cpu0 3 8>,
208							 <&cpu1 3 8>,
209							 <&cpu2 3 8>,
210							 <&cpu3 3 8>,
211							 <&cpu4 3 14>,
212							 <&cpu5 3 14>,
213							 <&cpu6 3 14>,
214							 <&cpu7 3 14>;
215				};
216			};
217		};
218		cpu2_thermal: cpu2-thermal {
219			thermal-sensors = <&tmu_cpu2>;
220			polling-delay-passive = <250>;
221			polling-delay = <0>;
222			trips {
223				cpu2_alert0: cpu-alert-0 {
224					temperature = <50000>;
225					hysteresis = <5000>;
226					type = "active";
227				};
228				cpu2_alert1: cpu-alert-1 {
229					temperature = <60000>;
230					hysteresis = <5000>;
231					type = "active";
232				};
233				cpu2_alert2: cpu-alert-2 {
234					temperature = <70000>;
235					hysteresis = <5000>;
236					type = "active";
237				};
238				cpu2_crit0: cpu-crit-0 {
239					temperature = <120000>;
240					hysteresis = <0>;
241					type = "critical";
242				};
243				cpu2_alert3: cpu-alert-3 {
244					temperature = <70000>;
245					hysteresis = <10000>;
246					type = "passive";
247				};
248				cpu2_alert4: cpu-alert-4 {
249					temperature = <85000>;
250					hysteresis = <10000>;
251					type = "passive";
252				};
253			};
254			cooling-maps {
255				map0 {
256					trip = <&cpu2_alert0>;
257					cooling-device = <&fan0 0 1>;
258				};
259				map1 {
260					trip = <&cpu2_alert1>;
261					cooling-device = <&fan0 1 2>;
262				};
263				map2 {
264					trip = <&cpu2_alert2>;
265					cooling-device = <&fan0 2 3>;
266				};
267				map3 {
268					trip = <&cpu2_alert3>;
269					cooling-device = <&cpu0 0 2>,
270							 <&cpu1 0 2>,
271							 <&cpu2 0 2>,
272							 <&cpu3 0 2>,
273							 <&cpu4 0 2>,
274							 <&cpu5 0 2>,
275							 <&cpu6 0 2>,
276							 <&cpu7 0 2>;
277				};
278				cpu2_cooling_map4: map4 {
279					trip = <&cpu2_alert4>;
280					cooling-device = <&cpu0 3 8>,
281							 <&cpu1 3 8>,
282							 <&cpu2 3 8>,
283							 <&cpu3 3 8>,
284							 <&cpu4 3 14>,
285							 <&cpu5 3 14>,
286							 <&cpu6 3 14>,
287							 <&cpu7 3 14>;
288				};
289			};
290		};
291		cpu3_thermal: cpu3-thermal {
292			thermal-sensors = <&tmu_cpu3>;
293			polling-delay-passive = <250>;
294			polling-delay = <0>;
295			trips {
296				cpu3_alert0: cpu-alert-0 {
297					temperature = <50000>;
298					hysteresis = <5000>;
299					type = "active";
300				};
301				cpu3_alert1: cpu-alert-1 {
302					temperature = <60000>;
303					hysteresis = <5000>;
304					type = "active";
305				};
306				cpu3_alert2: cpu-alert-2 {
307					temperature = <70000>;
308					hysteresis = <5000>;
309					type = "active";
310				};
311				cpu3_crit0: cpu-crit-0 {
312					temperature = <120000>;
313					hysteresis = <0>;
314					type = "critical";
315				};
316				cpu3_alert3: cpu-alert-3 {
317					temperature = <70000>;
318					hysteresis = <10000>;
319					type = "passive";
320				};
321				cpu3_alert4: cpu-alert-4 {
322					temperature = <85000>;
323					hysteresis = <10000>;
324					type = "passive";
325				};
326			};
327			cooling-maps {
328				map0 {
329					trip = <&cpu3_alert0>;
330					cooling-device = <&fan0 0 1>;
331				};
332				map1 {
333					trip = <&cpu3_alert1>;
334					cooling-device = <&fan0 1 2>;
335				};
336				map2 {
337					trip = <&cpu3_alert2>;
338					cooling-device = <&fan0 2 3>;
339				};
340				map3 {
341					trip = <&cpu3_alert3>;
342					cooling-device = <&cpu0 0 2>,
343							 <&cpu1 0 2>,
344							 <&cpu2 0 2>,
345							 <&cpu3 0 2>,
346							 <&cpu4 0 2>,
347							 <&cpu5 0 2>,
348							 <&cpu6 0 2>,
349							 <&cpu7 0 2>;
350				};
351				cpu3_cooling_map4: map4 {
352					trip = <&cpu3_alert4>;
353					cooling-device = <&cpu0 3 8>,
354							 <&cpu1 3 8>,
355							 <&cpu2 3 8>,
356							 <&cpu3 3 8>,
357							 <&cpu4 3 14>,
358							 <&cpu5 3 14>,
359							 <&cpu6 3 14>,
360							 <&cpu7 3 14>;
361				};
362			};
363		};
364		gpu_thermal: gpu-thermal {
365			thermal-sensors = <&tmu_gpu>;
366			polling-delay-passive = <250>;
367			polling-delay = <0>;
368			trips {
369				gpu_alert0: gpu-alert-0 {
370					temperature = <50000>;
371					hysteresis = <5000>;
372					type = "active";
373				};
374				gpu_alert1: gpu-alert-1 {
375					temperature = <60000>;
376					hysteresis = <5000>;
377					type = "active";
378				};
379				gpu_alert2: gpu-alert-2 {
380					temperature = <70000>;
381					hysteresis = <5000>;
382					type = "active";
383				};
384				gpu_crit0: gpu-crit-0 {
385					temperature = <120000>;
386					hysteresis = <0>;
387					type = "critical";
388				};
389				gpu_alert3: gpu-alert-3 {
390					temperature = <70000>;
391					hysteresis = <10000>;
392					type = "passive";
393				};
394				gpu_alert4: gpu-alert-4 {
395					temperature = <85000>;
396					hysteresis = <10000>;
397					type = "passive";
398				};
399			};
400			cooling-maps {
401				map0 {
402					trip = <&gpu_alert0>;
403					cooling-device = <&fan0 0 1>;
404				};
405				map1 {
406					trip = <&gpu_alert1>;
407					cooling-device = <&fan0 1 2>;
408				};
409				map2 {
410					trip = <&gpu_alert2>;
411					cooling-device = <&fan0 2 3>;
412				};
413				map3 {
414					trip = <&gpu_alert3>;
415					cooling-device = <&gpu 0 2>;
416				};
417				map4 {
418					trip = <&gpu_alert4>;
419					cooling-device = <&gpu 3 6>;
420				};
421			};
422		};
423	};
424};
425
426&buck10_reg {
427	/* Supplies vmmc-supply of mmc_0 */
428	regulator-always-on;
429	regulator-boot-on;
430};
431
432&hdmi {
433	status = "okay";
434	ddc = <&i2c_2>;
435	hpd-gpios = <&gpx3 7 GPIO_ACTIVE_HIGH>;
436	pinctrl-names = "default";
437	pinctrl-0 = <&hdmi_hpd_irq>;
438
439	vdd_osc-supply = <&ldo7_reg>;
440	vdd_pll-supply = <&ldo6_reg>;
441	vdd-supply = <&ldo6_reg>;
442};
443
444&hdmicec {
445	status = "okay";
446	needs-hpd;
447};
448
449&i2c_2 {
450	samsung,i2c-sda-delay = <100>;
451	samsung,i2c-max-bus-freq = <66000>;
452	/* used by HDMI DDC */
453	status = "okay";
454};
455
456&ldo26_reg {
457	regulator-min-microvolt = <3000000>;
458	regulator-max-microvolt = <3000000>;
459	regulator-always-on;
460};
461
462&mixer {
463	status = "okay";
464};
465
466&mmc_0 {
467	status = "okay";
468	mmc-pwrseq = <&emmc_pwrseq>;
469	card-detect-delay = <200>;
470	samsung,dw-mshc-ciu-div = <3>;
471	samsung,dw-mshc-sdr-timing = <0 4>;
472	samsung,dw-mshc-ddr-timing = <0 2>;
473	samsung,dw-mshc-hs400-timing = <0 2>;
474	samsung,read-strobe-delay = <90>;
475	pinctrl-names = "default";
476	pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus1 &sd0_bus4 &sd0_bus8 &sd0_cd &sd0_rclk>;
477	bus-width = <8>;
478	cap-mmc-highspeed;
479	mmc-ddr-1_8v;
480	mmc-hs200-1_8v;
481	mmc-hs400-1_8v;
482	max-frequency = <200000000>;
483	vmmc-supply = <&ldo18_reg>;
484	vqmmc-supply = <&ldo3_reg>;
485};
486
487&pinctrl_0 {
488	power_key: power-key-pins {
489		samsung,pins = "gpx0-3";
490		samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
491		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
492		samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
493	};
494
495	hdmi_hpd_irq: hdmi-hpd-irq-pins {
496		samsung,pins = "gpx3-7";
497		samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
498		samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
499		samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
500	};
501};
502
503&pinctrl_1 {
504	emmc_nrst_pin: emmc-nrst-pins {
505		samsung,pins = "gpd1-0";
506		samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
507		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
508		samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
509	};
510};
511