1// SPDX-License-Identifier: (GPL-2.0-or-later OR X11)
2/*
3 * Copyright 2013-2014 Freescale Semiconductor, Inc.
4 * Copyright 2018-2023 TQ-Systems GmbH <linux@ew.tq-group.com>,
5 * D-82229 Seefeld, Germany.
6 * Author: Alexander Stein
7 */
8
9/dts-v1/;
10
11#include <dt-bindings/gpio/gpio.h>
12#include <dt-bindings/input/linux-event-codes.h>
13#include <dt-bindings/leds/common.h>
14#include <dt-bindings/leds/leds-pca9532.h>
15#include <dt-bindings/net/ti-dp83867.h>
16
17#include "ls1021a-tqmls1021a.dtsi"
18
19/ {
20	model = "TQMLS102xA SOM on MBLS102xA";
21	compatible = "tq,ls1021a-tqmls1021a-mbls102xa", "tq,ls1021a-tqmls1021a", "fsl,ls1021a";
22
23	audio_mclk: audio-clock {
24		compatible = "fixed-clock";
25		#clock-cells = <0>;
26		clock-frequency = <25000000>;
27	};
28
29	backlight_dcu: backlight {
30		compatible = "gpio-backlight";
31		gpios = <&pca9530 0 GPIO_ACTIVE_LOW>;
32		status = "disabled";
33	};
34
35	gpio-keys {
36		compatible = "gpio-keys";
37		autorepeat;
38
39		switch-1 {
40			label = "S6";
41			linux,code = <BTN_0>;
42			gpios = <&pca9554_0 0 GPIO_ACTIVE_LOW>;
43		};
44
45		btn2: switch-2 {
46			label = "S7";
47			linux,code = <BTN_1>;
48			gpios = <&pca9554_0 1 GPIO_ACTIVE_LOW>;
49		};
50
51		switch-3 {
52			label = "S8";
53			linux,code = <BTN_2>;
54			gpios = <&pca9554_0 2 GPIO_ACTIVE_LOW>;
55		};
56	};
57
58	gpio_leds: gpio-leds {
59		compatible = "gpio-leds";
60
61		led-0 {
62			color = <LED_COLOR_ID_GREEN>;
63			function = LED_FUNCTION_STATUS;
64			function-enumerator = <0>;
65			gpios = <&pca9554_2 4 GPIO_ACTIVE_LOW>;
66			linux,default-trigger = "default-on";
67		};
68
69		led-1 {
70			color = <LED_COLOR_ID_GREEN>;
71			function = LED_FUNCTION_STATUS;
72			function-enumerator = <1>;
73			gpios = <&pca9554_2 5 GPIO_ACTIVE_LOW>;
74			linux,default-trigger = "default-on";
75		};
76
77		led-2 {
78			color = <LED_COLOR_ID_GREEN>;
79			function = LED_FUNCTION_STATUS;
80			function-enumerator = <2>;
81			gpios = <&pca9554_2 6 GPIO_ACTIVE_LOW>;
82			linux,default-trigger = "default-on";
83		};
84
85		led-3 {
86			color = <LED_COLOR_ID_GREEN>;
87			function = LED_FUNCTION_HEARTBEAT;
88			function-enumerator = <0>;
89			gpios = <&pca9554_2 7 GPIO_ACTIVE_LOW>;
90			linux,default-trigger = "heartbeat";
91		};
92	};
93
94	lvds_encoder: lvds-encoder {
95		compatible = "ti,sn75lvds83", "lvds-encoder";
96		power-supply = <&reg_3p3v>;
97		status = "disabled";
98
99		ports {
100			#address-cells = <1>;
101			#size-cells = <0>;
102
103			port@0 {
104				reg = <0>;
105
106				lvds_encoder_in: endpoint {};
107			};
108
109			port@1 {
110				reg = <1>;
111
112				lvds_encoder_out: endpoint {};
113			};
114		};
115	};
116
117	reg_1p2v: regulator-1p2v {
118		compatible = "regulator-fixed";
119		regulator-name = "1P2V";
120		regulator-min-microvolt = <1200000>;
121		regulator-max-microvolt = <1200000>;
122		regulator-always-on;
123		vin-supply = <&reg_3p3v>;
124	};
125
126	reg_3p3v: regulator-3p3v {
127		compatible = "regulator-fixed";
128		regulator-name = "3P3V";
129		regulator-min-microvolt = <3300000>;
130		regulator-max-microvolt = <3300000>;
131		regulator-always-on;
132	};
133
134	hdmi_out: hdmi {
135		compatible = "hdmi-connector";
136		type = "a";
137		ddc-i2c-bus = <&i2c0>;
138		status = "disabled";
139
140		port {
141			hdmi_in: endpoint {
142				remote-endpoint = <&sii9022a_out>;
143			};
144		};
145	};
146
147	display: panel {
148		backlight = <&backlight_dcu>;
149		enable-gpios = <&pca9554_1 3 GPIO_ACTIVE_HIGH>;
150		status = "disabled";
151
152		port {
153			panel_in: endpoint {};
154		};
155	};
156
157	sound {
158		compatible = "fsl,imx-audio-tlv320aic32x4";
159		model = "ls1021a-mbls1021a-tlv320aic32";
160		ssi-controller = <&sai1>;
161		audio-codec = <&tlv320aic32x4>;
162	};
163
164};
165
166&can0 {
167	xceiver-supply = <&reg_3p3v>;
168	status = "okay";
169};
170
171&can1 {
172	xceiver-supply = <&reg_3p3v>;
173	status = "okay";
174};
175
176&dspi0 {
177	status = "okay";
178};
179
180&enet0 {
181	phy-handle = <&rgmii_phy0c>;
182	phy-mode = "rgmii-id";
183	mac-address = [ 00 00 00 00 00 00 ];
184	status = "okay";
185};
186
187&enet1 {
188	tbi-handle = <&tbi1>;
189	phy-handle = <&sgmii_phy03>;
190	phy-mode = "sgmii";
191	mac-address = [ 00 00 00 00 00 00 ];
192	status = "okay";
193};
194
195&enet2 {
196	phy-handle = <&rgmii_phy04>;
197	phy-mode = "rgmii-id";
198	mac-address = [ 00 00 00 00 00 00 ];
199	status = "okay";
200};
201
202&i2c0 {
203	status = "okay";
204
205	tlv320aic32x4: audio-codec@18 {
206		compatible = "ti,tlv320aic32x4";
207		reg = <0x18>;
208		clocks = <&audio_mclk>;
209		clock-names = "mclk";
210		ldoin-supply = <&reg_3p3v>;
211		iov-supply = <&reg_3p3v>;
212	};
213
214	pca9554_0: gpio-expander@20 {
215		compatible = "nxp,pca9554";
216		reg = <0x20>;
217		gpio-controller;
218		#gpio-cells = <2>;
219		interrupt-parent = <&gpio0>;
220		interrupts = <24 IRQ_TYPE_EDGE_FALLING>;
221		interrupt-controller;
222		#interrupt-cells = <2>;
223		vcc-supply = <&reg_3p3v>;
224		gpio-line-names = "BUTTON0", "BUTTON1",
225				  "BUTTON2", "EMMC_SEL",
226				  "DIP2", "DIP3",
227				  "EXT_TOUCH_INT", "GPIO_1";
228	};
229
230	pca9554_1: gpio-expander@21 {
231		compatible = "nxp,pca9554";
232		reg = <0x21>;
233		gpio-controller;
234		#gpio-cells = <2>;
235		interrupt-parent = <&gpio0>;
236		interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
237		interrupt-controller;
238		#interrupt-cells = <2>;
239		vcc-supply = <&reg_3p3v>;
240		gpio-line-names = "PCIE_PWR_EN", "MPCIE_DISABLE#",
241				  "MPCIE_WAKE#", "LCD_BLT_EN",
242				  "LCD_PWR_EN", "EC1_PHY_PWDN",
243				  "EC3_PHY_PWDN", "SGMII_PHY_PWDN";
244	};
245
246	pca9554_2: gpio-expander@22 {
247		compatible = "nxp,pca9554";
248		reg = <0x22>;
249		gpio-controller;
250		#gpio-cells = <2>;
251		interrupt-parent = <&extirq>;
252		interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
253		interrupt-controller;
254		#interrupt-cells = <2>;
255		vcc-supply = <&reg_3p3v>;
256		gpio-line-names = "MUX_SEL0", "MUX_SEL1",
257				  "MUX_SEL2", "MUX_SEL3",
258				  "V95", "V96", "V97", "V98";
259	};
260
261	sii9022a: hdmi-transmitter@3b {
262		compatible = "sil,sii9022";
263		reg = <0x3b>;
264		iovcc-supply = <&reg_3p3v>;
265		cvcc12-supply = <&reg_1p2v>;
266		interrupts = <GIC_SPI 167 IRQ_TYPE_EDGE_RISING>;
267		#sound-dai-cells = <0>;
268		sil,i2s-data-lanes = <0>;
269		status = "disabled";
270
271		ports {
272			#address-cells = <1>;
273			#size-cells = <0>;
274
275			port@0 {
276				reg = <0>;
277
278				sii9022a_in: endpoint {};
279			};
280
281			port@1 {
282				reg = <1>;
283
284				sii9022a_out: endpoint {
285					remote-endpoint = <&hdmi_in>;
286				};
287			};
288		};
289	};
290
291	stmpe811: port-expander@41 {
292		compatible = "st,stmpe811";
293		reg = <0x41>;
294		interrupt-parent = <&gpio0>;
295		interrupts = <23 IRQ_TYPE_EDGE_FALLING>;
296		vcc-supply = <&reg_3p3v>;
297		vio-supply = <&reg_3p3v>;
298
299		gpio {
300			compatible = "st,stmpe-gpio";
301			gpio-controller;
302			#gpio-cells = <2>;
303			interrupt-controller;
304			#interrupt-cells = <2>;
305			/* GPIO 5-7 used for touch */
306			st,norequest-mask = <0xf0>;
307			gpio-line-names = "GPIO_ADC_I2C1_1",
308					  "GPIO_ADC_I2C1_2",
309					  "GPIO_ADC_I2C1_3",
310					  "GPIO_ADC_I2C1_4";
311		};
312
313		touchscreen {
314			compatible = "st,stmpe-ts";
315			status = "disabled";
316		};
317	};
318
319	pca9530: leds@60 {
320		compatible = "nxp,pca9530";
321		reg = <0x60>;
322		gpio-controller;
323		#gpio-cells = <2>;
324		gpio-line-names = "PWM_0", "PWM_1";
325
326		led-0 {
327			type = <PCA9532_TYPE_GPIO>;
328		};
329
330		led-1 {
331			type = <PCA9532_TYPE_GPIO>;
332		};
333	};
334
335};
336
337&i2c1 {
338	status = "okay";
339};
340
341&lpuart0 {
342	linux,rs485-enabled-at-boot-time;
343	status = "okay";
344};
345
346&mdio0 {
347	sgmii_phy03: ethernet-phy@3 {
348		compatible = "ethernet-phy-ieee802.3-c22";
349		reg = <0x03>;
350		ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
351		ti,clk-output-sel = <DP83867_CLK_O_SEL_OFF>;
352		ti,dp83867-rxctrl-strap-quirk;
353	};
354
355	rgmii_phy04: ethernet-phy@4 {
356		compatible = "ethernet-phy-ieee802.3-c22";
357		reg = <0x04>;
358		ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_50_NS>;
359		ti,tx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
360		ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
361		ti,clk-output-sel = <DP83867_CLK_O_SEL_OFF>;
362	};
363
364	rgmii_phy0c: ethernet-phy@c {
365		compatible = "ethernet-phy-ieee802.3-c22";
366		reg = <0x0c>;
367		ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_50_NS>;
368		ti,tx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
369		ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
370		ti,clk-output-sel = <DP83867_CLK_O_SEL_OFF>;
371	};
372};
373
374&pwm6 {
375	status = "okay";
376};
377
378&pwm7 {
379	status = "okay";
380};
381
382&sai1 {
383	status = "okay";
384};
385
386&sata {
387	status = "okay";
388};
389
390&uart0 {
391	status = "okay";
392};
393
394&uart1 {
395	status = "okay";
396};
397
398&usb3 {
399	/*
400	 * Although DR connector, VBUS is always driven, so
401	 * restrict to host mode.
402	 */
403	dr_mode = "host";
404	status = "okay";
405};
406