blob: 39feba7f2d0830c72233824dbe08f98b073722a7 [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
Tom Rini9c8af152024-12-24 12:03:04 -0600179 clocks = <&clkc CLKID_MPLL2>,
180 <&clkc CLKID_MPLL0>,
181 <&clkc CLKID_MPLL1>;
182
Tom Rini53633a82024-02-29 12:33:36 -0500183 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 clock-latency = <50000>;
263};
264
265&cpu1 {
266 cpu-supply = <&vddcpu_b>;
267 operating-points-v2 = <&cpu_opp_table_0>;
268 clocks = <&clkc CLKID_CPU_CLK>;
269 clock-latency = <50000>;
270};
271
272&cpu100 {
273 cpu-supply = <&vddcpu_a>;
274 operating-points-v2 = <&cpub_opp_table_1>;
275 clocks = <&clkc CLKID_CPUB_CLK>;
276 clock-latency = <50000>;
277};
278
279&cpu101 {
280 cpu-supply = <&vddcpu_a>;
281 operating-points-v2 = <&cpub_opp_table_1>;
282 clocks = <&clkc CLKID_CPUB_CLK>;
283 clock-latency = <50000>;
284};
285
286&cpu102 {
287 cpu-supply = <&vddcpu_a>;
288 operating-points-v2 = <&cpub_opp_table_1>;
289 clocks = <&clkc CLKID_CPUB_CLK>;
290 clock-latency = <50000>;
291};
292
293&cpu103 {
294 cpu-supply = <&vddcpu_a>;
295 operating-points-v2 = <&cpub_opp_table_1>;
296 clocks = <&clkc CLKID_CPUB_CLK>;
297 clock-latency = <50000>;
298};
299
Tom Rini6b642ac2024-10-01 12:20:28 -0600300&cpu_thermal {
301 trips {
302 cpu_active: cpu-active {
303 temperature = <70000>; /* millicelsius */
304 hysteresis = <2000>; /* millicelsius */
305 type = "active";
306 };
307 };
308
309 cooling-maps {
310 map2 {
311 trip = <&cpu_active>;
312 cooling-device = <&fan0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
313 };
314 };
315};
316
Tom Rini53633a82024-02-29 12:33:36 -0500317&frddr_a {
318 status = "okay";
319};
320
321&frddr_b {
322 status = "okay";
323};
324
325&frddr_c {
326 status = "okay";
327};
328
329&gpio {
330 gpio-line-names =
331 /* GPIOZ */
332 "PIN_27", "PIN_28", "PIN_7", "PIN_11", "PIN_13", "PIN_15", "PIN_18", "PIN_40",
333 "", "", "", "", "", "", "", "",
334 /* GPIOH */
335 "", "", "", "", "PIN_19", "PIN_21", "PIN_24", "PIN_23",
336 "",
337 /* BOOT */
338 "", "", "", "", "", "", "", "",
339 "", "", "", "", "EMMC_PWRSEQ", "", "", "",
340 /* GPIOC */
341 "", "", "", "", "", "", "SD_CD", "PIN_36",
342 /* GPIOA */
343 "PIN_32", "PIN_12", "PIN_35", "", "", "PIN_38", "", "",
344 "", "", "", "", "LED_GREEN", "PIN_31", "PIN_3", "PIN_5",
345 /* GPIOX */
346 "", "", "", "", "", "", "SDIO_PWRSEQ", "",
347 "", "", "", "", "", "", "", "",
348 "", "BT_SHUTDOWN", "", "";
349};
350
351&gpio_ao {
352 gpio-line-names =
353 /* GPIOAO */
354 "PIN_8", "PIN_10", "", "BTN_POWER", "", "", "", "PIN_29",
355 "PIN_33", "PIN_37", "FAN", "",
356 /* GPIOE */
357 "", "", "";
358};
359
360&hdmi_tx {
361 status = "okay";
362 pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
363 pinctrl-names = "default";
364 hdmi-supply = <&ao_5v>;
365};
366
367&hdmi_tx_tmds_port {
368 hdmi_tx_tmds_out: endpoint {
369 remote-endpoint = <&hdmi_connector_in>;
370 };
371};
372
373&ir {
374 status = "disabled";
375 pinctrl-0 = <&remote_input_ao_pins>;
376 pinctrl-names = "default";
377};
378
379&pwm_ab {
380 pinctrl-0 = <&pwm_a_e_pins>;
381 pinctrl-names = "default";
382 clocks = <&xtal>;
383 clock-names = "clkin0";
384 status = "okay";
385};
386
387&pwm_ef {
388 pinctrl-0 = <&pwm_e_pins>;
389 pinctrl-names = "default";
390 clocks = <&xtal>;
391 clock-names = "clkin0";
392 status = "okay";
393};
394
395&pwm_AO_ab {
396 pinctrl-0 = <&pwm_ao_a_pins>;
397 pinctrl-names = "default";
398 clocks = <&xtal>;
399 clock-names = "clkin0";
400 status = "okay";
401};
402
403&pwm_AO_cd {
404 pinctrl-0 = <&pwm_ao_d_e_pins>;
405 pinctrl-names = "default";
406 clocks = <&xtal>;
407 clock-names = "clkin1";
408 status = "okay";
409};
410
411&saradc {
412 status = "okay";
413 vref-supply = <&vddao_1v8>;
414};
415
416/* SDIO */
417&sd_emmc_a {
418 status = "okay";
419 pinctrl-0 = <&sdio_pins>;
420 pinctrl-1 = <&sdio_clk_gate_pins>;
421 pinctrl-names = "default", "clk-gate";
422 #address-cells = <1>;
423 #size-cells = <0>;
424
425 bus-width = <4>;
426 cap-sd-highspeed;
427 max-frequency = <100000000>;
428
429 non-removable;
430 disable-wp;
431
432 /* WiFi firmware requires power to be kept while in suspend */
433 keep-power-in-suspend;
434
435 mmc-pwrseq = <&sdio_pwrseq>;
436
437 vmmc-supply = <&vddao_3v3>;
438 vqmmc-supply = <&vddao_1v8>;
439
440 brcmf: wifi@1 {
441 reg = <1>;
442 compatible = "brcm,bcm4329-fmac";
443 };
444};
445
446/* SD card */
447&sd_emmc_b {
448 status = "okay";
449 pinctrl-0 = <&sdcard_c_pins>;
450 pinctrl-1 = <&sdcard_clk_gate_c_pins>;
451 pinctrl-names = "default", "clk-gate";
452
453 bus-width = <4>;
454 cap-sd-highspeed;
455 max-frequency = <50000000>;
456 disable-wp;
457
458 cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
459 vmmc-supply = <&vddao_3v3>;
460 vqmmc-supply = <&vddao_3v3>;
461};
462
463/* eMMC */
464&sd_emmc_c {
465 status = "okay";
466 pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>;
467 pinctrl-1 = <&emmc_clk_gate_pins>;
468 pinctrl-names = "default", "clk-gate";
469
470 bus-width = <8>;
471 cap-mmc-highspeed;
472 mmc-ddr-1_8v;
473 mmc-hs200-1_8v;
474 max-frequency = <200000000>;
475 disable-wp;
476
477 mmc-pwrseq = <&emmc_pwrseq>;
478 vmmc-supply = <&vcc_3v3>;
479 vqmmc-supply = <&vcc_1v8>;
480};
481
482&tdmif_b {
483 status = "okay";
484};
485
486&tdmout_b {
487 status = "okay";
488};
489
490&tohdmitx {
491 status = "okay";
492};
493
494&uart_A {
495 status = "okay";
496 pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
497 pinctrl-names = "default";
498 uart-has-rtscts;
499
500 bluetooth {
501 compatible = "brcm,bcm43438-bt";
502 shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
503 max-speed = <2000000>;
504 clocks = <&wifi32k>;
505 clock-names = "lpo";
506 };
507};
508
509&uart_AO {
510 status = "okay";
511 pinctrl-0 = <&uart_ao_a_pins>;
512 pinctrl-names = "default";
513};
514
515&usb {
516 status = "okay";
517};