1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright 2018-2019 Purism SPC
4 */
5
6/dts-v1/;
7
8#include "dt-bindings/input/input.h"
9#include <dt-bindings/interrupt-controller/irq.h>
10#include <dt-bindings/leds/common.h>
11#include "dt-bindings/pwm/pwm.h"
12#include "dt-bindings/usb/pd.h"
13#include "imx8mq.dtsi"
14
15/ {
16	model = "Purism Librem 5 devkit";
17	compatible = "purism,librem5-devkit", "fsl,imx8mq";
18
19	backlight_dsi: backlight-dsi {
20		compatible = "pwm-backlight";
21		/* 200 Hz for the PAM2841 */
22		pwms = <&pwm1 0 5000000 0>;
23		brightness-levels = <0 100>;
24		num-interpolated-steps = <100>;
25		/* Default brightness level (index into the array defined by */
26		/* the "brightness-levels" property) */
27		default-brightness-level = <0>;
28		power-supply = <&reg_22v4_p>;
29	};
30
31	chosen {
32		stdout-path = &uart1;
33	};
34
35	gpio-keys {
36		compatible = "gpio-keys";
37		pinctrl-names = "default";
38		pinctrl-0 = <&pinctrl_gpio_keys>;
39
40		button-1 {
41			label = "VOL_UP";
42			gpios = <&gpio4 21 GPIO_ACTIVE_LOW>;
43			wakeup-source;
44			linux,code = <KEY_VOLUMEUP>;
45		};
46
47		button-2 {
48			label = "VOL_DOWN";
49			gpios = <&gpio4 22 GPIO_ACTIVE_LOW>;
50			wakeup-source;
51			linux,code = <KEY_VOLUMEDOWN>;
52		};
53
54		button-3 {
55			label = "WWAN_WAKE";
56			gpios = <&gpio3 8 GPIO_ACTIVE_LOW>;
57			interrupt-parent = <&gpio3>;
58			interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
59			wakeup-source;
60			linux,code = <KEY_PHONE>;
61		};
62	};
63
64	leds {
65		compatible = "pwm-leds";
66
67		led-1 {
68			function = LED_FUNCTION_STATUS;
69			color = <LED_COLOR_ID_RED>;
70			max-brightness = <248>;
71			pwms = <&pwm2 0 50000 0>;
72		};
73	};
74
75	pmic_osc: clock-pmic {
76		compatible = "fixed-clock";
77		#clock-cells = <0>;
78		clock-frequency = <32768>;
79		clock-output-names = "pmic_osc";
80	};
81
82	reg_1v8_p: regulator-1v8-p {
83		compatible = "regulator-fixed";
84		regulator-name = "1v8_p";
85		regulator-min-microvolt = <1800000>;
86		regulator-max-microvolt = <1800000>;
87		vin-supply = <&reg_pwr_en>;
88	};
89
90	reg_2v8_p: regulator-2v8-p {
91		compatible = "regulator-fixed";
92		regulator-name = "2v8_p";
93		regulator-min-microvolt = <2800000>;
94		regulator-max-microvolt = <2800000>;
95		vin-supply = <&reg_pwr_en>;
96	};
97
98	reg_3v3_p: regulator-3v3-p {
99		compatible = "regulator-fixed";
100		regulator-name = "3v3_p";
101		regulator-min-microvolt = <3300000>;
102		regulator-max-microvolt = <3300000>;
103		vin-supply = <&reg_pwr_en>;
104
105		regulator-state-mem {
106			regulator-on-in-suspend;
107		};
108	};
109
110	reg_5v_p: regulator-5v-p {
111		compatible = "regulator-fixed";
112		regulator-name = "5v_p";
113		regulator-min-microvolt = <5000000>;
114		regulator-max-microvolt = <5000000>;
115		vin-supply = <&reg_pwr_en>;
116
117		regulator-state-mem {
118			regulator-on-in-suspend;
119		};
120	};
121
122	reg_22v4_p: regulator-22v4-p  {
123		compatible = "regulator-fixed";
124		regulator-name = "22v4_P";
125		regulator-min-microvolt = <22400000>;
126		regulator-max-microvolt = <22400000>;
127		vin-supply = <&reg_pwr_en>;
128	};
129
130	reg_pwr_en: regulator-pwr-en {
131		compatible = "regulator-fixed";
132		pinctrl-names = "default";
133		pinctrl-0 = <&pinctrl_pwr_en>;
134		regulator-name = "PWR_EN";
135		regulator-min-microvolt = <3300000>;
136		regulator-max-microvolt = <3300000>;
137		gpio = <&gpio1 8 GPIO_ACTIVE_HIGH>;
138		enable-active-high;
139		regulator-always-on;
140	};
141
142	reg_usdhc2_vmmc: regulator-usdhc2-vmmc {
143		compatible = "regulator-fixed";
144		pinctrl-names = "default";
145		pinctrl-0 = <&pinctrl_usdhc2_pwr>;
146		regulator-name = "VSD_3V3";
147		regulator-min-microvolt = <3300000>;
148		regulator-max-microvolt = <3300000>;
149		gpio = <&gpio2 19 GPIO_ACTIVE_HIGH>;
150		enable-active-high;
151		regulator-always-on;
152	};
153
154	wwan_codec: sound-wwan-codec {
155		compatible = "option,gtm601";
156		#sound-dai-cells = <0>;
157	};
158
159	mic_mux: mic-mux {
160		compatible = "simple-audio-mux";
161		pinctrl-names = "default";
162		pinctrl-0 = <&pinctrl_micsel>;
163		mux-gpios = <&gpio5 5 GPIO_ACTIVE_LOW>;
164		sound-name-prefix = "Mic Mux";
165	};
166
167	sound {
168		compatible = "simple-audio-card";
169		pinctrl-names = "default";
170		pinctrl-0 = <&pinctrl_hpdet>;
171		simple-audio-card,aux-devs = <&speaker_amp>, <&mic_mux>;
172		simple-audio-card,name = "Librem 5 Devkit";
173		simple-audio-card,format = "i2s";
174		simple-audio-card,widgets =
175			"Microphone", "Builtin Microphone",
176			"Microphone", "Headset Microphone",
177			"Headphone", "Headphones",
178			"Speaker", "Builtin Speaker";
179		simple-audio-card,routing =
180			"MIC_IN", "Mic Mux OUT",
181			"Mic Mux IN1", "Headset Microphone",
182			"Mic Mux IN2", "Builtin Microphone",
183			"Mic Mux OUT", "Mic Bias",
184			"Headphones", "HP_OUT",
185			"Builtin Speaker", "Speaker Amp OUTR",
186			"Speaker Amp INR", "LINE_OUT";
187		simple-audio-card,hp-det-gpio = <&gpio3 20 GPIO_ACTIVE_HIGH>;
188
189		simple-audio-card,cpu {
190			sound-dai = <&sai2>;
191		};
192
193		simple-audio-card,codec {
194			sound-dai = <&sgtl5000>;
195			clocks = <&clk IMX8MQ_CLK_SAI2_ROOT>;
196			frame-master;
197			bitclock-master;
198		};
199	};
200
201	sound-wwan {
202		compatible = "simple-audio-card";
203		simple-audio-card,name = "SIMCom SIM7100";
204		simple-audio-card,format = "dsp_a";
205
206		simple-audio-card,cpu {
207			sound-dai = <&sai6>;
208		};
209
210		telephony_link_master: simple-audio-card,codec {
211			sound-dai = <&wwan_codec>;
212			frame-master;
213			bitclock-master;
214		};
215	};
216
217	speaker_amp: speaker-amp {
218		compatible = "simple-audio-amplifier";
219		pinctrl-names = "default";
220		pinctrl-0 = <&pinctrl_spkamp>;
221		VCC-supply = <&reg_3v3_p>;
222		sound-name-prefix = "Speaker Amp";
223		enable-gpios = <&gpio5 3 GPIO_ACTIVE_HIGH>;
224	};
225
226	vibrator {
227		compatible = "gpio-vibrator";
228		pinctrl-names = "default";
229		pinctrl-0 = <&pinctrl_haptic>;
230	        enable-gpios = <&gpio5 4 GPIO_ACTIVE_LOW>;
231		vcc-supply = <&reg_3v3_p>;
232	};
233
234	wifi_pwr_en: regulator-wifi-en {
235		compatible = "regulator-fixed";
236		pinctrl-names = "default";
237		pinctrl-0 = <&pinctrl_wifi_pwr_en>;
238		regulator-name = "WIFI_EN";
239		regulator-min-microvolt = <3300000>;
240		regulator-max-microvolt = <3300000>;
241		gpio = <&gpio3 5 GPIO_ACTIVE_HIGH>;
242		enable-active-high;
243		regulator-always-on;
244	};
245};
246
247&A53_0 {
248	cpu-supply = <&buck2_reg>;
249};
250
251&A53_1 {
252	cpu-supply = <&buck2_reg>;
253};
254
255&A53_2 {
256	cpu-supply = <&buck2_reg>;
257};
258
259&A53_3 {
260	cpu-supply = <&buck2_reg>;
261};
262
263&dphy {
264	status = "okay";
265};
266
267&fec1 {
268	pinctrl-names = "default";
269	pinctrl-0 = <&pinctrl_fec1>;
270	phy-mode = "rgmii-id";
271	phy-handle = <&ethphy0>;
272	fsl,magic-packet;
273	phy-supply = <&reg_3v3_p>;
274	status = "okay";
275
276	mdio {
277		#address-cells = <1>;
278		#size-cells = <0>;
279
280		ethphy0: ethernet-phy@1 {
281			compatible = "ethernet-phy-ieee802.3-c22";
282			reg = <1>;
283		};
284	};
285};
286
287&i2c1 {
288	clock-frequency = <100000>;
289	pinctrl-names = "default";
290	pinctrl-0 = <&pinctrl_i2c1>;
291	status = "okay";
292
293	pmic: pmic@4b {
294		compatible = "rohm,bd71837";
295		reg = <0x4b>;
296		pinctrl-names = "default";
297		pinctrl-0 = <&pinctrl_pmic>;
298		clocks = <&pmic_osc>;
299		clock-names = "osc";
300		#clock-cells = <0>;
301		clock-output-names = "pmic_clk";
302		interrupt-parent = <&gpio1>;
303		interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
304		rohm,reset-snvs-powered;
305
306		regulators {
307			buck1_reg: BUCK1 {
308				regulator-name = "buck1";
309				regulator-min-microvolt = <700000>;
310				regulator-max-microvolt = <1300000>;
311				regulator-boot-on;
312				regulator-always-on;
313				regulator-ramp-delay = <1250>;
314				rohm,dvs-run-voltage = <900000>;
315				rohm,dvs-idle-voltage = <850000>;
316				rohm,dvs-suspend-voltage = <800000>;
317			};
318
319			buck2_reg: BUCK2 {
320				regulator-name = "buck2";
321				regulator-min-microvolt = <700000>;
322				regulator-max-microvolt = <1300000>;
323				regulator-boot-on;
324				regulator-ramp-delay = <1250>;
325				rohm,dvs-run-voltage = <1000000>;
326				rohm,dvs-idle-voltage = <900000>;
327				regulator-always-on;
328			};
329
330			buck3_reg: BUCK3 {
331				regulator-name = "buck3";
332				regulator-min-microvolt = <700000>;
333				regulator-max-microvolt = <1300000>;
334				regulator-boot-on;
335				rohm,dvs-run-voltage = <900000>;
336			};
337
338			buck4_reg: BUCK4 {
339				regulator-name = "buck4";
340				regulator-min-microvolt = <700000>;
341				regulator-max-microvolt = <1300000>;
342				rohm,dvs-run-voltage = <1000000>;
343			};
344
345			buck5_reg: BUCK5 {
346				regulator-name = "buck5";
347				regulator-min-microvolt = <700000>;
348				regulator-max-microvolt = <1350000>;
349				regulator-boot-on;
350				regulator-always-on;
351			};
352
353			buck6_reg: BUCK6 {
354				regulator-name = "buck6";
355				regulator-min-microvolt = <3000000>;
356				regulator-max-microvolt = <3300000>;
357				regulator-boot-on;
358				regulator-always-on;
359			};
360
361			buck7_reg: BUCK7 {
362				regulator-name = "buck7";
363				regulator-min-microvolt = <1605000>;
364				regulator-max-microvolt = <1995000>;
365				regulator-boot-on;
366				regulator-always-on;
367			};
368
369			buck8_reg: BUCK8 {
370				regulator-name = "buck8";
371				regulator-min-microvolt = <800000>;
372				regulator-max-microvolt = <1400000>;
373				regulator-boot-on;
374				regulator-always-on;
375			};
376
377			ldo1_reg: LDO1 {
378				regulator-name = "ldo1";
379				regulator-min-microvolt = <3000000>;
380				regulator-max-microvolt = <3300000>;
381				regulator-boot-on;
382				/* leave on for snvs power button */
383				regulator-always-on;
384			};
385
386			ldo2_reg: LDO2 {
387				regulator-name = "ldo2";
388				regulator-min-microvolt = <900000>;
389				regulator-max-microvolt = <900000>;
390				regulator-boot-on;
391				/* leave on for snvs power button */
392				regulator-always-on;
393			};
394
395			ldo3_reg: LDO3 {
396				regulator-name = "ldo3";
397				regulator-min-microvolt = <1800000>;
398				regulator-max-microvolt = <3300000>;
399				regulator-boot-on;
400				regulator-always-on;
401			};
402
403			ldo4_reg: LDO4 {
404				regulator-name = "ldo4";
405				regulator-min-microvolt = <900000>;
406				regulator-max-microvolt = <1800000>;
407				regulator-boot-on;
408				regulator-always-on;
409			};
410
411			ldo5_reg: LDO5 {
412				regulator-name = "ldo5";
413				regulator-min-microvolt = <1800000>;
414				regulator-max-microvolt = <3300000>;
415				regulator-always-on;
416			};
417
418			ldo6_reg: LDO6 {
419				regulator-name = "ldo6";
420				regulator-min-microvolt = <900000>;
421				regulator-max-microvolt = <1800000>;
422				regulator-boot-on;
423				regulator-always-on;
424			};
425
426			ldo7_reg: LDO7 {
427				regulator-name = "ldo7";
428				regulator-min-microvolt = <1800000>;
429				regulator-max-microvolt = <3300000>;
430				regulator-boot-on;
431				regulator-always-on;
432			};
433		};
434	};
435
436	typec_ptn5100: usb-typec@52 {
437		compatible = "nxp,ptn5110";
438		reg = <0x52>;
439		pinctrl-names = "default";
440		pinctrl-0 = <&pinctrl_typec>;
441		interrupt-parent = <&gpio3>;
442		interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
443
444		connector {
445			compatible = "usb-c-connector";
446			label = "USB-C";
447			data-role = "dual";
448			power-role = "dual";
449			try-power-role = "sink";
450			source-pdos = <PDO_FIXED(5000, 2000,
451				PDO_FIXED_USB_COMM |
452				PDO_FIXED_DUAL_ROLE |
453				PDO_FIXED_DATA_SWAP )>;
454			sink-pdos = <PDO_FIXED(5000, 3500, PDO_FIXED_USB_COMM |
455				PDO_FIXED_DUAL_ROLE |
456				PDO_FIXED_DATA_SWAP )
457			     PDO_VAR(5000, 5000, 3500)>;
458			op-sink-microwatt = <10000000>;
459
460			ports {
461				#address-cells = <1>;
462				#size-cells = <0>;
463
464				port@0 {
465					reg = <0>;
466
467					usb_con_hs: endpoint {
468						remote-endpoint = <&typec_hs>;
469					};
470				};
471
472				port@1 {
473					reg = <1>;
474
475					usb_con_ss: endpoint {
476						remote-endpoint = <&typec_ss>;
477					};
478				};
479			};
480		};
481	};
482
483	rtc@68 {
484		compatible = "microcrystal,rv4162";
485		reg = <0x68>;
486		pinctrl-names = "default";
487		pinctrl-0 = <&pinctrl_rtc>;
488		interrupt-parent = <&gpio4>;
489		interrupts = <29 IRQ_TYPE_LEVEL_LOW>;
490	};
491
492	charger@6b { /* bq25896 */
493		compatible = "ti,bq25890";
494		reg = <0x6b>;
495		pinctrl-names = "default";
496		pinctrl-0 = <&pinctrl_charger>;
497		interrupt-parent = <&gpio3>;
498		interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
499		ti,battery-regulation-voltage = <4192000>; /* 4.192V */
500		ti,charge-current = <1600000>; /* 1.6A */
501		ti,termination-current = <66000>;  /* 66mA */
502		ti,precharge-current = <130000>; /* 130mA */
503		ti,minimum-sys-voltage = <3000000>; /* 3V */
504		ti,boost-voltage = <5000000>; /* 5V */
505		ti,boost-max-current = <50000>; /* 50mA */
506	};
507};
508
509&i2c3 {
510	clock-frequency = <100000>;
511	pinctrl-names = "default";
512	pinctrl-0 = <&pinctrl_i2c3>;
513	status = "okay";
514
515	magnetometer@1e	{
516		compatible = "st,lsm9ds1-magn";
517		reg = <0x1e>;
518		pinctrl-names = "default";
519		pinctrl-0 = <&pinctrl_imu>;
520		interrupt-parent = <&gpio3>;
521		interrupts = <19 IRQ_TYPE_LEVEL_HIGH>;
522		vdd-supply = <&reg_3v3_p>;
523		vddio-supply = <&reg_3v3_p>;
524	};
525
526	sgtl5000: audio-codec@a {
527		compatible = "fsl,sgtl5000";
528		clocks = <&clk IMX8MQ_CLK_SAI2_ROOT>;
529		assigned-clocks = <&clk IMX8MQ_CLK_SAI2>;
530		assigned-clock-parents = <&clk IMX8MQ_AUDIO_PLL1_OUT>;
531		assigned-clock-rates = <24576000>;
532		#sound-dai-cells = <0>;
533		reg = <0x0a>;
534		VDDD-supply = <&reg_1v8_p>;
535		VDDIO-supply = <&reg_3v3_p>;
536		VDDA-supply = <&reg_3v3_p>;
537	};
538
539	touchscreen@5d {
540		compatible = "goodix,gt5688";
541		reg = <0x5d>;
542		pinctrl-names = "default";
543		pinctrl-0 = <&pinctrl_ts>;
544		interrupt-parent = <&gpio3>;
545		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
546		reset-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
547		irq-gpios = <&gpio3 0 GPIO_ACTIVE_HIGH>;
548		touchscreen-size-x = <720>;
549		touchscreen-size-y = <1440>;
550		AVDD28-supply = <&reg_2v8_p>;
551		VDDIO-supply = <&reg_1v8_p>;
552	};
553
554	proximity-sensor@60 {
555		compatible = "vishay,vcnl4040";
556		reg = <0x60>;
557		pinctrl-0 = <&pinctrl_prox>;
558	};
559
560	accel-gyro@6a {
561		compatible = "st,lsm9ds1-imu";
562		reg = <0x6a>;
563		vdd-supply = <&reg_3v3_p>;
564		vddio-supply = <&reg_3v3_p>;
565		mount-matrix = "1",  "0",  "0",
566			       "0",  "1",  "0",
567			       "0",  "0", "-1";
568	};
569};
570
571&iomuxc {
572	pinctrl_bl: blgrp {
573		fsl,pins = <
574			MX8MQ_IOMUXC_GPIO1_IO01_PWM1_OUT	0x6 /* DSI_BL_PWM */
575		>;
576	};
577
578	pinctrl_bt: btgrp {
579		fsl,pins = <
580			MX8MQ_IOMUXC_NAND_DATA05_GPIO3_IO11	0x16 /* nBT_DISABLE */
581			MX8MQ_IOMUXC_NAND_DATA01_GPIO3_IO7	0x10 /* BT_HOST_WAKE */
582		>;
583	};
584
585	pinctrl_charger: chargergrp {
586		fsl,pins = <
587			MX8MQ_IOMUXC_SAI5_MCLK_GPIO3_IO25	0x80 /* CHRG_nINT */
588		>;
589	};
590
591	pinctrl_fec1: fec1grp {
592		fsl,pins = <
593			MX8MQ_IOMUXC_ENET_MDC_ENET1_MDC			0x3
594			MX8MQ_IOMUXC_ENET_MDIO_ENET1_MDIO		0x3
595			MX8MQ_IOMUXC_ENET_TD3_ENET1_RGMII_TD3		0x1f
596			MX8MQ_IOMUXC_ENET_TD2_ENET1_RGMII_TD2		0x1f
597			MX8MQ_IOMUXC_ENET_TD1_ENET1_RGMII_TD1		0x1f
598			MX8MQ_IOMUXC_ENET_TD0_ENET1_RGMII_TD0		0x1f
599			MX8MQ_IOMUXC_ENET_RD3_ENET1_RGMII_RD3		0x91
600			MX8MQ_IOMUXC_ENET_RD2_ENET1_RGMII_RD2		0x91
601			MX8MQ_IOMUXC_ENET_RD1_ENET1_RGMII_RD1		0x91
602			MX8MQ_IOMUXC_ENET_RD0_ENET1_RGMII_RD0		0x91
603			MX8MQ_IOMUXC_ENET_TXC_ENET1_RGMII_TXC		0x1f
604			MX8MQ_IOMUXC_ENET_RXC_ENET1_RGMII_RXC		0x91
605			MX8MQ_IOMUXC_ENET_RX_CTL_ENET1_RGMII_RX_CTL	0x91
606			MX8MQ_IOMUXC_ENET_TX_CTL_ENET1_RGMII_TX_CTL	0x1f
607			MX8MQ_IOMUXC_GPIO1_IO09_GPIO1_IO9		0x19
608			MX8MQ_IOMUXC_GPIO1_IO15_CCMSRCGPCMIX_CLKO2      0x1f
609		>;
610	};
611
612	pinctrl_ts: tsgrp {
613		fsl,pins = <
614			MX8MQ_IOMUXC_NAND_ALE_GPIO3_IO0		0x16  /* TOUCH INT */
615			MX8MQ_IOMUXC_GPIO1_IO05_GPIO1_IO5	0x19  /* TOUCH RST */
616		>;
617	};
618
619	pinctrl_pwm_led: pwmledgrp {
620		fsl,pins = <
621			MX8MQ_IOMUXC_GPIO1_IO13_PWM2_OUT	0x16
622		>;
623	};
624
625	pinctrl_gpio_keys: gpiokeygrp {
626		fsl,pins = <
627			MX8MQ_IOMUXC_SAI2_RXFS_GPIO4_IO21	0x16
628			MX8MQ_IOMUXC_SAI2_RXC_GPIO4_IO22	0x16
629			MX8MQ_IOMUXC_NAND_DATA02_GPIO3_IO8	0x80   /* nWoWWAN */
630		>;
631	};
632
633	pinctrl_haptic: hapticgrp {
634		fsl,pins = <
635			MX8MQ_IOMUXC_SPDIF_RX_GPIO5_IO4		0xc6   /* nHAPTIC */
636		>;
637	};
638
639	pinctrl_hpdet: hpdetgrp {
640		fsl,pins = <
641			MX8MQ_IOMUXC_SAI5_RXC_GPIO3_IO20	0xC0   /* HP_DET */
642		>;
643	};
644
645	pinctrl_i2c1: i2c1grp {
646		fsl,pins = <
647			MX8MQ_IOMUXC_I2C1_SCL_I2C1_SCL		0x4000001f
648			MX8MQ_IOMUXC_I2C1_SDA_I2C1_SDA		0x4000001f
649		>;
650	};
651
652	pinctrl_i2c3: i2c3grp {
653		fsl,pins = <
654			MX8MQ_IOMUXC_I2C3_SCL_I2C3_SCL		0x4000001f
655			MX8MQ_IOMUXC_I2C3_SDA_I2C3_SDA		0x4000001f
656		>;
657	};
658
659	pinctrl_imu: imugrp {
660		fsl,pins = <
661			MX8MQ_IOMUXC_SAI5_RXFS_GPIO3_IO19	0x8  /* IMU_INT */
662		>;
663	};
664
665	pinctrl_micsel: micselgrp {
666		fsl,pins = <
667			MX8MQ_IOMUXC_SPDIF_EXT_CLK_GPIO5_IO5	0xc6  /* MIC_SEL */
668		>;
669	};
670
671	pinctrl_spkamp: spkampgrp {
672		fsl,pins = <
673			MX8MQ_IOMUXC_SPDIF_TX_GPIO5_IO3		0x81  /* MUTE */
674		>;
675	};
676
677	pinctrl_pmic: pmicgrp {
678		fsl,pins = <
679			MX8MQ_IOMUXC_GPIO1_IO03_GPIO1_IO3	0x80  /* PMIC intr */
680		>;
681	};
682
683	pinctrl_prox: proxgrp {
684		fsl,pins = <
685			MX8MQ_IOMUXC_GPIO1_IO12_GPIO1_IO12	0x80  /* prox intr */
686		>;
687	};
688
689	pinctrl_pwr_en: pwrengrp {
690		fsl,pins = <
691			MX8MQ_IOMUXC_GPIO1_IO08_GPIO1_IO8	0x06
692		>;
693	};
694
695	pinctrl_rtc: rtcgrp {
696		fsl,pins = <
697			MX8MQ_IOMUXC_SAI3_RXC_GPIO4_IO29	0x80  /* RTC intr */
698		>;
699	};
700
701	pinctrl_sai2: sai2grp {
702		fsl,pins = <
703			MX8MQ_IOMUXC_SAI2_TXFS_SAI2_TX_SYNC	0xd6
704			MX8MQ_IOMUXC_SAI2_TXC_SAI2_TX_BCLK	0xd6
705			MX8MQ_IOMUXC_SAI2_TXD0_SAI2_TX_DATA0	0xd6
706			MX8MQ_IOMUXC_SAI2_RXD0_SAI2_RX_DATA0	0xd6
707			MX8MQ_IOMUXC_SAI2_MCLK_SAI2_MCLK	0xd6
708		>;
709	};
710
711	pinctrl_sai6: sai6grp {
712		fsl,pins = <
713			MX8MQ_IOMUXC_SAI1_RXD5_SAI6_RX_DATA0	0xd6
714			MX8MQ_IOMUXC_SAI1_RXD6_SAI6_RX_SYNC	0xd6
715			MX8MQ_IOMUXC_SAI1_TXD4_SAI6_RX_BCLK     0xd6
716			MX8MQ_IOMUXC_SAI1_TXD5_SAI6_TX_DATA0	0xd6
717		>;
718	};
719
720	pinctrl_typec: typecgrp {
721		fsl,pins = <
722			MX8MQ_IOMUXC_NAND_DATA06_GPIO3_IO12		0x16
723			MX8MQ_IOMUXC_NAND_CE0_B_GPIO3_IO1		0x80
724		>;
725	};
726
727	pinctrl_uart1: uart1grp {
728		fsl,pins = <
729			MX8MQ_IOMUXC_UART1_RXD_UART1_DCE_RX		0x49
730			MX8MQ_IOMUXC_UART1_TXD_UART1_DCE_TX		0x49
731		>;
732	};
733
734	pinctrl_uart2: uart2grp {
735		fsl,pins = <
736			MX8MQ_IOMUXC_UART2_TXD_UART2_DCE_TX		0x49
737			MX8MQ_IOMUXC_UART2_RXD_UART2_DCE_RX		0x49
738			MX8MQ_IOMUXC_UART4_RXD_UART2_DCE_CTS_B		0x49
739			MX8MQ_IOMUXC_UART4_TXD_UART2_DCE_RTS_B		0x49
740		>;
741	};
742
743	pinctrl_uart3: uart3grp {
744		fsl,pins = <
745			MX8MQ_IOMUXC_UART3_RXD_UART3_DCE_RX		0x49
746			MX8MQ_IOMUXC_UART3_TXD_UART3_DCE_TX		0x49
747		>;
748	};
749
750	pinctrl_uart4: uart4grp {
751		fsl,pins = <
752			MX8MQ_IOMUXC_ECSPI2_SCLK_UART4_DCE_RX		0x49
753			MX8MQ_IOMUXC_ECSPI2_MOSI_UART4_DCE_TX		0x49
754			MX8MQ_IOMUXC_ECSPI2_MISO_UART4_DCE_CTS_B	0x49
755			MX8MQ_IOMUXC_ECSPI2_SS0_UART4_DCE_RTS_B		0x49
756			MX8MQ_IOMUXC_GPIO1_IO00_ANAMIX_REF_CLK_32K	0x49
757		>;
758	};
759
760	pinctrl_usdhc1: usdhc1grp {
761		fsl,pins = <
762			MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK			0x83
763			MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD			0xc3
764			MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0		0xc3
765			MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1		0xc3
766			MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2		0xc3
767			MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3		0xc3
768			MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4		0xc3
769			MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5		0xc3
770			MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6		0xc3
771			MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7		0xc3
772			MX8MQ_IOMUXC_SD1_STROBE_USDHC1_STROBE		0x83
773			MX8MQ_IOMUXC_SD1_RESET_B_USDHC1_RESET_B		0xc1
774		>;
775	};
776
777	pinctrl_usdhc1_100mhz: usdhc1-100mhzgrp {
778		fsl,pins = <
779			MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK			0x8d
780			MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD			0xcd
781			MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0		0xcd
782			MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1		0xcd
783			MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2		0xcd
784			MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3		0xcd
785			MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4		0xcd
786			MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5		0xcd
787			MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6		0xcd
788			MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7		0xcd
789			MX8MQ_IOMUXC_SD1_STROBE_USDHC1_STROBE		0x8d
790			MX8MQ_IOMUXC_SD1_RESET_B_USDHC1_RESET_B		0xc1
791		>;
792	};
793
794	pinctrl_usdhc1_200mhz: usdhc1-200mhzgrp {
795		fsl,pins = <
796			MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK			0x9f
797			MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD			0xdf
798			MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0		0xdf
799			MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1		0xdf
800			MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2		0xdf
801			MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3		0xdf
802			MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4		0xdf
803			MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5		0xdf
804			MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6		0xdf
805			MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7		0xdf
806			MX8MQ_IOMUXC_SD1_STROBE_USDHC1_STROBE		0x9f
807			MX8MQ_IOMUXC_SD1_RESET_B_USDHC1_RESET_B		0xc1
808		>;
809	};
810
811	pinctrl_usdhc2_pwr: usdhc2pwrgrp {
812		fsl,pins = <
813			MX8MQ_IOMUXC_SD2_RESET_B_GPIO2_IO19	0x41
814		>;
815	};
816
817	pinctrl_usdhc2_gpio: usdhc2gpiogrp {
818		fsl,pins = <
819			MX8MQ_IOMUXC_SD2_WP_GPIO2_IO20		0x80 /* WIFI_WAKE */
820		>;
821	};
822
823	pinctrl_usdhc2: usdhc2grp {
824		fsl,pins = <
825			MX8MQ_IOMUXC_SD2_CLK_USDHC2_CLK		0x83
826			MX8MQ_IOMUXC_SD2_CMD_USDHC2_CMD		0xc3
827			MX8MQ_IOMUXC_SD2_DATA0_USDHC2_DATA0	0xc3
828			MX8MQ_IOMUXC_SD2_DATA1_USDHC2_DATA1	0xc3
829			MX8MQ_IOMUXC_SD2_DATA2_USDHC2_DATA2	0xc3
830			MX8MQ_IOMUXC_SD2_DATA3_USDHC2_DATA3	0xc3
831		>;
832	};
833
834	pinctrl_usdhc2_100mhz: usdhc2-100mhzgrp {
835		fsl,pins = <
836			MX8MQ_IOMUXC_SD2_CLK_USDHC2_CLK		0x8d
837			MX8MQ_IOMUXC_SD2_CMD_USDHC2_CMD		0xcd
838			MX8MQ_IOMUXC_SD2_DATA0_USDHC2_DATA0	0xcd
839			MX8MQ_IOMUXC_SD2_DATA1_USDHC2_DATA1	0xcd
840			MX8MQ_IOMUXC_SD2_DATA2_USDHC2_DATA2	0xcd
841			MX8MQ_IOMUXC_SD2_DATA3_USDHC2_DATA3	0xcd
842		>;
843	};
844
845	pinctrl_usdhc2_200mhz: usdhc2-200mhzgrp {
846		fsl,pins = <
847			MX8MQ_IOMUXC_SD2_CLK_USDHC2_CLK		0x9f
848			MX8MQ_IOMUXC_SD2_CMD_USDHC2_CMD		0xcf
849			MX8MQ_IOMUXC_SD2_DATA0_USDHC2_DATA0	0xcf
850			MX8MQ_IOMUXC_SD2_DATA1_USDHC2_DATA1	0xcf
851			MX8MQ_IOMUXC_SD2_DATA2_USDHC2_DATA2	0xcf
852			MX8MQ_IOMUXC_SD2_DATA3_USDHC2_DATA3	0xcf
853		>;
854	};
855
856	pinctrl_wdog: wdoggrp {
857		fsl,pins = <
858			MX8MQ_IOMUXC_GPIO1_IO02_WDOG1_WDOG_B	0xc6
859		>;
860	};
861
862	pinctrl_wifi_pwr_en: wifipwrengrp {
863		fsl,pins = <
864			MX8MQ_IOMUXC_NAND_CLE_GPIO3_IO5         0x06
865		>;
866	};
867
868	pinctrl_wwan: wwangrp {
869		fsl,pins = <
870			MX8MQ_IOMUXC_NAND_CE3_B_GPIO3_IO4	0x09 /* nWWAN_DISABLE */
871			MX8MQ_IOMUXC_NAND_DATA02_GPIO3_IO8	0x80 /* nWoWWAN */
872			MX8MQ_IOMUXC_NAND_DATA03_GPIO3_IO9	0x19 /* WWAN_RESET */
873		>;
874	};
875};
876
877&lcdif {
878	status = "okay";
879};
880
881&mipi_dsi {
882	status = "okay";
883	#address-cells = <1>;
884	#size-cells = <0>;
885
886	panel@0 {
887		compatible = "rocktech,jh057n00900";
888		reg = <0>;
889		backlight = <&backlight_dsi>;
890		reset-gpios = <&gpio3 13 GPIO_ACTIVE_LOW>;
891		iovcc-supply = <&reg_1v8_p>;
892		vcc-supply = <&reg_2v8_p>;
893		port {
894			panel_in: endpoint {
895				remote-endpoint = <&mipi_dsi_out>;
896			};
897		};
898	};
899
900	ports {
901		port@1 {
902			reg = <1>;
903			mipi_dsi_out: endpoint {
904				remote-endpoint = <&panel_in>;
905			};
906		};
907	};
908};
909
910&pgc_gpu {
911	power-supply = <&buck3_reg>;
912};
913
914&pgc_vpu {
915	power-supply = <&buck4_reg>;
916};
917
918&pwm1 {
919	pinctrl-names = "default";
920	pinctrl-0 = <&pinctrl_bl>;
921	status = "okay";
922};
923
924&pwm2 {
925	pinctrl-names = "default";
926	pinctrl-0 = <&pinctrl_pwm_led>;
927	status = "okay";
928};
929
930&snvs_pwrkey {
931	status = "okay";
932};
933
934&snvs_rtc {
935	status = "disabled";
936};
937
938&sai2 {
939	pinctrl-names = "default";
940	pinctrl-0 = <&pinctrl_sai2>;
941	assigned-clocks = <&clk IMX8MQ_CLK_SAI2>;
942	assigned-clock-parents = <&clk IMX8MQ_AUDIO_PLL1_OUT>;
943	assigned-clock-rates = <24576000>;
944	status = "okay";
945};
946
947&sai6 {
948	pinctrl-names = "default";
949	pinctrl-0 = <&pinctrl_sai6>;
950	assigned-clocks = <&clk IMX8MQ_CLK_SAI6>;
951	assigned-clock-parents = <&clk IMX8MQ_AUDIO_PLL1_OUT>;
952	assigned-clock-rates = <24576000>;
953	fsl,sai-synchronous-rx;
954	status = "okay";
955};
956
957&uart1 { /* console */
958	pinctrl-names = "default";
959	pinctrl-0 = <&pinctrl_uart1>;
960	status = "okay";
961};
962
963&uart3 { /* GNSS */
964	pinctrl-names = "default";
965	pinctrl-0 = <&pinctrl_uart3>;
966	status = "okay";
967};
968
969&uart4 { /* BT */
970	pinctrl-names = "default";
971	pinctrl-0 = <&pinctrl_uart4>, <&pinctrl_bt>;
972	uart-has-rtscts;
973	status = "okay";
974};
975
976&usb3_phy0 {
977	vbus-supply = <&reg_5v_p>;
978	status = "okay";
979};
980
981&usb3_phy1 {
982	vbus-supply = <&reg_5v_p>;
983	status = "okay";
984};
985
986&usb_dwc3_0 {
987	#address-cells = <1>;
988	#size-cells = <0>;
989	dr_mode = "otg";
990	status = "okay";
991
992	port@0 {
993		reg = <0>;
994
995		typec_hs: endpoint {
996			remote-endpoint = <&usb_con_hs>;
997		};
998	};
999
1000	port@1 {
1001		reg = <1>;
1002
1003		typec_ss: endpoint {
1004			remote-endpoint = <&usb_con_ss>;
1005		};
1006	};
1007};
1008
1009&usb_dwc3_1 {
1010	dr_mode = "host";
1011	status = "okay";
1012};
1013
1014&usdhc1 {
1015	assigned-clocks = <&clk IMX8MQ_CLK_USDHC1>;
1016	assigned-clock-rates = <400000000>;
1017	pinctrl-names = "default", "state_100mhz", "state_200mhz";
1018	pinctrl-0 = <&pinctrl_usdhc1>;
1019	pinctrl-1 = <&pinctrl_usdhc1_100mhz>;
1020	pinctrl-2 = <&pinctrl_usdhc1_200mhz>;
1021	bus-width = <8>;
1022	non-removable;
1023	status = "okay";
1024};
1025
1026&usdhc2 {
1027	assigned-clocks = <&clk IMX8MQ_CLK_USDHC2>;
1028	assigned-clock-rates = <200000000>;
1029	pinctrl-names = "default", "state_100mhz", "state_200mhz";
1030	pinctrl-0 = <&pinctrl_usdhc2>;
1031	pinctrl-1 = <&pinctrl_usdhc2_100mhz>;
1032	pinctrl-2 = <&pinctrl_usdhc2_200mhz>;
1033	bus-width = <4>;
1034	vmmc-supply = <&reg_usdhc2_vmmc>;
1035	power-supply = <&wifi_pwr_en>;
1036	broken-cd;
1037	disable-wp;
1038	cap-sdio-irq;
1039	keep-power-in-suspend;
1040	wakeup-source;
1041	status = "okay";
1042};
1043
1044&wdog1 {
1045	pinctrl-names = "default";
1046	pinctrl-0 = <&pinctrl_wdog>;
1047	fsl,ext-reset-output;
1048	status = "okay";
1049};
1050