xref: /linux/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi-cm4-mnt-reform2.dts (revision 90d32e92011eaae8e70a9169b4e7acf4ca8f9d3a)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2023 Neil Armstrong <neil.armstrong@linaro.org>
4 * Copyright 2023 MNT Research GmbH
5 */
6
7/dts-v1/;
8
9#include "meson-g12b-bananapi-cm4.dtsi"
10#include <dt-bindings/input/input.h>
11#include <dt-bindings/leds/common.h>
12#include <dt-bindings/sound/meson-g12a-tohdmitx.h>
13
14/ {
15	model = "MNT Reform 2 with BPI-CM4 Module";
16	compatible = "mntre,reform2-cm4", "bananapi,bpi-cm4", "amlogic,a311d", "amlogic,g12b";
17	chassis-type = "laptop";
18
19	aliases {
20		ethernet0 = &ethmac;
21		i2c0 = &i2c1;
22		i2c1 = &i2c3;
23	};
24
25	hdmi_connector: hdmi-connector {
26		compatible = "hdmi-connector";
27		type = "a";
28
29		port {
30			hdmi_connector_in: endpoint {
31				remote-endpoint = <&hdmi_tx_tmds_out>;
32			};
33		};
34	};
35
36	leds {
37		compatible = "gpio-leds";
38
39		led-blue {
40			color = <LED_COLOR_ID_BLUE>;
41			function = LED_FUNCTION_STATUS;
42			gpios = <&gpio_ao GPIOAO_7 GPIO_ACTIVE_HIGH>;
43			linux,default-trigger = "heartbeat";
44		};
45
46		led-green {
47			color = <LED_COLOR_ID_GREEN>;
48			function = LED_FUNCTION_STATUS;
49			gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_HIGH>;
50		};
51	};
52
53	sound {
54		compatible = "amlogic,axg-sound-card";
55		model = "MNT-REFORM2-BPI-CM4";
56		audio-widgets = "Headphone", "Headphone Jack",
57				"Speaker", "External Speaker",
58				"Microphone", "Mic Jack";
59		audio-aux-devs = <&tdmout_a>, <&tdmout_b>, <&tdmin_b>;
60		audio-routing =	"TDMOUT_A IN 0", "FRDDR_A OUT 0",
61				"TDMOUT_A IN 1", "FRDDR_B OUT 0",
62				"TDMOUT_A IN 2", "FRDDR_C OUT 0",
63				"TDM_A Playback", "TDMOUT_A OUT",
64				"TDMOUT_B IN 0", "FRDDR_A OUT 1",
65				"TDMOUT_B IN 1", "FRDDR_B OUT 1",
66				"TDMOUT_B IN 2", "FRDDR_C OUT 1",
67				"TDM_B Playback", "TDMOUT_B OUT",
68				"TDMIN_B IN 1", "TDM_B Capture",
69				"TDMIN_B IN 4", "TDM_B Loopback",
70				"TODDR_A IN 1", "TDMIN_B OUT",
71				"TODDR_B IN 1", "TDMIN_B OUT",
72				"TODDR_C IN 1", "TDMIN_B OUT",
73				"Headphone Jack", "HP_L",
74				"Headphone Jack", "HP_R",
75				"External Speaker", "SPK_LP",
76				"External Speaker", "SPK_LN",
77				"External Speaker", "SPK_RP",
78				"External Speaker", "SPK_RN",
79				"LINPUT1", "Mic Jack",
80				"Mic Jack", "MICB";
81
82		assigned-clocks = <&clkc CLKID_MPLL2>,
83					<&clkc CLKID_MPLL0>,
84					<&clkc CLKID_MPLL1>;
85		assigned-clock-parents = <0>, <0>, <0>;
86		assigned-clock-rates = <294912000>,
87				       <270950400>,
88				       <393216000>;
89
90		dai-link-0 {
91			sound-dai = <&frddr_a>;
92		};
93
94		dai-link-1 {
95			sound-dai = <&frddr_b>;
96		};
97
98		dai-link-2 {
99			sound-dai = <&frddr_c>;
100		};
101
102		dai-link-3 {
103			sound-dai = <&toddr_a>;
104		};
105
106		dai-link-4 {
107			sound-dai = <&toddr_b>;
108		};
109
110		dai-link-5 {
111			sound-dai = <&toddr_c>;
112		};
113
114		/* 8ch hdmi interface */
115		dai-link-6 {
116			sound-dai = <&tdmif_a>;
117			dai-format = "i2s";
118			dai-tdm-slot-tx-mask-0 = <1 1>;
119			dai-tdm-slot-tx-mask-1 = <1 1>;
120			dai-tdm-slot-tx-mask-2 = <1 1>;
121			dai-tdm-slot-tx-mask-3 = <1 1>;
122			mclk-fs = <256>;
123
124			codec {
125				sound-dai = <&tohdmitx TOHDMITX_I2S_IN_A>;
126			};
127		};
128
129		/* Analog Audio */
130		dai-link-7 {
131			sound-dai = <&tdmif_b>;
132			dai-format = "i2s";
133			dai-tdm-slot-tx-mask-0 = <1 1>;
134			mclk-fs = <256>;
135
136			codec {
137				sound-dai = <&wm8960>;
138			};
139		};
140
141		/* hdmi glue */
142		dai-link-8 {
143			sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
144
145			codec {
146				sound-dai = <&hdmi_tx>;
147			};
148		};
149	};
150
151	reg_main_1v8: regulator-main-1v8 {
152		compatible = "regulator-fixed";
153		regulator-name = "1V8";
154		regulator-min-microvolt = <1800000>;
155		regulator-max-microvolt = <1800000>;
156		vin-supply = <&reg_main_3v3>;
157	};
158
159	reg_main_1v2: regulator-main-1v2 {
160		compatible = "regulator-fixed";
161		regulator-name = "1V2";
162		regulator-min-microvolt = <1200000>;
163		regulator-max-microvolt = <1200000>;
164		vin-supply = <&reg_main_5v>;
165	};
166
167	reg_main_3v3: regulator-main-3v3 {
168		compatible = "regulator-fixed";
169		regulator-name = "3V3";
170		regulator-min-microvolt = <3300000>;
171		regulator-max-microvolt = <3300000>;
172	};
173
174	reg_main_5v: regulator-main-5v {
175		compatible = "regulator-fixed";
176		regulator-name = "5V";
177		regulator-min-microvolt = <5000000>;
178		regulator-max-microvolt = <5000000>;
179	};
180
181	reg_main_usb: regulator-main-usb {
182		compatible = "regulator-fixed";
183		regulator-name = "USB_PWR";
184		regulator-min-microvolt = <5000000>;
185		regulator-max-microvolt = <5000000>;
186		vin-supply = <&reg_main_5v>;
187	};
188
189	backlight: backlight {
190		compatible = "pwm-backlight";
191		pwms = <&pwm_AO_ab 0 10000 0>;
192		power-supply = <&reg_main_usb>;
193		enable-gpios = <&gpio 58 GPIO_ACTIVE_HIGH>;
194		brightness-levels = <0 32 64 128 160 200 255>;
195		default-brightness-level = <6>;
196	};
197
198	panel {
199		compatible = "innolux,n125hce-gn1";
200		power-supply = <&reg_main_3v3>;
201		backlight = <&backlight>;
202		no-hpd;
203
204		port {
205			panel_in: endpoint {
206				remote-endpoint = <&edp_bridge_out>;
207			};
208		};
209	};
210
211	clock_12288: clock_12288 {
212		compatible = "fixed-clock";
213		#clock-cells = <0>;
214		clock-frequency = <12288000>;
215	};
216};
217
218&mipi_analog_dphy {
219	status = "okay";
220};
221
222&mipi_dphy {
223	status = "okay";
224};
225
226&mipi_dsi {
227	status = "okay";
228
229	assigned-clocks = <&clkc CLKID_GP0_PLL>,
230			  <&clkc CLKID_MIPI_DSI_PXCLK_SEL>,
231			  <&clkc CLKID_MIPI_DSI_PXCLK>,
232			  <&clkc CLKID_CTS_ENCL_SEL>,
233			  <&clkc CLKID_VCLK2_SEL>;
234	assigned-clock-parents = <0>,
235				 <&clkc CLKID_GP0_PLL>,
236				 <0>,
237				 <&clkc CLKID_VCLK2_DIV1>,
238				 <&clkc CLKID_GP0_PLL>;
239	assigned-clock-rates = <936000000>,
240			       <0>,
241			       <936000000>,
242			       <0>,
243			       <0>;
244};
245
246&mipi_dsi_panel_port {
247	mipi_dsi_out: endpoint {
248		remote-endpoint = <&edp_bridge_in>;
249	};
250};
251
252&cecb_AO {
253	status = "okay";
254};
255
256&ethmac {
257	status = "okay";
258};
259
260&hdmi_tx {
261	status = "okay";
262};
263
264&hdmi_tx_tmds_port {
265	hdmi_tx_tmds_out: endpoint {
266		remote-endpoint = <&hdmi_connector_in>;
267	};
268};
269
270&pwm_AO_ab {
271	pinctrl-names = "default";
272	pinctrl-0 = <&pwm_ao_a_pins>;
273	status = "okay";
274};
275
276&i2c0 {
277	status = "okay";
278};
279
280&i2c3 {
281	status = "okay";
282
283	edp_bridge: bridge@2c {
284		compatible = "ti,sn65dsi86";
285		reg = <0x2c>;
286		enable-gpios = <&gpio GPIOX_10 GPIO_ACTIVE_HIGH>; // PIN_24 / GPIO8
287		vccio-supply = <&reg_main_1v8>;
288		vpll-supply = <&reg_main_1v8>;
289		vcca-supply = <&reg_main_1v2>;
290		vcc-supply = <&reg_main_1v2>;
291
292		ports {
293			#address-cells = <1>;
294			#size-cells = <0>;
295
296			port@0 {
297				reg = <0>;
298
299				edp_bridge_in: endpoint {
300					remote-endpoint = <&mipi_dsi_out>;
301				};
302			};
303
304			port@1 {
305				reg = <1>;
306
307				edp_bridge_out: endpoint {
308					remote-endpoint = <&panel_in>;
309				};
310			};
311		};
312	};
313};
314
315&i2c2 {
316	status = "okay";
317
318	wm8960: codec@1a {
319		compatible = "wlf,wm8960";
320		reg = <0x1a>;
321		clocks = <&clock_12288>;
322		clock-names = "mclk";
323		#sound-dai-cells = <0>;
324		wlf,shared-lrclk;
325	};
326
327	rtc@68 {
328		compatible = "nxp,pcf8523";
329		reg = <0x68>;
330	};
331};
332
333&pcie {
334	status = "okay";
335};
336
337&sd_emmc_b {
338	status = "okay";
339};
340
341&tdmif_a {
342	status = "okay";
343};
344
345&tdmout_a {
346	status = "okay";
347};
348
349&tdmif_b {
350	pinctrl-0 = <&tdm_b_dout0_pins>, <&tdm_b_fs_pins>, <&tdm_b_sclk_pins>, <&tdm_b_din1_pins>;
351	pinctrl-names = "default";
352
353	assigned-clocks = <&clkc_audio AUD_CLKID_TDM_SCLK_PAD1>,
354			  <&clkc_audio AUD_CLKID_TDM_LRCLK_PAD1>;
355	assigned-clock-parents = <&clkc_audio AUD_CLKID_MST_B_SCLK>,
356				 <&clkc_audio AUD_CLKID_MST_B_LRCLK>;
357	assigned-clock-rates = <0>, <0>;
358};
359
360&tdmin_b {
361	status = "okay";
362};
363
364&toddr_a {
365	status = "okay";
366};
367
368&toddr_b {
369	status = "okay";
370};
371
372&toddr_c {
373	status = "okay";
374};
375
376&tohdmitx {
377	status = "okay";
378};
379
380&usb {
381	dr_mode = "host";
382
383	status = "okay";
384};
385