xref: /linux/scripts/dtc/include-prefixes/arm64/amlogic/meson-g12b-radxa-zero2.dts (revision ec71f661a572a770d7c861cd52a50cbbb0e1a8d1)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2019 BayLibre, SAS
4 * Author: Neil Armstrong <narmstrong@baylibre.com>
5 * Copyright (c) 2019 Christian Hewitt <christianshewitt@gmail.com>
6 * Copyright (c) 2022 Radxa Limited
7 * Author: Yuntian Zhang <yt@radxa.com>
8 */
9
10/dts-v1/;
11
12#include "meson-g12b-a311d.dtsi"
13#include <dt-bindings/input/input.h>
14#include <dt-bindings/leds/common.h>
15#include <dt-bindings/gpio/meson-g12a-gpio.h>
16#include <dt-bindings/sound/meson-g12a-tohdmitx.h>
17
18/ {
19	compatible = "radxa,zero2", "amlogic,a311d", "amlogic,g12b";
20	model = "Radxa Zero2";
21
22	aliases {
23		serial0 = &uart_AO;
24		serial2 = &uart_A;
25	};
26
27	chosen {
28		stdout-path = "serial0:115200n8";
29	};
30
31	memory@0 {
32		device_type = "memory";
33		reg = <0x0 0x0 0x0 0x80000000>;
34	};
35
36	fan0: pwm-fan {
37		compatible = "pwm-fan";
38		#cooling-cells = <2>;
39		cooling-levels = <0 64 128 192 255>;
40		pwms = <&pwm_AO_ab 0 40000 0>;
41	};
42
43	gpio-keys-polled {
44		compatible = "gpio-keys-polled";
45		poll-interval = <100>;
46		power-button {
47			label = "power";
48			linux,code = <KEY_POWER>;
49			gpios = <&gpio_ao GPIOAO_3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
50		};
51	};
52
53	leds {
54		compatible = "gpio-leds";
55
56		led-green {
57			color = <LED_COLOR_ID_GREEN>;
58			function = LED_FUNCTION_STATUS;
59			gpios = <&gpio GPIOA_12 GPIO_ACTIVE_HIGH>;
60			linux,default-trigger = "heartbeat";
61		};
62	};
63
64	hdmi-connector {
65		compatible = "hdmi-connector";
66		type = "a";
67
68		port {
69			hdmi_connector_in: endpoint {
70				remote-endpoint = <&hdmi_tx_tmds_out>;
71			};
72		};
73	};
74
75	emmc_pwrseq: emmc-pwrseq {
76		compatible = "mmc-pwrseq-emmc";
77		reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
78	};
79
80	sdio_pwrseq: sdio-pwrseq {
81		compatible = "mmc-pwrseq-simple";
82		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
83		clocks = <&wifi32k>;
84		clock-names = "ext_clock";
85	};
86
87	ao_5v: regulator-ao-5v {
88		compatible = "regulator-fixed";
89		regulator-name = "AO_5V";
90		regulator-min-microvolt = <5000000>;
91		regulator-max-microvolt = <5000000>;
92		regulator-always-on;
93	};
94
95	vcc_1v8: regulator-vcc-1v8 {
96		compatible = "regulator-fixed";
97		regulator-name = "VCC_1V8";
98		regulator-min-microvolt = <1800000>;
99		regulator-max-microvolt = <1800000>;
100		vin-supply = <&vcc_3v3>;
101		regulator-always-on;
102	};
103
104	vcc_3v3: regulator-vcc-3v3 {
105		compatible = "regulator-fixed";
106		regulator-name = "VCC_3V3";
107		regulator-min-microvolt = <3300000>;
108		regulator-max-microvolt = <3300000>;
109		vin-supply = <&vddao_3v3>;
110		regulator-always-on;
111		/* FIXME: actually controlled by VDDCPU_B_EN */
112	};
113
114	vddao_1v8: regulator-vddao-1v8 {
115		compatible = "regulator-fixed";
116		regulator-name = "VDDIO_AO1V8";
117		regulator-min-microvolt = <1800000>;
118		regulator-max-microvolt = <1800000>;
119		vin-supply = <&vddao_3v3>;
120		regulator-always-on;
121	};
122
123	vddao_3v3: regulator-vddao-3v3 {
124		compatible = "regulator-fixed";
125		regulator-name = "VDDAO_3V3";
126		regulator-min-microvolt = <3300000>;
127		regulator-max-microvolt = <3300000>;
128		vin-supply = <&ao_5v>;
129		regulator-always-on;
130	};
131
132	vddcpu_a: regulator-vddcpu-a {
133		/*
134		 * MP8756GD Regulator.
135		 */
136		compatible = "pwm-regulator";
137
138		regulator-name = "VDDCPU_A";
139		regulator-min-microvolt = <730000>;
140		regulator-max-microvolt = <1022000>;
141
142		pwm-supply = <&ao_5v>;
143
144		pwms = <&pwm_ab 0 1250 0>;
145		pwm-dutycycle-range = <100 0>;
146
147		regulator-boot-on;
148		regulator-always-on;
149	};
150
151	vddcpu_b: regulator-vddcpu-b {
152		/*
153		 * Silergy SY8120B1ABC Regulator.
154		 */
155		compatible = "pwm-regulator";
156
157		regulator-name = "VDDCPU_B";
158		regulator-min-microvolt = <730000>;
159		regulator-max-microvolt = <1022000>;
160
161		pwm-supply = <&ao_5v>;
162
163		pwms = <&pwm_AO_cd 1 1250 0>;
164		pwm-dutycycle-range = <100 0>;
165
166		regulator-boot-on;
167		regulator-always-on;
168	};
169
170	sound {
171		compatible = "amlogic,axg-sound-card";
172		model = "RADXA-ZERO2";
173		audio-aux-devs = <&tdmout_b>;
174		audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1",
175				"TDMOUT_B IN 1", "FRDDR_B OUT 1",
176				"TDMOUT_B IN 2", "FRDDR_C OUT 1",
177				"TDM_B Playback", "TDMOUT_B OUT";
178
179		clocks = <&clkc CLKID_MPLL2>,
180			 <&clkc CLKID_MPLL0>,
181			 <&clkc CLKID_MPLL1>;
182
183		assigned-clocks = <&clkc CLKID_MPLL2>,
184				  <&clkc CLKID_MPLL0>,
185				  <&clkc CLKID_MPLL1>;
186		assigned-clock-parents = <0>, <0>, <0>;
187		assigned-clock-rates = <294912000>,
188				       <270950400>,
189				       <393216000>;
190
191		dai-link-0 {
192			sound-dai = <&frddr_a>;
193		};
194
195		dai-link-1 {
196			sound-dai = <&frddr_b>;
197		};
198
199		dai-link-2 {
200			sound-dai = <&frddr_c>;
201		};
202
203		/* 8ch hdmi interface */
204		dai-link-3 {
205			sound-dai = <&tdmif_b>;
206			dai-format = "i2s";
207			dai-tdm-slot-tx-mask-0 = <1 1>;
208			dai-tdm-slot-tx-mask-1 = <1 1>;
209			dai-tdm-slot-tx-mask-2 = <1 1>;
210			dai-tdm-slot-tx-mask-3 = <1 1>;
211			mclk-fs = <256>;
212
213			codec {
214				sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
215			};
216		};
217
218		/* hdmi glue */
219		dai-link-4 {
220			sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
221
222			codec {
223				sound-dai = <&hdmi_tx>;
224			};
225		};
226	};
227
228	wifi32k: clock-0 {
229		compatible = "pwm-clock";
230		#clock-cells = <0>;
231		clock-frequency = <32768>;
232		pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
233	};
234};
235
236&arb {
237	status = "okay";
238};
239
240&cec_AO {
241	pinctrl-0 = <&cec_ao_a_h_pins>;
242	pinctrl-names = "default";
243	status = "disabled";
244	hdmi-phandle = <&hdmi_tx>;
245};
246
247&cecb_AO {
248	pinctrl-0 = <&cec_ao_b_h_pins>;
249	pinctrl-names = "default";
250	status = "okay";
251	hdmi-phandle = <&hdmi_tx>;
252};
253
254&clkc_audio {
255	status = "okay";
256};
257
258&cpu0 {
259	cpu-supply = <&vddcpu_b>;
260	operating-points-v2 = <&cpu_opp_table_0>;
261	clocks = <&clkc CLKID_CPU_CLK>;
262};
263
264&cpu1 {
265	cpu-supply = <&vddcpu_b>;
266	operating-points-v2 = <&cpu_opp_table_0>;
267	clocks = <&clkc CLKID_CPU_CLK>;
268};
269
270&cpu100 {
271	cpu-supply = <&vddcpu_a>;
272	operating-points-v2 = <&cpub_opp_table_1>;
273	clocks = <&clkc CLKID_CPUB_CLK>;
274};
275
276&cpu101 {
277	cpu-supply = <&vddcpu_a>;
278	operating-points-v2 = <&cpub_opp_table_1>;
279	clocks = <&clkc CLKID_CPUB_CLK>;
280};
281
282&cpu102 {
283	cpu-supply = <&vddcpu_a>;
284	operating-points-v2 = <&cpub_opp_table_1>;
285	clocks = <&clkc CLKID_CPUB_CLK>;
286};
287
288&cpu103 {
289	cpu-supply = <&vddcpu_a>;
290	operating-points-v2 = <&cpub_opp_table_1>;
291	clocks = <&clkc CLKID_CPUB_CLK>;
292};
293
294&cpu_thermal {
295	trips {
296		cpu_active: cpu-active {
297			temperature = <70000>; /* millicelsius */
298			hysteresis = <2000>; /* millicelsius */
299			type = "active";
300		};
301	};
302
303	cooling-maps {
304		map2 {
305			trip = <&cpu_active>;
306			cooling-device = <&fan0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
307		};
308	};
309};
310
311&frddr_a {
312	status = "okay";
313};
314
315&frddr_b {
316	status = "okay";
317};
318
319&frddr_c {
320	status = "okay";
321};
322
323&gpio {
324	gpio-line-names =
325		/* GPIOZ */
326		"PIN_27", "PIN_28", "PIN_7", "PIN_11", "PIN_13", "PIN_15", "PIN_18", "PIN_40",
327		"", "", "", "", "", "", "", "",
328		/* GPIOH */
329		"", "", "", "", "PIN_19", "PIN_21", "PIN_24", "PIN_23",
330		"",
331		/* BOOT */
332		"", "", "", "", "", "", "", "",
333		"", "", "", "", "EMMC_PWRSEQ", "", "", "",
334		/* GPIOC */
335		"", "", "", "", "", "", "SD_CD", "PIN_36",
336		/* GPIOA */
337		"PIN_32", "PIN_12", "PIN_35", "", "", "PIN_38", "", "",
338		"", "", "", "", "LED_GREEN", "PIN_31", "PIN_3", "PIN_5",
339		/* GPIOX */
340		"", "", "", "", "", "", "SDIO_PWRSEQ", "",
341		"", "", "", "", "", "", "", "",
342		"", "BT_SHUTDOWN", "", "";
343};
344
345&gpio_ao {
346	gpio-line-names =
347		/* GPIOAO */
348		"PIN_8", "PIN_10", "", "BTN_POWER", "", "", "", "PIN_29",
349		"PIN_33", "PIN_37", "FAN", "",
350		/* GPIOE */
351		"", "", "";
352};
353
354&hdmi_tx {
355	status = "okay";
356	pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
357	pinctrl-names = "default";
358	hdmi-supply = <&ao_5v>;
359};
360
361&hdmi_tx_tmds_port {
362	hdmi_tx_tmds_out: endpoint {
363		remote-endpoint = <&hdmi_connector_in>;
364	};
365};
366
367&ir {
368	status = "disabled";
369	pinctrl-0 = <&remote_input_ao_pins>;
370	pinctrl-names = "default";
371};
372
373&pwm_ab {
374	pinctrl-0 = <&pwm_a_e_pins>;
375	pinctrl-names = "default";
376	status = "okay";
377};
378
379&pwm_ef {
380	pinctrl-0 = <&pwm_e_pins>;
381	pinctrl-names = "default";
382	status = "okay";
383};
384
385&pwm_AO_ab {
386	pinctrl-0 = <&pwm_ao_a_pins>;
387	pinctrl-names = "default";
388	status = "okay";
389};
390
391&pwm_AO_cd {
392	pinctrl-0 = <&pwm_ao_d_e_pins>;
393	pinctrl-names = "default";
394	status = "okay";
395};
396
397&saradc {
398	status = "okay";
399	vref-supply = <&vddao_1v8>;
400};
401
402/* SDIO */
403&sd_emmc_a {
404	status = "okay";
405	pinctrl-0 = <&sdio_pins>;
406	pinctrl-1 = <&sdio_clk_gate_pins>;
407	pinctrl-names = "default", "clk-gate";
408	#address-cells = <1>;
409	#size-cells = <0>;
410
411	bus-width = <4>;
412	cap-sd-highspeed;
413	max-frequency = <100000000>;
414
415	non-removable;
416	disable-wp;
417
418	/* WiFi firmware requires power to be kept while in suspend */
419	keep-power-in-suspend;
420
421	mmc-pwrseq = <&sdio_pwrseq>;
422
423	vmmc-supply = <&vddao_3v3>;
424	vqmmc-supply = <&vddao_1v8>;
425
426	brcmf: wifi@1 {
427		reg = <1>;
428		compatible = "brcm,bcm4329-fmac";
429	};
430};
431
432/* SD card */
433&sd_emmc_b {
434	status = "okay";
435	pinctrl-0 = <&sdcard_c_pins>;
436	pinctrl-1 = <&sdcard_clk_gate_c_pins>;
437	pinctrl-names = "default", "clk-gate";
438
439	bus-width = <4>;
440	cap-sd-highspeed;
441	max-frequency = <50000000>;
442	disable-wp;
443
444	cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
445	vmmc-supply = <&vddao_3v3>;
446	vqmmc-supply = <&vddao_3v3>;
447};
448
449/* eMMC */
450&sd_emmc_c {
451	status = "okay";
452	pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>;
453	pinctrl-1 = <&emmc_clk_gate_pins>;
454	pinctrl-names = "default", "clk-gate";
455
456	bus-width = <8>;
457	cap-mmc-highspeed;
458	mmc-ddr-1_8v;
459	mmc-hs200-1_8v;
460	max-frequency = <200000000>;
461	disable-wp;
462
463	mmc-pwrseq = <&emmc_pwrseq>;
464	vmmc-supply = <&vcc_3v3>;
465	vqmmc-supply = <&vcc_1v8>;
466};
467
468&tdmif_b {
469	status = "okay";
470};
471
472&tdmout_b {
473	status = "okay";
474};
475
476&tohdmitx {
477	status = "okay";
478};
479
480&uart_A {
481	status = "okay";
482	pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
483	pinctrl-names = "default";
484	uart-has-rtscts;
485
486	bluetooth {
487		compatible = "brcm,bcm43438-bt";
488		shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
489		max-speed = <2000000>;
490		clocks = <&wifi32k>;
491		clock-names = "lpo";
492	};
493};
494
495&uart_AO {
496	status = "okay";
497	pinctrl-0 = <&uart_ao_a_pins>;
498	pinctrl-names = "default";
499};
500
501&usb {
502	status = "okay";
503};
504