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