blob: 8445701100d0e40e850c189c1c5a927c45ed9173 [file] [log] [blame]
Tom Rini53633a82024-02-29 12:33:36 -05001// 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
Tom Rini6b642ac2024-10-01 12:20:28 -060036 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
Tom Rini53633a82024-02-29 12:33:36 -050043 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 assigned-clocks = <&clkc CLKID_MPLL2>,
180 <&clkc CLKID_MPLL0>,
181 <&clkc CLKID_MPLL1>;
182 assigned-clock-parents = <0>, <0>, <0>;
183 assigned-clock-rates = <294912000>,
184 <270950400>,
185 <393216000>;
186
187 dai-link-0 {
188 sound-dai = <&frddr_a>;
189 };
190
191 dai-link-1 {
192 sound-dai = <&frddr_b>;
193 };
194
195 dai-link-2 {
196 sound-dai = <&frddr_c>;
197 };
198
199 /* 8ch hdmi interface */
200 dai-link-3 {
201 sound-dai = <&tdmif_b>;
202 dai-format = "i2s";
203 dai-tdm-slot-tx-mask-0 = <1 1>;
204 dai-tdm-slot-tx-mask-1 = <1 1>;
205 dai-tdm-slot-tx-mask-2 = <1 1>;
206 dai-tdm-slot-tx-mask-3 = <1 1>;
207 mclk-fs = <256>;
208
209 codec {
210 sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
211 };
212 };
213
214 /* hdmi glue */
215 dai-link-4 {
216 sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
217
218 codec {
219 sound-dai = <&hdmi_tx>;
220 };
221 };
222 };
223
224 wifi32k: clock-0 {
225 compatible = "pwm-clock";
226 #clock-cells = <0>;
227 clock-frequency = <32768>;
228 pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
229 };
230};
231
232&arb {
233 status = "okay";
234};
235
236&cec_AO {
237 pinctrl-0 = <&cec_ao_a_h_pins>;
238 pinctrl-names = "default";
239 status = "disabled";
240 hdmi-phandle = <&hdmi_tx>;
241};
242
243&cecb_AO {
244 pinctrl-0 = <&cec_ao_b_h_pins>;
245 pinctrl-names = "default";
246 status = "okay";
247 hdmi-phandle = <&hdmi_tx>;
248};
249
250&clkc_audio {
251 status = "okay";
252};
253
254&cpu0 {
255 cpu-supply = <&vddcpu_b>;
256 operating-points-v2 = <&cpu_opp_table_0>;
257 clocks = <&clkc CLKID_CPU_CLK>;
258 clock-latency = <50000>;
259};
260
261&cpu1 {
262 cpu-supply = <&vddcpu_b>;
263 operating-points-v2 = <&cpu_opp_table_0>;
264 clocks = <&clkc CLKID_CPU_CLK>;
265 clock-latency = <50000>;
266};
267
268&cpu100 {
269 cpu-supply = <&vddcpu_a>;
270 operating-points-v2 = <&cpub_opp_table_1>;
271 clocks = <&clkc CLKID_CPUB_CLK>;
272 clock-latency = <50000>;
273};
274
275&cpu101 {
276 cpu-supply = <&vddcpu_a>;
277 operating-points-v2 = <&cpub_opp_table_1>;
278 clocks = <&clkc CLKID_CPUB_CLK>;
279 clock-latency = <50000>;
280};
281
282&cpu102 {
283 cpu-supply = <&vddcpu_a>;
284 operating-points-v2 = <&cpub_opp_table_1>;
285 clocks = <&clkc CLKID_CPUB_CLK>;
286 clock-latency = <50000>;
287};
288
289&cpu103 {
290 cpu-supply = <&vddcpu_a>;
291 operating-points-v2 = <&cpub_opp_table_1>;
292 clocks = <&clkc CLKID_CPUB_CLK>;
293 clock-latency = <50000>;
294};
295
Tom Rini6b642ac2024-10-01 12:20:28 -0600296&cpu_thermal {
297 trips {
298 cpu_active: cpu-active {
299 temperature = <70000>; /* millicelsius */
300 hysteresis = <2000>; /* millicelsius */
301 type = "active";
302 };
303 };
304
305 cooling-maps {
306 map2 {
307 trip = <&cpu_active>;
308 cooling-device = <&fan0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
309 };
310 };
311};
312
Tom Rini53633a82024-02-29 12:33:36 -0500313&frddr_a {
314 status = "okay";
315};
316
317&frddr_b {
318 status = "okay";
319};
320
321&frddr_c {
322 status = "okay";
323};
324
325&gpio {
326 gpio-line-names =
327 /* GPIOZ */
328 "PIN_27", "PIN_28", "PIN_7", "PIN_11", "PIN_13", "PIN_15", "PIN_18", "PIN_40",
329 "", "", "", "", "", "", "", "",
330 /* GPIOH */
331 "", "", "", "", "PIN_19", "PIN_21", "PIN_24", "PIN_23",
332 "",
333 /* BOOT */
334 "", "", "", "", "", "", "", "",
335 "", "", "", "", "EMMC_PWRSEQ", "", "", "",
336 /* GPIOC */
337 "", "", "", "", "", "", "SD_CD", "PIN_36",
338 /* GPIOA */
339 "PIN_32", "PIN_12", "PIN_35", "", "", "PIN_38", "", "",
340 "", "", "", "", "LED_GREEN", "PIN_31", "PIN_3", "PIN_5",
341 /* GPIOX */
342 "", "", "", "", "", "", "SDIO_PWRSEQ", "",
343 "", "", "", "", "", "", "", "",
344 "", "BT_SHUTDOWN", "", "";
345};
346
347&gpio_ao {
348 gpio-line-names =
349 /* GPIOAO */
350 "PIN_8", "PIN_10", "", "BTN_POWER", "", "", "", "PIN_29",
351 "PIN_33", "PIN_37", "FAN", "",
352 /* GPIOE */
353 "", "", "";
354};
355
356&hdmi_tx {
357 status = "okay";
358 pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
359 pinctrl-names = "default";
360 hdmi-supply = <&ao_5v>;
361};
362
363&hdmi_tx_tmds_port {
364 hdmi_tx_tmds_out: endpoint {
365 remote-endpoint = <&hdmi_connector_in>;
366 };
367};
368
369&ir {
370 status = "disabled";
371 pinctrl-0 = <&remote_input_ao_pins>;
372 pinctrl-names = "default";
373};
374
375&pwm_ab {
376 pinctrl-0 = <&pwm_a_e_pins>;
377 pinctrl-names = "default";
378 clocks = <&xtal>;
379 clock-names = "clkin0";
380 status = "okay";
381};
382
383&pwm_ef {
384 pinctrl-0 = <&pwm_e_pins>;
385 pinctrl-names = "default";
386 clocks = <&xtal>;
387 clock-names = "clkin0";
388 status = "okay";
389};
390
391&pwm_AO_ab {
392 pinctrl-0 = <&pwm_ao_a_pins>;
393 pinctrl-names = "default";
394 clocks = <&xtal>;
395 clock-names = "clkin0";
396 status = "okay";
397};
398
399&pwm_AO_cd {
400 pinctrl-0 = <&pwm_ao_d_e_pins>;
401 pinctrl-names = "default";
402 clocks = <&xtal>;
403 clock-names = "clkin1";
404 status = "okay";
405};
406
407&saradc {
408 status = "okay";
409 vref-supply = <&vddao_1v8>;
410};
411
412/* SDIO */
413&sd_emmc_a {
414 status = "okay";
415 pinctrl-0 = <&sdio_pins>;
416 pinctrl-1 = <&sdio_clk_gate_pins>;
417 pinctrl-names = "default", "clk-gate";
418 #address-cells = <1>;
419 #size-cells = <0>;
420
421 bus-width = <4>;
422 cap-sd-highspeed;
423 max-frequency = <100000000>;
424
425 non-removable;
426 disable-wp;
427
428 /* WiFi firmware requires power to be kept while in suspend */
429 keep-power-in-suspend;
430
431 mmc-pwrseq = <&sdio_pwrseq>;
432
433 vmmc-supply = <&vddao_3v3>;
434 vqmmc-supply = <&vddao_1v8>;
435
436 brcmf: wifi@1 {
437 reg = <1>;
438 compatible = "brcm,bcm4329-fmac";
439 };
440};
441
442/* SD card */
443&sd_emmc_b {
444 status = "okay";
445 pinctrl-0 = <&sdcard_c_pins>;
446 pinctrl-1 = <&sdcard_clk_gate_c_pins>;
447 pinctrl-names = "default", "clk-gate";
448
449 bus-width = <4>;
450 cap-sd-highspeed;
451 max-frequency = <50000000>;
452 disable-wp;
453
454 cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
455 vmmc-supply = <&vddao_3v3>;
456 vqmmc-supply = <&vddao_3v3>;
457};
458
459/* eMMC */
460&sd_emmc_c {
461 status = "okay";
462 pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>;
463 pinctrl-1 = <&emmc_clk_gate_pins>;
464 pinctrl-names = "default", "clk-gate";
465
466 bus-width = <8>;
467 cap-mmc-highspeed;
468 mmc-ddr-1_8v;
469 mmc-hs200-1_8v;
470 max-frequency = <200000000>;
471 disable-wp;
472
473 mmc-pwrseq = <&emmc_pwrseq>;
474 vmmc-supply = <&vcc_3v3>;
475 vqmmc-supply = <&vcc_1v8>;
476};
477
478&tdmif_b {
479 status = "okay";
480};
481
482&tdmout_b {
483 status = "okay";
484};
485
486&tohdmitx {
487 status = "okay";
488};
489
490&uart_A {
491 status = "okay";
492 pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
493 pinctrl-names = "default";
494 uart-has-rtscts;
495
496 bluetooth {
497 compatible = "brcm,bcm43438-bt";
498 shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
499 max-speed = <2000000>;
500 clocks = <&wifi32k>;
501 clock-names = "lpo";
502 };
503};
504
505&uart_AO {
506 status = "okay";
507 pinctrl-0 = <&uart_ao_a_pins>;
508 pinctrl-names = "default";
509};
510
511&usb {
512 status = "okay";
513};