1// SPDX-License-Identifier: (GPL-2.0)
2/*
3 * support for the imx6 based aristainetos2 boards
4 * parts common to all versions
5 *
6 * Copyright (C) 2019 Heiko Schocher <hs@denx.de>
7 * Copyright (C) 2015 Heiko Schocher <hs@denx.de>
8 *
9 */
10#include <dt-bindings/gpio/gpio.h>
11#include <dt-bindings/clock/imx6qdl-clock.h>
12
13/ {
14	aliases {
15		eeprom0 = &i2c_eeprom0;
16		eeprom1 = &i2c_eeprom1;
17		eeprom2 = &i2c_eeprom2;
18		pmic0 = &i2c_pmic0;
19	};
20
21	memory@10000000 {
22		device_type = "memory";
23		reg = <0x10000000 0x40000000>;
24	};
25
26	backlight: backlight {
27		compatible = "pwm-backlight";
28		pwms = <&pwm1 0 5000000>;
29		brightness-levels = <0 4 8 16 32 64 128 255>;
30		default-brightness-level = <7>;
31		enable-gpios = <&gpio6 31 GPIO_ACTIVE_HIGH>;
32	};
33
34	reg_2p5v: regulator-2p5v {
35		compatible = "regulator-fixed";
36		regulator-name = "2P5V";
37		regulator-min-microvolt = <2500000>;
38		regulator-max-microvolt = <2500000>;
39		regulator-always-on;
40	};
41
42	reg_3p3v: regulator-3p3v {
43		compatible = "regulator-fixed";
44		regulator-name = "3P3V";
45		regulator-min-microvolt = <3300000>;
46		regulator-max-microvolt = <3300000>;
47		regulator-always-on;
48	};
49
50	reg_usbh1_vbus: regulator-usbh1-vbus {
51		compatible = "regulator-fixed";
52		enable-active-high;
53		gpio = <&gpio1 0 GPIO_ACTIVE_HIGH>;
54		pinctrl-names = "default";
55		pinctrl-0 = <&pinctrl_aristainetos2_usbh1_vbus>;
56		regulator-name = "usb_h1_vbus";
57		regulator-min-microvolt = <5000000>;
58		regulator-max-microvolt = <5000000>;
59	};
60
61	reg_usbotg_vbus: regulator-usbotg-vbus {
62		compatible = "regulator-fixed";
63		enable-active-high;
64		gpio = <&gpio4 15 GPIO_ACTIVE_HIGH>;
65		pinctrl-names = "default";
66		pinctrl-0 = <&pinctrl_aristainetos2_usbotg_vbus>;
67		regulator-name = "usb_otg_vbus";
68		regulator-min-microvolt = <5000000>;
69		regulator-max-microvolt = <5000000>;
70	};
71};
72
73&audmux {
74	pinctrl-names = "default";
75	pinctrl-0 = <&pinctrl_audmux>;
76	status = "okay";
77};
78
79&ecspi2 {
80	cs-gpios = <&gpio2 26 GPIO_ACTIVE_HIGH &gpio2 27 GPIO_ACTIVE_HIGH>;
81	pinctrl-names = "default";
82	pinctrl-0 = <&pinctrl_ecspi2>;
83	status = "okay";
84};
85
86&i2c1 {
87	pinctrl-names = "default";
88	pinctrl-0 = <&pinctrl_i2c1>;
89	status = "okay";
90
91	i2c_pmic0: pmic@58 {
92		compatible = "dlg,da9063";
93		/* the pmic uses addr 0x58 and 0x59 */
94		reg = <0x58>;
95		interrupt-parent = <&gpio1>;
96		interrupts = <04 0x8>;
97
98		regulators {
99			bcore1 {
100				regulator-name = "bcore1";
101				regulator-always-on = <1>;
102				regulator-min-microvolt = <300000>;
103				regulator-max-microvolt = <3300000>;
104			};
105
106			bcore2 {
107				regulator-name = "bcore2";
108				regulator-always-on = <1>;
109				regulator-min-microvolt = <300000>;
110				regulator-max-microvolt = <3300000>;
111			};
112
113			bpro {
114				regulator-name = "bpro";
115				regulator-always-on = <1>;
116				regulator-min-microvolt = <1200000>;
117				regulator-max-microvolt = <1200000>;
118			};
119
120			bprob {
121				regulator-name = "bprob";
122				regulator-always-on = <1>;
123				regulator-min-microvolt = <1200000>;
124				regulator-max-microvolt = <1200000>;
125			};
126
127			bperi {
128				regulator-name = "bperi";
129				regulator-always-on = <1>;
130				regulator-min-microvolt = <300000>;
131				regulator-max-microvolt = <3300000>;
132			};
133
134			bmem {
135				regulator-name = "bmem";
136				regulator-always-on = <1>;
137				regulator-min-microvolt = <300000>;
138				regulator-max-microvolt = <3300000>;
139			};
140
141			ldo2 {
142				regulator-name = "ldo2";
143				regulator-always-on = <1>;
144				regulator-min-microvolt = <300000>;
145				regulator-max-microvolt = <1800000>;
146			};
147
148			ldo3 {
149				regulator-name = "ldo3";
150				regulator-always-on = <1>;
151				regulator-min-microvolt = <300000>;
152				regulator-max-microvolt = <3300000>;
153			};
154
155			ldo4 {
156				regulator-name = "ldo4";
157				regulator-always-on = <1>;
158				regulator-min-microvolt = <300000>;
159				regulator-max-microvolt = <3300000>;
160			};
161
162			ldo5 {
163				regulator-name = "ldo5";
164				regulator-always-on = <1>;
165				regulator-min-microvolt = <300000>;
166				regulator-max-microvolt = <3300000>;
167			};
168
169			ldo6 {
170				regulator-name = "ldo6";
171				regulator-always-on = <1>;
172				regulator-min-microvolt = <300000>;
173				regulator-max-microvolt = <3300000>;
174			};
175
176			ldo7 {
177				regulator-name = "ldo7";
178				regulator-always-on = <1>;
179				regulator-min-microvolt = <300000>;
180				regulator-max-microvolt = <3300000>;
181			};
182
183			ldo8 {
184				regulator-name = "ldo8";
185				regulator-always-on = <1>;
186				regulator-min-microvolt = <300000>;
187				regulator-max-microvolt = <3300000>;
188			};
189
190			ldo9 {
191				regulator-name = "ldo9";
192				regulator-always-on = <1>;
193				regulator-min-microvolt = <300000>;
194				regulator-max-microvolt = <3300000>;
195			};
196
197			ldo10 {
198				regulator-name = "ldo10";
199				regulator-always-on = <1>;
200				regulator-min-microvolt = <300000>;
201				regulator-max-microvolt = <3300000>;
202			};
203
204			ldo11 {
205				regulator-name = "ldo11";
206				regulator-always-on = <1>;
207				regulator-min-microvolt = <300000>;
208				regulator-max-microvolt = <3300000>;
209			};
210
211			bio {
212				regulator-name = "bio";
213				regulator-always-on = <1>;
214				regulator-min-microvolt = <1800000>;
215				regulator-max-microvolt = <1800000>;
216			};
217		};
218	};
219
220	tmp103: tmp103@71 {
221		compatible = "ti,tmp103";
222		reg = <0x71>;
223	};
224};
225
226&i2c2 {
227	pinctrl-names = "default";
228	pinctrl-0 = <&pinctrl_i2c2>;
229	status = "okay";
230};
231
232&i2c3 {
233	pinctrl-names = "default";
234	pinctrl-0 = <&pinctrl_i2c3>;
235	status = "okay";
236
237	expander: tca6416@20 {
238		compatible = "ti,tca6416";
239		reg = <0x20>;
240		#gpio-cells = <2>;
241		gpio-controller;
242
243		env_reset {
244			gpio-hog;
245			input;
246			gpios = <6 GPIO_ACTIVE_LOW>;
247		};
248		boot_rescue {
249			gpio-hog;
250			input;
251			gpios = <7 GPIO_ACTIVE_LOW>;
252		};
253	};
254
255	i2c_eeprom2: eeprom@57{
256		compatible = "atmel,24c64";
257		reg = <0x57>;
258		pagesize = <32>;
259	};
260
261	rtc@68 {
262		compatible = "st,m41t11";
263		reg = <0x68>;
264	};
265};
266
267&i2c4 {
268	pinctrl-names = "default";
269	pinctrl-0 = <&pinctrl_i2c4>;
270	status = "okay";
271
272	i2c_eeprom0: eeprom@50{
273		compatible = "atmel,24c64";
274		reg = <0x50>;
275		pagesize = <32>;
276	};
277
278	i2c_eeprom1: eeprom@57{
279		compatible = "atmel,24c64";
280		reg = <0x57>;
281		pagesize = <32>;
282	};
283};
284
285&gpio2 {
286	tpm_pp {
287		gpio-hog;
288		output-low;
289		gpios = <17 GPIO_ACTIVE_HIGH>;
290	};
291	tpm_reset {
292		gpio-hog;
293		output-high;
294		gpios = <18 GPIO_ACTIVE_HIGH>;
295	};
296};
297
298&gpio6 {
299	spi_bus_ena {
300		gpio-hog;
301		output-high;
302		gpios = <6 GPIO_ACTIVE_HIGH>;
303	};
304};
305
306&gpio7 {
307	bootsel0 {
308		gpio-hog;
309		input;
310		gpios = <6 GPIO_ACTIVE_HIGH>;
311	};
312	bootsel1 {
313		gpio-hog;
314		input;
315		gpios = <7 GPIO_ACTIVE_HIGH>;
316	};
317	bootsel2 {
318		gpio-hog;
319		input;
320		gpios = <1 GPIO_ACTIVE_HIGH>;
321	};
322
323	soft_reset {
324		gpio-hog;
325		output-high;
326		gpios = <13 GPIO_ACTIVE_HIGH>;
327	};
328};
329
330&fec {
331	pinctrl-names = "default";
332	pinctrl-0 = <&pinctrl_enet>;
333	phy-mode = "rgmii";
334	txd0-skew-ps = <0>;
335	txd1-skew-ps = <0>;
336	txd2-skew-ps = <0>;
337	txd3-skew-ps = <0>;
338	status = "okay";
339};
340
341&pcie {
342	reset-gpio = <&gpio2 16 GPIO_ACTIVE_LOW>;
343	status = "okay";
344};
345
346&pwm1 {
347	pinctrl-names = "default";
348	pinctrl-0 = <&pinctrl_pwm1>;
349	status = "okay";
350};
351
352&uart1 {
353	pinctrl-names = "default";
354	pinctrl-0 = <&pinctrl_uart1>;
355	uart-has-rtscts;
356	status = "okay";
357};
358
359&uart2 {
360	pinctrl-names = "default";
361	pinctrl-0 = <&pinctrl_uart2>;
362	status = "okay";
363};
364
365&uart3 {
366	pinctrl-names = "default";
367	pinctrl-0 = <&pinctrl_uart3>;
368	uart-has-rtscts;
369	status = "okay";
370};
371
372&uart4 {
373	pinctrl-names = "default";
374	pinctrl-0 = <&pinctrl_uart4>;
375	status = "okay";
376};
377
378&usbh1 {
379	vbus-supply = <&reg_usbh1_vbus>;
380	dr_mode = "host";
381	status = "okay";
382};
383
384&usbotg {
385	vbus-supply = <&reg_usbotg_vbus>;
386	pinctrl-names = "default";
387	pinctrl-0 = <&pinctrl_usbotg>;
388	disable-over-current;
389	dr_mode = "host";   /* fixed configuration, ID pin not checked */
390	status = "okay";
391};
392
393&iomuxc {
394	pinctrl-names = "default";
395	pinctrl-0 = <&pinctrl_gpio>;
396
397	pinctrl_audmux: audmux {
398		fsl,pins = <
399			MX6QDL_PAD_CSI0_DAT7__AUD3_RXD  0x1b0b0
400			MX6QDL_PAD_CSI0_DAT4__AUD3_TXC  0x1b0b0
401			MX6QDL_PAD_CSI0_DAT5__AUD3_TXD  0x1b0b0
402			MX6QDL_PAD_CSI0_DAT6__AUD3_TXFS 0x1b0b0
403		>;
404	};
405
406	pinctrl_ecspi2: ecspi2grp {
407		fsl,pins = <
408			MX6QDL_PAD_EIM_OE__ECSPI2_MISO  0x100b1
409			MX6QDL_PAD_EIM_CS0__ECSPI2_SCLK 0x100b1
410			MX6QDL_PAD_EIM_CS1__ECSPI2_MOSI 0x100b1
411			MX6QDL_PAD_EIM_RW__GPIO2_IO26   0x100b1 /* SS0# */
412			MX6QDL_PAD_EIM_LBA__GPIO2_IO27  0x100b1 /* SS1# */
413		>;
414	};
415
416	pinctrl_enet: enetgrp {
417		fsl,pins = <
418			MX6QDL_PAD_ENET_MDIO__ENET_MDIO		0x1b0b0
419			MX6QDL_PAD_ENET_MDC__ENET_MDC		0x1b0b0
420			MX6QDL_PAD_RGMII_TXC__RGMII_TXC		0x1b0b0
421			MX6QDL_PAD_RGMII_TD0__RGMII_TD0		0x1b0b0
422			MX6QDL_PAD_RGMII_TD1__RGMII_TD1		0x1b0b0
423			MX6QDL_PAD_RGMII_TD2__RGMII_TD2		0x1b0b0
424			MX6QDL_PAD_RGMII_TD3__RGMII_TD3		0x1b0b0
425			MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL	0x1b0b0
426			MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK	0x400100b0
427			MX6QDL_PAD_RGMII_RXC__RGMII_RXC		0x1b0b0
428			MX6QDL_PAD_RGMII_RD0__RGMII_RD0		0x1b0b0
429			MX6QDL_PAD_RGMII_RD1__RGMII_RD1		0x1b0b0
430			MX6QDL_PAD_RGMII_RD2__RGMII_RD2		0x1b0b0
431			MX6QDL_PAD_RGMII_RD3__RGMII_RD3		0x1b0b0
432			MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL	0x1b0b0
433			/* make sure pin is GPIO and not ENET_REF_CLK */
434			MX6QDL_PAD_GPIO_16__GPIO7_IO11	0x1a0b0
435		>;
436	};
437
438	pinctrl_i2c1: i2c1grp {
439		fsl,pins = <
440			MX6QDL_PAD_CSI0_DAT8__I2C1_SDA 0x4001b8b1
441			MX6QDL_PAD_CSI0_DAT9__I2C1_SCL 0x4001b8b1
442		>;
443	};
444
445	pinctrl_i2c2: i2c2grp {
446		fsl,pins = <
447			MX6QDL_PAD_KEY_COL3__I2C2_SCL 0x4001b8b1
448			MX6QDL_PAD_KEY_ROW3__I2C2_SDA 0x4001b8b1
449		>;
450	};
451
452	pinctrl_i2c3: i2c3grp {
453		fsl,pins = <
454			MX6QDL_PAD_GPIO_5__I2C3_SCL 0x4001b8b1
455			MX6QDL_PAD_GPIO_6__I2C3_SDA 0x4001b8b1
456		>;
457	};
458
459	pinctrl_i2c4: i2c4grp {
460		fsl,pins = <
461			MX6QDL_PAD_GPIO_7__I2C4_SCL 0x4001b8b1
462			MX6QDL_PAD_GPIO_8__I2C4_SDA 0x4001b8b1
463		>;
464	};
465
466	pinctrl_pwm1: pwm1grp {
467		fsl,pins = <
468			MX6QDL_PAD_GPIO_9__PWM1_OUT	0x1b0b0
469			/* backlight enable */
470			MX6QDL_PAD_EIM_BCLK__GPIO6_IO31	0x1b0b0
471		>;
472	};
473
474	pinctrl_uart1: uart1grp {
475		fsl,pins = <
476			MX6QDL_PAD_CSI0_DAT10__UART1_TX_DATA	0x1b0b1
477			MX6QDL_PAD_CSI0_DAT11__UART1_RX_DATA	0x1b0b1
478			MX6QDL_PAD_EIM_D20__UART1_RTS_B		0x1b0b1
479			MX6QDL_PAD_EIM_D19__UART1_CTS_B		0x1b0b1
480		>;
481	};
482
483	pinctrl_uart2: uart2grp {
484		fsl,pins = <
485			MX6QDL_PAD_EIM_D26__UART2_TX_DATA 0x1b0b1
486			MX6QDL_PAD_EIM_D27__UART2_RX_DATA 0x1b0b1
487		>;
488	};
489
490	pinctrl_uart3: uart3grp {
491		fsl,pins = <
492			MX6QDL_PAD_EIM_D24__UART3_TX_DATA 0x1b0b1
493			MX6QDL_PAD_EIM_D25__UART3_RX_DATA 0x1b0b1
494			MX6QDL_PAD_EIM_D31__UART3_RTS_B	  0x1b0b1
495			MX6QDL_PAD_EIM_D23__UART3_CTS_B	  0x1b0b1
496		>;
497	};
498
499	pinctrl_uart4: uart4grp {
500		fsl,pins = <
501			MX6QDL_PAD_KEY_COL0__UART4_TX_DATA 0x1b0b1
502			MX6QDL_PAD_KEY_ROW0__UART4_RX_DATA 0x1b0b1
503		>;
504	};
505
506	pinctrl_aristainetos2_usbh1_vbus: aristainetos-usbh1-vbus {
507		fsl,pins = <MX6QDL_PAD_GPIO_0__GPIO1_IO00 0x400130b0>;
508	};
509
510	pinctrl_aristainetos2_usbotg_vbus: aristainetos-usbotg-vbus {
511		fsl,pins = <MX6QDL_PAD_KEY_ROW4__GPIO4_IO15 0x400130b0>;
512	};
513};
514