1/*
2 * Copyright (C) 2014-2016 Texas Instruments Incorporated - http://www.ti.com/
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8/dts-v1/;
9
10#include "dra74x.dtsi"
11#include "am57xx-commercial-grade.dtsi"
12#include <dt-bindings/gpio/gpio.h>
13#include <dt-bindings/interrupt-controller/irq.h>
14
15/ {
16	compatible = "ti,am572x-beagle-x15", "ti,am5728", "ti,dra742", "ti,dra74", "ti,dra7";
17
18	chosen {
19		stdout-path = &uart3;
20	};
21
22	aliases {
23		rtc0 = &mcp_rtc;
24		rtc1 = &tps659038_rtc;
25		rtc2 = &rtc;
26		display0 = &hdmi0;
27	};
28
29	memory@0 {
30		device_type = "memory";
31		reg = <0x0 0x80000000 0x0 0x80000000>;
32	};
33
34	vdd_3v3: fixedregulator-vdd_3v3 {
35		compatible = "regulator-fixed";
36		regulator-name = "vdd_3v3";
37		vin-supply = <&regen1>;
38		regulator-min-microvolt = <3300000>;
39		regulator-max-microvolt = <3300000>;
40	};
41
42	aic_dvdd: fixedregulator-aic_dvdd {
43		compatible = "regulator-fixed";
44		regulator-name = "aic_dvdd_fixed";
45		vin-supply = <&vdd_3v3>;
46		regulator-min-microvolt = <1800000>;
47		regulator-max-microvolt = <1800000>;
48	};
49
50	vtt_fixed: fixedregulator-vtt {
51		/* TPS51200 */
52		compatible = "regulator-fixed";
53		regulator-name = "vtt_fixed";
54		vin-supply = <&smps3_reg>;
55		regulator-min-microvolt = <3300000>;
56		regulator-max-microvolt = <3300000>;
57		regulator-always-on;
58		regulator-boot-on;
59		enable-active-high;
60		gpio = <&gpio7 11 GPIO_ACTIVE_HIGH>;
61	};
62
63	leds {
64		compatible = "gpio-leds";
65
66		led0 {
67			label = "beagle-x15:usr0";
68			gpios = <&gpio7 9 GPIO_ACTIVE_HIGH>;
69			linux,default-trigger = "heartbeat";
70			default-state = "off";
71		};
72
73		led1 {
74			label = "beagle-x15:usr1";
75			gpios = <&gpio7 8 GPIO_ACTIVE_HIGH>;
76			linux,default-trigger = "cpu0";
77			default-state = "off";
78		};
79
80		led2 {
81			label = "beagle-x15:usr2";
82			gpios = <&gpio7 14 GPIO_ACTIVE_HIGH>;
83			linux,default-trigger = "mmc0";
84			default-state = "off";
85		};
86
87		led3 {
88			label = "beagle-x15:usr3";
89			gpios = <&gpio7 15 GPIO_ACTIVE_HIGH>;
90			linux,default-trigger = "disk-activity";
91			default-state = "off";
92		};
93	};
94
95	gpio_fan: gpio_fan {
96		/* Based on 5v 500mA AFB02505HHB */
97		compatible = "gpio-fan";
98		gpios =  <&tps659038_gpio 2 GPIO_ACTIVE_HIGH>;
99		gpio-fan,speed-map = <0     0>,
100				     <13000 1>;
101		#cooling-cells = <2>;
102	};
103
104	hdmi0: connector {
105		compatible = "hdmi-connector";
106		label = "hdmi";
107
108		type = "a";
109
110		port {
111			hdmi_connector_in: endpoint {
112				remote-endpoint = <&tpd12s015_out>;
113			};
114		};
115	};
116
117	tpd12s015: encoder {
118		compatible = "ti,tpd12s015";
119
120		ports {
121			#address-cells = <1>;
122			#size-cells = <0>;
123
124			port@0 {
125				reg = <0>;
126
127				tpd12s015_in: endpoint {
128					remote-endpoint = <&hdmi_out>;
129				};
130			};
131
132			port@1 {
133				reg = <1>;
134
135				tpd12s015_out: endpoint {
136					remote-endpoint = <&hdmi_connector_in>;
137				};
138			};
139		};
140	};
141
142	sound0: sound0 {
143		compatible = "simple-audio-card";
144		simple-audio-card,name = "BeagleBoard-X15";
145		simple-audio-card,widgets =
146			"Line", "Line Out",
147			"Line", "Line In";
148		simple-audio-card,routing =
149			"Line Out",	"LLOUT",
150			"Line Out",	"RLOUT",
151			"MIC2L",	"Line In",
152			"MIC2R",	"Line In";
153		simple-audio-card,format = "dsp_b";
154		simple-audio-card,bitclock-master = <&sound0_master>;
155		simple-audio-card,frame-master = <&sound0_master>;
156		simple-audio-card,bitclock-inversion;
157
158		simple-audio-card,cpu {
159			sound-dai = <&mcasp3>;
160		};
161
162		sound0_master: simple-audio-card,codec {
163			sound-dai = <&tlv320aic3104>;
164			clocks = <&clkout2_clk>;
165		};
166	};
167};
168
169&dra7_pmx_core {
170	mmc1_pins_default: mmc1_pins_default {
171		pinctrl-single,pins = <
172			DRA7XX_CORE_IOPAD(0x376c, PIN_INPUT | MUX_MODE14)	/* mmc1sdcd.gpio219 */
173			DRA7XX_CORE_IOPAD(0x3754, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_clk.clk */
174			DRA7XX_CORE_IOPAD(0x3758, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_cmd.cmd */
175			DRA7XX_CORE_IOPAD(0x375c, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat0.dat0 */
176			DRA7XX_CORE_IOPAD(0x3760, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat1.dat1 */
177			DRA7XX_CORE_IOPAD(0x3764, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat2.dat2 */
178			DRA7XX_CORE_IOPAD(0x3768, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat3.dat3 */
179		>;
180	};
181
182	mmc2_pins_default: mmc2_pins_default {
183		pinctrl-single,pins = <
184			DRA7XX_CORE_IOPAD(0x349c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a23.mmc2_clk */
185			DRA7XX_CORE_IOPAD(0x34b0, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_cs1.mmc2_cmd */
186			DRA7XX_CORE_IOPAD(0x34a0, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a24.mmc2_dat0 */
187			DRA7XX_CORE_IOPAD(0x34a4, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a25.mmc2_dat1 */
188			DRA7XX_CORE_IOPAD(0x34a8, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a26.mmc2_dat2 */
189			DRA7XX_CORE_IOPAD(0x34ac, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a27.mmc2_dat3 */
190			DRA7XX_CORE_IOPAD(0x348c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a19.mmc2_dat4 */
191			DRA7XX_CORE_IOPAD(0x3490, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a20.mmc2_dat5 */
192			DRA7XX_CORE_IOPAD(0x3494, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a21.mmc2_dat6 */
193			DRA7XX_CORE_IOPAD(0x3498, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a22.mmc2_dat7 */
194		>;
195	};
196};
197&i2c1 {
198	status = "okay";
199	clock-frequency = <400000>;
200
201	tps659038: tps659038@58 {
202		compatible = "ti,tps659038";
203		reg = <0x58>;
204		interrupt-parent = <&gpio1>;
205		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
206
207		#interrupt-cells = <2>;
208		interrupt-controller;
209
210		ti,system-power-controller;
211
212		tps659038_pmic {
213			compatible = "ti,tps659038-pmic";
214
215			regulators {
216				smps12_reg: smps12 {
217					/* VDD_MPU */
218					regulator-name = "smps12";
219					regulator-min-microvolt = < 850000>;
220					regulator-max-microvolt = <1250000>;
221					regulator-always-on;
222					regulator-boot-on;
223				};
224
225				smps3_reg: smps3 {
226					/* VDD_DDR */
227					regulator-name = "smps3";
228					regulator-min-microvolt = <1350000>;
229					regulator-max-microvolt = <1350000>;
230					regulator-always-on;
231					regulator-boot-on;
232				};
233
234				smps45_reg: smps45 {
235					/* VDD_DSPEVE, VDD_IVA, VDD_GPU */
236					regulator-name = "smps45";
237					regulator-min-microvolt = < 850000>;
238					regulator-max-microvolt = <1250000>;
239					regulator-always-on;
240					regulator-boot-on;
241				};
242
243				smps6_reg: smps6 {
244					/* VDD_CORE */
245					regulator-name = "smps6";
246					regulator-min-microvolt = <850000>;
247					regulator-max-microvolt = <1150000>;
248					regulator-always-on;
249					regulator-boot-on;
250				};
251
252				/* SMPS7 unused */
253
254				smps8_reg: smps8 {
255					/* VDD_1V8 */
256					regulator-name = "smps8";
257					regulator-min-microvolt = <1800000>;
258					regulator-max-microvolt = <1800000>;
259					regulator-always-on;
260					regulator-boot-on;
261				};
262
263				/* SMPS9 unused */
264
265				ldo1_reg: ldo1 {
266					/* VDD_SD / VDDSHV8  */
267					regulator-name = "ldo1";
268					regulator-min-microvolt = <1800000>;
269					regulator-max-microvolt = <3300000>;
270					regulator-boot-on;
271					regulator-always-on;
272				};
273
274				ldo2_reg: ldo2 {
275					/* VDD_SHV5 */
276					regulator-name = "ldo2";
277					regulator-min-microvolt = <3300000>;
278					regulator-max-microvolt = <3300000>;
279					regulator-always-on;
280					regulator-boot-on;
281				};
282
283				ldo3_reg: ldo3 {
284					/* VDDA_1V8_PHYA */
285					regulator-name = "ldo3";
286					regulator-min-microvolt = <1800000>;
287					regulator-max-microvolt = <1800000>;
288					regulator-always-on;
289					regulator-boot-on;
290				};
291
292				ldo4_reg: ldo4 {
293					/* VDDA_1V8_PHYB */
294					regulator-name = "ldo4";
295					regulator-min-microvolt = <1800000>;
296					regulator-max-microvolt = <1800000>;
297					regulator-always-on;
298					regulator-boot-on;
299				};
300
301				ldo9_reg: ldo9 {
302					/* VDD_RTC */
303					regulator-name = "ldo9";
304					regulator-min-microvolt = <1050000>;
305					regulator-max-microvolt = <1050000>;
306					regulator-always-on;
307					regulator-boot-on;
308				};
309
310				ldoln_reg: ldoln {
311					/* VDDA_1V8_PLL */
312					regulator-name = "ldoln";
313					regulator-min-microvolt = <1800000>;
314					regulator-max-microvolt = <1800000>;
315					regulator-always-on;
316					regulator-boot-on;
317				};
318
319				ldousb_reg: ldousb {
320					/* VDDA_3V_USB: VDDA_USBHS33 */
321					regulator-name = "ldousb";
322					regulator-min-microvolt = <3300000>;
323					regulator-max-microvolt = <3300000>;
324					regulator-boot-on;
325				};
326
327				regen1: regen1 {
328					/* VDD_3V3_ON */
329					regulator-name = "regen1";
330					regulator-boot-on;
331					regulator-always-on;
332				};
333			};
334		};
335
336		tps659038_rtc: tps659038_rtc {
337			compatible = "ti,palmas-rtc";
338			interrupt-parent = <&tps659038>;
339			interrupts = <8 IRQ_TYPE_EDGE_FALLING>;
340			wakeup-source;
341		};
342
343		tps659038_pwr_button: tps659038_pwr_button {
344			compatible = "ti,palmas-pwrbutton";
345			interrupt-parent = <&tps659038>;
346			interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
347			wakeup-source;
348			ti,palmas-long-press-seconds = <12>;
349		};
350
351		tps659038_gpio: tps659038_gpio {
352			compatible = "ti,palmas-gpio";
353			gpio-controller;
354			#gpio-cells = <2>;
355		};
356
357		extcon_usb2: tps659038_usb {
358			compatible = "ti,palmas-usb-vid";
359			ti,enable-vbus-detection;
360			vbus-gpio = <&gpio4 21 GPIO_ACTIVE_HIGH>;
361		};
362
363	};
364
365	tmp102: tmp102@48 {
366		compatible = "ti,tmp102";
367		reg = <0x48>;
368		interrupt-parent = <&gpio7>;
369		interrupts = <16 IRQ_TYPE_LEVEL_LOW>;
370		#thermal-sensor-cells = <1>;
371	};
372
373	tlv320aic3104: tlv320aic3104@18 {
374		#sound-dai-cells = <0>;
375		compatible = "ti,tlv320aic3104";
376		reg = <0x18>;
377		assigned-clocks = <&clkoutmux2_clk_mux>;
378		assigned-clock-parents = <&sys_clk2_dclk_div>;
379
380		status = "okay";
381		adc-settle-ms = <40>;
382
383		AVDD-supply = <&vdd_3v3>;
384		IOVDD-supply = <&vdd_3v3>;
385		DRVDD-supply = <&vdd_3v3>;
386		DVDD-supply = <&aic_dvdd>;
387	};
388
389	eeprom: eeprom@50 {
390		compatible = "at,24c32";
391		reg = <0x50>;
392	};
393};
394
395&i2c3 {
396	status = "okay";
397	clock-frequency = <400000>;
398
399	mcp_rtc: rtc@6f {
400		compatible = "microchip,mcp7941x";
401		reg = <0x6f>;
402		interrupts-extended = <&crossbar_mpu GIC_SPI 2 IRQ_TYPE_EDGE_RISING>,
403				      <&dra7_pmx_core 0x424>;
404		interrupt-names = "irq", "wakeup";
405
406		vcc-supply = <&vdd_3v3>;
407		wakeup-source;
408	};
409};
410
411&gpio7 {
412	ti,no-reset-on-init;
413	ti,no-idle-on-init;
414};
415
416&cpu0 {
417	cpu0-supply = <&smps12_reg>;
418	voltage-tolerance = <1>;
419};
420
421&uart3 {
422	status = "okay";
423	interrupts-extended = <&crossbar_mpu GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>,
424			      <&dra7_pmx_core 0x3f8>;
425};
426
427&mac {
428	status = "okay";
429	dual_emac;
430};
431
432&cpsw_emac0 {
433	phy_id = <&davinci_mdio>, <1>;
434	phy-mode = "rgmii";
435	dual_emac_res_vlan = <1>;
436};
437
438&cpsw_emac1 {
439	phy_id = <&davinci_mdio>, <2>;
440	phy-mode = "rgmii";
441	dual_emac_res_vlan = <2>;
442};
443
444&mmc1 {
445	status = "okay";
446
447	pinctrl-names = "default";
448	pinctrl-0 = <&mmc1_pins_default>;
449
450	bus-width = <4>;
451	cd-gpios = <&gpio6 27 GPIO_ACTIVE_LOW>; /* gpio 219 */
452};
453
454&mmc2 {
455	status = "okay";
456
457	pinctrl-names = "default";
458	pinctrl-0 = <&mmc2_pins_default>;
459
460	vmmc-supply = <&vdd_3v3>;
461	bus-width = <8>;
462	ti,non-removable;
463	cap-mmc-dual-data-rate;
464};
465
466&sata {
467	status = "okay";
468};
469
470&usb2_phy1 {
471	phy-supply = <&ldousb_reg>;
472};
473
474&usb2_phy2 {
475	phy-supply = <&ldousb_reg>;
476};
477
478&usb1 {
479	dr_mode = "host";
480};
481
482&omap_dwc3_2 {
483	extcon = <&extcon_usb2>;
484};
485
486&usb2 {
487	/*
488	 * Stand alone usage is peripheral only.
489	 * However, with some resistor modifications
490	 * this port can be used via expansion connectors
491	 * as "host" or "dual-role". If so, provide
492	 * the necessary dr_mode override in the expansion
493	 * board's DT.
494	 */
495	dr_mode = "peripheral";
496};
497
498&cpu_trips {
499	cpu_alert1: cpu_alert1 {
500		temperature = <50000>; /* millicelsius */
501		hysteresis = <2000>; /* millicelsius */
502		type = "active";
503	};
504};
505
506&cpu_cooling_maps {
507	map1 {
508		trip = <&cpu_alert1>;
509		cooling-device = <&gpio_fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
510	};
511};
512
513&thermal_zones {
514	board_thermal: board_thermal {
515		polling-delay-passive = <1250>; /* milliseconds */
516		polling-delay = <1500>; /* milliseconds */
517
518				/* sensor       ID */
519		thermal-sensors = <&tmp102     0>;
520
521		board_trips: trips {
522			board_alert0: board_alert {
523				temperature = <40000>; /* millicelsius */
524				hysteresis = <2000>; /* millicelsius */
525				type = "active";
526			};
527
528			board_crit: board_crit {
529				temperature = <105000>; /* millicelsius */
530				hysteresis = <0>; /* millicelsius */
531				type = "critical";
532			};
533		};
534
535		board_cooling_maps: cooling-maps {
536			map0 {
537				trip = <&board_alert0>;
538				cooling-device =
539				  <&gpio_fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
540			};
541		};
542       };
543};
544
545&dss {
546	status = "ok";
547
548	vdda_video-supply = <&ldoln_reg>;
549};
550
551&hdmi {
552	status = "ok";
553	vdda-supply = <&ldo4_reg>;
554
555	port {
556		hdmi_out: endpoint {
557			remote-endpoint = <&tpd12s015_in>;
558		};
559	};
560};
561
562&pcie1 {
563	gpios = <&gpio2 8 GPIO_ACTIVE_LOW>;
564};
565
566&mcasp3 {
567	#sound-dai-cells = <0>;
568	assigned-clocks = <&mcasp3_ahclkx_mux>;
569	assigned-clock-parents = <&sys_clkin2>;
570	status = "okay";
571
572	op-mode = <0>;	/* MCASP_IIS_MODE */
573	tdm-slots = <2>;
574	/* 4 serializers */
575	serial-dir = <	/* 0: INACTIVE, 1: TX, 2: RX */
576		1 2 0 0
577	>;
578	tx-num-evt = <32>;
579	rx-num-evt = <32>;
580};
581
582&mailbox5 {
583	status = "okay";
584	mbox_ipu1_ipc3x: mbox_ipu1_ipc3x {
585		status = "okay";
586	};
587	mbox_dsp1_ipc3x: mbox_dsp1_ipc3x {
588		status = "okay";
589	};
590};
591
592&mailbox6 {
593	status = "okay";
594	mbox_ipu2_ipc3x: mbox_ipu2_ipc3x {
595		status = "okay";
596	};
597	mbox_dsp2_ipc3x: mbox_dsp2_ipc3x {
598		status = "okay";
599	};
600};
601