1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Hardkernel Odroid XU board device tree source
4 *
5 * Copyright (c) 2013 Samsung Electronics Co., Ltd.
6 *		http://www.samsung.com
7 * Copyright (c) 2016 Krzysztof Kozlowski
8 */
9
10/dts-v1/;
11#include "exynos5410.dtsi"
12#include <dt-bindings/clock/maxim,max77802.h>
13#include <dt-bindings/gpio/gpio.h>
14#include <dt-bindings/interrupt-controller/irq.h>
15#include <dt-bindings/sound/samsung-i2s.h>
16#include "exynos54xx-odroidxu-leds.dtsi"
17
18/ {
19	model = "Hardkernel Odroid XU";
20	compatible = "hardkernel,odroid-xu", "samsung,exynos5410", "samsung,exynos5";
21
22	aliases {
23		ethernet = &ethernet;
24		mmc0 = &mmc_0;
25		mmc1 = &mmc_2;
26	};
27
28	memory@40000000 {
29		device_type = "memory";
30		reg = <0x40000000 0x7ea00000>;
31	};
32
33	chosen {
34		stdout-path = "serial2:115200n8";
35	};
36
37	emmc_pwrseq: pwrseq {
38		pinctrl-0 = <&emmc_nrst_pin>;
39		pinctrl-names = "default";
40		compatible = "mmc-pwrseq-emmc";
41		reset-gpios = <&gpd1 0 GPIO_ACTIVE_LOW>;
42	};
43
44	fan0: pwm-fan {
45		compatible = "pwm-fan";
46		pwms = <&pwm 0 20972 0>;
47		#cooling-cells = <2>;
48		cooling-levels = <0 130 170 230>;
49	};
50
51	fin_pll: xxti {
52		compatible = "fixed-clock";
53		clock-frequency = <24000000>;
54		clock-output-names = "fin_pll";
55		#clock-cells = <0>;
56	};
57
58	firmware@2073000 {
59		compatible = "samsung,secure-firmware";
60		reg = <0x02073000 0x1000>;
61	};
62
63	sound: sound {
64		compatible = "simple-audio-card";
65
66		simple-audio-card,name = "Odroid-XU";
67		simple-audio-card,widgets =
68			"Headphone", "Headphone Jack",
69			"Speakers", "Speakers";
70		simple-audio-card,routing =
71			"Headphone Jack", "HPL",
72			"Headphone Jack", "HPR",
73			"Headphone Jack", "MICBIAS",
74			"IN1", "Headphone Jack",
75			"Speakers", "SPKL",
76			"Speakers", "SPKR";
77
78		simple-audio-card,format = "i2s";
79		simple-audio-card,bitclock-master = <&link0_codec>;
80		simple-audio-card,frame-master = <&link0_codec>;
81
82		simple-audio-card,cpu {
83			sound-dai = <&audi2s0 0>;
84			system-clock-frequency = <19200000>;
85		};
86
87		link0_codec: simple-audio-card,codec {
88			sound-dai = <&max98090>;
89			clocks = <&audi2s0 CLK_I2S_CDCLK>;
90		};
91	};
92};
93
94&adc {
95	vdd-supply = <&ldo10_reg>;
96	status = "okay";
97};
98
99&audi2s0 {
100	status = "okay";
101};
102
103&clock {
104	clocks = <&fin_pll>;
105	assigned-clocks = <&clock CLK_FOUT_EPLL>;
106	assigned-clock-rates = <192000000>;
107};
108
109&clock_audss {
110	assigned-clocks = <&clock_audss EXYNOS_MOUT_AUDSS>,
111			<&clock_audss EXYNOS_MOUT_I2S>,
112			<&clock_audss EXYNOS_DOUT_SRP>,
113			<&clock_audss EXYNOS_DOUT_AUD_BUS>;
114
115	assigned-clock-parents = <&clock CLK_FOUT_EPLL>,
116			<&clock_audss EXYNOS_MOUT_AUDSS>;
117
118	assigned-clock-rates = <0>,
119			       <0>,
120			       <96000000>,
121			       <19200000>;
122};
123
124&cpu0_thermal {
125	polling-delay-passive = <0>;
126	polling-delay = <0>;
127
128	trips {
129		cpu_alert0: cpu-alert-0 {
130			temperature = <50000>; /* millicelsius */
131			hysteresis = <5000>; /* millicelsius */
132			type = "active";
133		};
134		cpu_alert1: cpu-alert-1 {
135			temperature = <60000>; /* millicelsius */
136			hysteresis = <5000>; /* millicelsius */
137			type = "active";
138		};
139		cpu_alert2: cpu-alert-2 {
140			temperature = <70000>; /* millicelsius */
141			hysteresis = <5000>; /* millicelsius */
142			type = "active";
143		};
144		cpu_crit0: cpu-crit-0 {
145			temperature = <120000>; /* millicelsius */
146			hysteresis = <0>; /* millicelsius */
147			type = "critical";
148		};
149	};
150
151	cooling-maps {
152		map0 {
153			trip = <&cpu_alert0>;
154			cooling-device = <&fan0 0 1>;
155		};
156		map1 {
157			trip = <&cpu_alert1>;
158			cooling-device = <&fan0 1 2>;
159		};
160		map2 {
161			trip = <&cpu_alert2>;
162			cooling-device = <&fan0 2 3>;
163		};
164	};
165};
166
167&hsi2c_4 {
168	clock-frequency = <400000>;
169	status = "okay";
170
171	usb3503: usb-hub@8 {
172		compatible = "smsc,usb3503";
173		reg = <0x08>;
174
175		intn-gpios = <&gpx0 7 GPIO_ACTIVE_HIGH>;
176		connect-gpios = <&gpx0 6 GPIO_ACTIVE_HIGH>;
177		reset-gpios = <&gpx1 4 GPIO_ACTIVE_LOW>;
178		initial-mode = <1>;
179
180		clock-names = "refclk";
181		clocks = <&pmu_system_controller 0>;
182		refclk-frequency = <24000000>;
183	};
184
185	max77802: pmic@9 {
186		compatible = "maxim,max77802";
187		reg = <0x9>;
188		interrupt-parent = <&gpx0>;
189		interrupts = <4 IRQ_TYPE_NONE>;
190		pinctrl-names = "default";
191		pinctrl-0 = <&max77802_irq>, <&pmic_dvs_1>, <&pmic_dvs_2>;
192		wakeup-source;
193		#clock-cells = <1>;
194
195		inl1-supply = <&buck5_reg>;
196		inl2-supply = <&buck7_reg>;
197		inl3-supply = <&buck9_reg>;
198		inl4-supply = <&buck9_reg>;
199		inl5-supply = <&buck9_reg>;
200		inl6-supply = <&buck10_reg>;
201		inl7-supply = <&buck9_reg>;
202		/* inl9 supply is BOOST, not configured here */
203		inl10-supply = <&buck7_reg>;
204
205		regulators {
206			buck1_reg: BUCK1 {
207				regulator-name = "vdd_mif";
208				regulator-min-microvolt = <800000>;
209				regulator-max-microvolt = <1300000>;
210				regulator-always-on;
211				regulator-boot-on;
212			};
213
214			buck2_reg: BUCK2 {
215				regulator-name = "vdd_arm";
216				regulator-min-microvolt = <800000>;
217				regulator-max-microvolt = <1500000>;
218				regulator-always-on;
219				regulator-boot-on;
220			};
221
222			buck3_reg: BUCK3 {
223				regulator-name = "vdd_int";
224				regulator-min-microvolt = <800000>;
225				regulator-max-microvolt = <1400000>;
226				regulator-always-on;
227				regulator-boot-on;
228			};
229
230			buck4_reg: BUCK4 {
231				regulator-name = "vdd_g3d";
232				regulator-min-microvolt = <800000>;
233				regulator-max-microvolt = <1400000>;
234				regulator-always-on;
235				regulator-boot-on;
236			};
237
238			buck5_reg: BUCK5 {
239				regulator-name = "vdd_mem";
240				regulator-min-microvolt = <800000>;
241				regulator-max-microvolt = <1500000>;
242				regulator-always-on;
243				regulator-boot-on;
244			};
245
246			buck6_reg: BUCK6 {
247				regulator-name = "vdd_kfc";
248				regulator-min-microvolt = <800000>;
249				regulator-max-microvolt = <1500000>;
250				regulator-always-on;
251				regulator-boot-on;
252			};
253
254			buck7_reg: BUCK7 {
255				regulator-name = "buck7";
256				regulator-min-microvolt = <1300000>;
257				regulator-max-microvolt = <1300000>;
258				regulator-always-on;
259				regulator-boot-on;
260			};
261
262			buck8_reg: BUCK8 {
263				/* vdd_mmc0 */
264				regulator-name = "vddf_2v85";
265				regulator-min-microvolt = <2850000>;
266				regulator-max-microvolt = <2850000>;
267				regulator-always-on;
268				regulator-boot-on;
269			};
270
271			buck9_reg: BUCK9 {
272				regulator-name = "buck9";
273				regulator-min-microvolt = <3000000>;
274				regulator-max-microvolt = <3000000>;
275				regulator-always-on;
276				regulator-boot-on;
277			};
278
279			buck10_reg: BUCK10 {
280				regulator-name = "buck10";
281				regulator-min-microvolt = <2950000>;
282				regulator-max-microvolt = <2950000>;
283				regulator-always-on;
284				regulator-boot-on;
285			};
286
287			ldo1_reg: LDO1 {
288				regulator-name = "vdd_alive";
289				regulator-min-microvolt = <1000000>;
290				regulator-max-microvolt = <1000000>;
291				regulator-always-on;
292			};
293
294			ldo2_reg: LDO2 {
295				regulator-name = "vddq_m1_m2";
296				regulator-min-microvolt = <1200000>;
297				regulator-max-microvolt = <1200000>;
298				regulator-always-on;
299			};
300
301			ldo3_reg: LDO3 {
302				regulator-name = "vddq_gpio";
303				regulator-min-microvolt = <1800000>;
304				regulator-max-microvolt = <1800000>;
305				regulator-always-on;
306			};
307
308			ldo4_reg: LDO4 {
309				regulator-name = "vddq_mmc2";
310				regulator-min-microvolt = <1800000>;
311				regulator-max-microvolt = <3000000>;
312				/* Having it off prevents reboot */
313				regulator-always-on;
314			};
315
316			ldo5_reg: LDO5 {
317				regulator-name = "vdd18_hsic";
318				regulator-min-microvolt = <1800000>;
319				regulator-max-microvolt = <1800000>;
320				regulator-always-on;
321			};
322
323			ldo6_reg: LDO6 {
324				regulator-name = "vdd18_bpll";
325				regulator-min-microvolt = <1800000>;
326				regulator-max-microvolt = <1800000>;
327				regulator-always-on;
328			};
329
330			ldo7_reg: LDO7 {
331				regulator-name = "vddq_lcd";
332				regulator-min-microvolt = <1800000>;
333				regulator-max-microvolt = <1800000>;
334				/* Supplies also GPK and GPJ */
335				regulator-always-on;
336			};
337
338			ldo8_reg: LDO8 {
339				regulator-name = "vdd10_hdmi";
340				regulator-min-microvolt = <1000000>;
341				regulator-max-microvolt = <1000000>;
342				regulator-always-on;
343			};
344
345			ldo9_reg: LDO9 {
346				regulator-name = "ldo9";
347			};
348
349			ldo10_reg: LDO10 {
350				regulator-name = "vdd18_mipi";
351				regulator-min-microvolt = <1800000>;
352				regulator-max-microvolt = <1800000>;
353				regulator-always-on;
354			};
355
356			ldo11_reg: LDO11 {
357				regulator-name = "vddq_mmc01";
358				regulator-min-microvolt = <1800000>;
359				regulator-max-microvolt = <1800000>;
360				/*
361				 * Having it off prevents accessing MMC after
362				 * reboot with error:
363				 * MMC Device 1: Clock OFF has been failed.
364				 */
365				regulator-always-on;
366			};
367
368			ldo12_reg: LDO12 {
369				regulator-name = "vdd33_usb3";
370				regulator-min-microvolt = <3300000>;
371				regulator-max-microvolt = <3300000>;
372				regulator-always-on;
373			};
374
375			ldo13_reg: LDO13 {
376				regulator-name = "vddq_abbg0";
377				regulator-min-microvolt = <1800000>;
378				regulator-max-microvolt = <1800000>;
379				regulator-always-on;
380			};
381
382			ldo14_reg: LDO14 {
383				regulator-name = "vddq_abbg1";
384				regulator-min-microvolt = <1800000>;
385				regulator-max-microvolt = <1800000>;
386				regulator-always-on;
387			};
388
389			ldo15_reg: LDO15 {
390				regulator-name = "vdd10_usb3";
391				regulator-min-microvolt = <1000000>;
392				regulator-max-microvolt = <1000000>;
393				regulator-always-on;
394			};
395
396			ldo17_reg: LDO17 {
397				regulator-name = "cam_sensor_core";
398				regulator-min-microvolt = <1200000>;
399				regulator-max-microvolt = <1200000>;
400			};
401
402			ldo18_reg: LDO18 {
403				regulator-name = "ldo18";
404				regulator-min-microvolt = <1800000>;
405				regulator-max-microvolt = <1800000>;
406			};
407
408			ldo19_reg: LDO19 {
409				regulator-name = "ldo19";
410			};
411
412			ldo20_reg: LDO20 {
413				regulator-name = "vdd_mmc0";
414				regulator-min-microvolt = <1800000>;
415				regulator-max-microvolt = <1800000>;
416			};
417
418			ldo21_reg: LDO21 {
419				/* vdd_mmc2 */
420				regulator-name = "vddf_2v8";
421				regulator-min-microvolt = <2850000>;
422				regulator-max-microvolt = <2850000>;
423			};
424
425			ldo23_reg: LDO23 {
426				regulator-name = "dp_p3v3";
427				regulator-min-microvolt = <3300000>;
428				regulator-max-microvolt = <3300000>;
429				regulator-always-on;
430			};
431
432			ldo24_reg: LDO24 {
433				regulator-name = "cam_af";
434				regulator-min-microvolt = <2800000>;
435				regulator-max-microvolt = <2800000>;
436			};
437
438			ldo25_reg: LDO25 {
439				regulator-name = "eth_p3v3";
440				regulator-min-microvolt = <3300000>;
441				regulator-max-microvolt = <3300000>;
442				regulator-always-on;
443			};
444
445			ldo26_reg: LDO26 {
446				regulator-name = "usb30_extclk";
447				regulator-min-microvolt = <3300000>;
448				regulator-max-microvolt = <3300000>;
449				regulator-always-on;
450			};
451
452			ldo27_reg: LDO27 {
453				regulator-name = "ldo27";
454			};
455
456			ldo28_reg: LDO28 {
457				regulator-name = "ldo28";
458			};
459
460			ldo29_reg: LDO29 {
461				regulator-name = "ldo29";
462			};
463
464			ldo30_reg: LDO30 {
465				regulator-name = "vddq_e1_e2";
466				regulator-min-microvolt = <1200000>;
467				regulator-max-microvolt = <1200000>;
468				regulator-always-on;
469			};
470
471			/* On revisions with ti,ina231 this is sensor VS */
472			ldo32_reg: LDO32 {
473				regulator-name = "vs_power_meter";
474				regulator-min-microvolt = <3300000>;
475				regulator-max-microvolt = <3300000>;
476			};
477
478			ldo33_reg: LDO33 {
479				regulator-name = "ldo33";
480			};
481
482			ldo34_reg: LDO34 {
483				regulator-name = "ldo34";
484			};
485
486			ldo35_reg: LDO35 {
487				regulator-name = "ldo35";
488			};
489		};
490	};
491};
492
493&i2c_1 {
494	status = "okay";
495	max98090: audio-codec@10 {
496		compatible = "maxim,max98090";
497		reg = <0x10>;
498		interrupt-parent = <&gpj3>;
499		interrupts = <0 IRQ_TYPE_NONE>;
500		clocks = <&audi2s0 CLK_I2S_CDCLK>;
501		clock-names = "mclk";
502		#sound-dai-cells = <0>;
503	};
504};
505
506&mmc_0 {
507	status = "okay";
508	mmc-pwrseq = <&emmc_pwrseq>;
509	cd-gpios = <&gpc0 2 GPIO_ACTIVE_LOW>;
510	card-detect-delay = <200>;
511	samsung,dw-mshc-ciu-div = <3>;
512	samsung,dw-mshc-sdr-timing = <0 4>;
513	samsung,dw-mshc-ddr-timing = <0 2>;
514	pinctrl-names = "default";
515	pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus1 &sd0_bus4 &sd0_bus8 &sd0_cd>;
516	bus-width = <8>;
517	cap-mmc-highspeed;
518	mmc-ddr-1_8v;
519	mmc-hs200-1_8v;
520	vmmc-supply = <&ldo20_reg>;
521	vqmmc-supply = <&ldo11_reg>;
522};
523
524&mmc_2 {
525	status = "okay";
526	card-detect-delay = <200>;
527	samsung,dw-mshc-ciu-div = <3>;
528	samsung,dw-mshc-sdr-timing = <0 4>;
529	samsung,dw-mshc-ddr-timing = <0 2>;
530	pinctrl-names = "default";
531	pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_cd &sd2_bus1 &sd2_bus4 &sd2_wp>;
532	bus-width = <4>;
533	cap-sd-highspeed;
534	vmmc-supply = <&ldo21_reg>;
535	vqmmc-supply = <&ldo4_reg>;
536};
537
538&pinctrl_0 {
539	emmc_nrst_pin: emmc-nrst-pins {
540		samsung,pins = "gpd1-0";
541		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
542		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
543		samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
544	};
545
546	sd2_wp: sd2-wp-pins {
547		samsung,pins = "gpm5-0";
548		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
549		/* Pin is floating so be sure to disable write-protect */
550		samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
551		samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
552	};
553
554	pmic_dvs_2: pmic-dvs-2-pins {
555		samsung,pins = "gpx0-0", "gpx0-1";
556		samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
557		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
558		samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
559	};
560
561	pmic_dvs_1: pmic-dvs-1-pins {
562		samsung,pins = "gpx0-2";
563		samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
564		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
565		samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
566		samsung,pin-val = <1>;
567	};
568
569	max77802_irq: max77802-irq-pins {
570		samsung,pins = "gpx0-4";
571		samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
572		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
573		samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
574	};
575};
576
577&pwm {
578	/*
579	 * PWM 0 -- fan
580	 * PWM 1 -- Green LED
581	 * PWM 2 -- Blue LED
582	 * PWM 3 -- on MIPI connector for backlight
583	 */
584	pinctrl-0 = <&pwm0_out &pwm1_out &pwm2_out &pwm3_out>;
585	pinctrl-names = "default";
586	status = "okay";
587};
588
589&rtc {
590	status = "okay";
591	clocks = <&clock CLK_RTC>, <&max77802 MAX77802_CLK_32K_AP>;
592	clock-names = "rtc", "rtc_src";
593};
594
595&serial_0 {
596	status = "okay";
597};
598
599&serial_1 {
600	status = "okay";
601};
602
603&serial_2 {
604	status = "okay";
605};
606
607&serial_3 {
608	status = "okay";
609};
610
611&tmu_cpu0 {
612	vtmu-supply = <&ldo10_reg>;
613};
614
615&tmu_cpu1 {
616	vtmu-supply = <&ldo10_reg>;
617};
618
619&tmu_cpu2 {
620	vtmu-supply = <&ldo10_reg>;
621};
622
623&tmu_cpu3 {
624	vtmu-supply = <&ldo10_reg>;
625};
626
627&usb3_0_oc {
628	/* External pull up */
629	samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
630};
631
632&usb3_1_oc {
633	/* External pull up */
634	samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
635};
636
637&usbdrd_dwc3_0 {
638	dr_mode = "peripheral";
639};
640
641&usbdrd_dwc3_1 {
642	dr_mode = "host";
643};
644
645&usbdrd3_0 {
646	vdd33-supply = <&ldo12_reg>;
647	vdd10-supply = <&ldo15_reg>;
648};
649
650&usbdrd3_1 {
651	vdd33-supply = <&ldo12_reg>;
652	vdd10-supply = <&ldo15_reg>;
653};
654
655&usbhost2 {
656	#address-cells = <1>;
657	#size-cells = <0>;
658
659	ethernet: ethernet@2 {
660		compatible = "usb424,9730";
661		reg = <2>;
662		local-mac-address = [00 00 00 00 00 00]; /* Filled in by a bootloader */
663	};
664};
665