| 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) 2023 Christian Hewitt <[email protected]> |
| 6 |
*/ |
| 7 |
|
| 8 |
#include <dt-bindings/input/input.h> |
| 9 |
#include <dt-bindings/leds/common.h> |
| 10 |
#include <dt-bindings/gpio/meson-g12a-gpio.h> |
| 11 |
#include <dt-bindings/sound/meson-g12a-tohdmitx.h> |
| 12 |
|
| 13 |
/ { |
| 14 |
aliases { |
| 15 |
serial0 = &uart_AO; |
| 16 |
ethernet0 = ðmac; |
| 17 |
rtc1 = &vrtc; |
| 18 |
}; |
| 19 |
|
| 20 |
chosen { |
| 21 |
stdout-path = "serial0:115200n8"; |
| 22 |
}; |
| 23 |
|
| 24 |
memory@0 { |
| 25 |
device_type = "memory"; |
| 26 |
reg = <0x0 0x0 0x0 0x80000000>; /* 2 GiB or 4 GiB */ |
| 27 |
}; |
| 28 |
|
| 29 |
adc-keys { |
| 30 |
compatible = "adc-keys"; |
| 31 |
io-channels = <&saradc 2>; |
| 32 |
io-channel-names = "buttons"; |
| 33 |
keyup-threshold-microvolt = <1710000>; |
| 34 |
|
| 35 |
button-function { |
| 36 |
label = "RST"; |
| 37 |
linux,code = <KEY_POWER>; |
| 38 |
press-threshold-microvolt = <10000>; |
| 39 |
}; |
| 40 |
}; |
| 41 |
|
| 42 |
emmc_pwrseq: emmc-pwrseq { |
| 43 |
compatible = "mmc-pwrseq-emmc"; |
| 44 |
reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>; |
| 45 |
}; |
| 46 |
|
| 47 |
hdmi-connector { |
| 48 |
compatible = "hdmi-connector"; |
| 49 |
type = "a"; |
| 50 |
|
| 51 |
port { |
| 52 |
hdmi_connector_in: endpoint { |
| 53 |
remote-endpoint = <&hdmi_tx_tmds_out>; |
| 54 |
}; |
| 55 |
}; |
| 56 |
}; |
| 57 |
|
| 58 |
leds { |
| 59 |
compatible = "gpio-leds"; |
| 60 |
|
| 61 |
led-0 { |
| 62 |
color = <LED_COLOR_ID_BLUE>; |
| 63 |
function = LED_FUNCTION_STATUS; |
| 64 |
gpios = <&gpio_ao GPIOAO_7 GPIO_ACTIVE_LOW>; |
| 65 |
linux,default-trigger = "heartbeat"; |
| 66 |
}; |
| 67 |
|
| 68 |
led-1 { |
| 69 |
color = <LED_COLOR_ID_GREEN>; |
| 70 |
function = LED_FUNCTION_STATUS; |
| 71 |
gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>; |
| 72 |
}; |
| 73 |
}; |
| 74 |
|
| 75 |
sdio_pwrseq: sdio-pwrseq { |
| 76 |
compatible = "mmc-pwrseq-simple"; |
| 77 |
reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>; |
| 78 |
clocks = <&wifi32k>; |
| 79 |
clock-names = "ext_clock"; |
| 80 |
}; |
| 81 |
|
| 82 |
wifi32k: wifi32k { |
| 83 |
compatible = "pwm-clock"; |
| 84 |
#clock-cells = <0>; |
| 85 |
clock-frequency = <32768>; |
| 86 |
pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */ |
| 87 |
}; |
| 88 |
|
| 89 |
dc_in: regulator-dc-in { |
| 90 |
compatible = "regulator-fixed"; |
| 91 |
regulator-name = "DC_IN"; |
| 92 |
regulator-min-microvolt = <5000000>; |
| 93 |
regulator-max-microvolt = <5000000>; |
| 94 |
regulator-always-on; |
| 95 |
}; |
| 96 |
|
| 97 |
vcc_5v: regulator-vcc-5v { |
| 98 |
compatible = "regulator-fixed"; |
| 99 |
regulator-name = "VCC_5V"; |
| 100 |
regulator-min-microvolt = <5000000>; |
| 101 |
regulator-max-microvolt = <5000000>; |
| 102 |
vin-supply = <&dc_in>; |
| 103 |
|
| 104 |
gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>; |
| 105 |
enable-active-high; |
| 106 |
}; |
| 107 |
|
| 108 |
vcc_3v3: regulator-vcc-3v3 { |
| 109 |
compatible = "regulator-fixed"; |
| 110 |
regulator-name = "VCC_3V3"; |
| 111 |
regulator-min-microvolt = <3300000>; |
| 112 |
regulator-max-microvolt = <3300000>; |
| 113 |
vin-supply = <&vsys_3v3>; |
| 114 |
regulator-always-on; |
| 115 |
}; |
| 116 |
|
| 117 |
vcc_1v8: regulator-vcc-1v8 { |
| 118 |
compatible = "regulator-fixed"; |
| 119 |
regulator-name = "VCC_1V8"; |
| 120 |
regulator-min-microvolt = <1800000>; |
| 121 |
regulator-max-microvolt = <1800000>; |
| 122 |
vin-supply = <&vcc_3v3>; |
| 123 |
regulator-always-on; |
| 124 |
}; |
| 125 |
|
| 126 |
vddao_1v8: regulator-vddao-1v8 { |
| 127 |
compatible = "regulator-fixed"; |
| 128 |
regulator-name = "VDDIO_AO1V8"; |
| 129 |
regulator-min-microvolt = <1800000>; |
| 130 |
regulator-max-microvolt = <1800000>; |
| 131 |
vin-supply = <&vsys_3v3>; |
| 132 |
regulator-always-on; |
| 133 |
}; |
| 134 |
|
| 135 |
vddcpu_a: regulator-vddcpu-a { |
| 136 |
compatible = "pwm-regulator"; |
| 137 |
regulator-name = "VDDCPU_A"; |
| 138 |
regulator-min-microvolt = <690000>; |
| 139 |
regulator-max-microvolt = <1050000>; |
| 140 |
pwm-supply = <&dc_in>; |
| 141 |
pwms = <&pwm_ab 0 1250 0>; |
| 142 |
pwm-dutycycle-range = <100 0>; |
| 143 |
regulator-boot-on; |
| 144 |
regulator-always-on; |
| 145 |
}; |
| 146 |
|
| 147 |
vddcpu_b: regulator-vddcpu-b { |
| 148 |
compatible = "pwm-regulator"; |
| 149 |
regulator-name = "VDDCPU_B"; |
| 150 |
regulator-min-microvolt = <690000>; |
| 151 |
regulator-max-microvolt = <1050000>; |
| 152 |
pwm-supply = <&vsys_3v3>; |
| 153 |
pwms = <&pwm_AO_cd 1 1250 0>; |
| 154 |
pwm-dutycycle-range = <100 0>; |
| 155 |
regulator-boot-on; |
| 156 |
regulator-always-on; |
| 157 |
}; |
| 158 |
|
| 159 |
vsys_3v3: regulator-vsys-3v3 { |
| 160 |
compatible = "regulator-fixed"; |
| 161 |
regulator-name = "VSYS_3V3"; |
| 162 |
regulator-min-microvolt = <3300000>; |
| 163 |
regulator-max-microvolt = <3300000>; |
| 164 |
vin-supply = <&dc_in>; |
| 165 |
regulator-always-on; |
| 166 |
}; |
| 167 |
|
| 168 |
emmc_1v8: regulator-emmc-1v8 { |
| 169 |
compatible = "regulator-fixed"; |
| 170 |
regulator-name = "EMMC_AO1V8"; |
| 171 |
regulator-min-microvolt = <1800000>; |
| 172 |
regulator-max-microvolt = <1800000>; |
| 173 |
vin-supply = <&vcc_3v3>; |
| 174 |
regulator-always-on; |
| 175 |
}; |
| 176 |
|
| 177 |
usb_pwr: regulator-usb-pwr { |
| 178 |
compatible = "regulator-fixed"; |
| 179 |
regulator-name = "USB_PWR"; |
| 180 |
regulator-min-microvolt = <5000000>; |
| 181 |
regulator-max-microvolt = <5000000>; |
| 182 |
vin-supply = <&vcc_5v>; |
| 183 |
|
| 184 |
gpio = <&gpio GPIOA_6 GPIO_ACTIVE_HIGH>; |
| 185 |
enable-active-high; |
| 186 |
}; |
| 187 |
|
| 188 |
sound { |
| 189 |
compatible = "amlogic,axg-sound-card"; |
| 190 |
model = "BPI-M2S"; |
| 191 |
audio-aux-devs = <&tdmout_b>; |
| 192 |
audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1", |
| 193 |
"TDMOUT_B IN 1", "FRDDR_B OUT 1", |
| 194 |
"TDMOUT_B IN 2", "FRDDR_C OUT 1", |
| 195 |
"TDM_B Playback", "TDMOUT_B OUT"; |
| 196 |
|
| 197 |
clocks = <&clkc CLKID_MPLL2>, |
| 198 |
<&clkc CLKID_MPLL0>, |
| 199 |
<&clkc CLKID_MPLL1>; |
| 200 |
|
| 201 |
assigned-clocks = <&clkc CLKID_MPLL2>, |
| 202 |
<&clkc CLKID_MPLL0>, |
| 203 |
<&clkc CLKID_MPLL1>; |
| 204 |
assigned-clock-rates = <294912000>, |
| 205 |
<270950400>, |
| 206 |
<393216000>; |
| 207 |
|
| 208 |
dai-link-0 { |
| 209 |
sound-dai = <&frddr_a>; |
| 210 |
}; |
| 211 |
|
| 212 |
dai-link-1 { |
| 213 |
sound-dai = <&frddr_b>; |
| 214 |
}; |
| 215 |
|
| 216 |
dai-link-2 { |
| 217 |
sound-dai = <&frddr_c>; |
| 218 |
}; |
| 219 |
|
| 220 |
/* 8ch hdmi interface */ |
| 221 |
dai-link-3 { |
| 222 |
sound-dai = <&tdmif_b>; |
| 223 |
dai-format = "i2s"; |
| 224 |
dai-tdm-slot-tx-mask-0 = <1 1>; |
| 225 |
dai-tdm-slot-tx-mask-1 = <1 1>; |
| 226 |
dai-tdm-slot-tx-mask-2 = <1 1>; |
| 227 |
dai-tdm-slot-tx-mask-3 = <1 1>; |
| 228 |
mclk-fs = <256>; |
| 229 |
|
| 230 |
codec { |
| 231 |
sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>; |
| 232 |
}; |
| 233 |
}; |
| 234 |
|
| 235 |
/* hdmi glue */ |
| 236 |
dai-link-4 { |
| 237 |
sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>; |
| 238 |
|
| 239 |
codec { |
| 240 |
sound-dai = <&hdmi_tx>; |
| 241 |
}; |
| 242 |
}; |
| 243 |
}; |
| 244 |
}; |
| 245 |
|
| 246 |
&arb { |
| 247 |
status = "okay"; |
| 248 |
}; |
| 249 |
|
| 250 |
&clkc_audio { |
| 251 |
status = "okay"; |
| 252 |
}; |
| 253 |
|
| 254 |
&cecb_AO { |
| 255 |
pinctrl-0 = <&cec_ao_b_h_pins>; |
| 256 |
pinctrl-names = "default"; |
| 257 |
status = "okay"; |
| 258 |
hdmi-phandle = <&hdmi_tx>; |
| 259 |
}; |
| 260 |
|
| 261 |
&cpu0 { |
| 262 |
cpu-supply = <&vddcpu_b>; |
| 263 |
}; |
| 264 |
|
| 265 |
&cpu1 { |
| 266 |
cpu-supply = <&vddcpu_b>; |
| 267 |
}; |
| 268 |
|
| 269 |
&cpu100 { |
| 270 |
cpu-supply = <&vddcpu_a>; |
| 271 |
}; |
| 272 |
|
| 273 |
&cpu101 { |
| 274 |
cpu-supply = <&vddcpu_a>; |
| 275 |
}; |
| 276 |
|
| 277 |
&cpu102 { |
| 278 |
cpu-supply = <&vddcpu_a>; |
| 279 |
}; |
| 280 |
|
| 281 |
&cpu103 { |
| 282 |
cpu-supply = <&vddcpu_a>; |
| 283 |
}; |
| 284 |
|
| 285 |
ðmac { |
| 286 |
pinctrl-0 = <ð_pins>, <ð_rgmii_pins>; |
| 287 |
pinctrl-names = "default"; |
| 288 |
status = "okay"; |
| 289 |
phy-mode = "rgmii"; |
| 290 |
phy-handle = <&external_phy>; |
| 291 |
amlogic,tx-delay-ns = <2>; |
| 292 |
}; |
| 293 |
|
| 294 |
&ext_mdio { |
| 295 |
external_phy: ethernet-phy@0 { |
| 296 |
/* Realtek RTL8211F (0x001cc916) */ |
| 297 |
reg = <0>; |
| 298 |
max-speed = <1000>; |
| 299 |
|
| 300 |
reset-assert-us = <10000>; |
| 301 |
reset-deassert-us = <80000>; |
| 302 |
reset-gpios = <&gpio GPIOZ_15 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>; |
| 303 |
|
| 304 |
interrupt-parent = <&gpio_intc>; |
| 305 |
/* MAC_INTR on GPIOZ_14 */ |
| 306 |
interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>; |
| 307 |
}; |
| 308 |
}; |
| 309 |
|
| 310 |
&frddr_a { |
| 311 |
status = "okay"; |
| 312 |
}; |
| 313 |
|
| 314 |
&frddr_b { |
| 315 |
status = "okay"; |
| 316 |
}; |
| 317 |
|
| 318 |
&frddr_c { |
| 319 |
status = "okay"; |
| 320 |
}; |
| 321 |
|
| 322 |
&hdmi_tx { |
| 323 |
status = "okay"; |
| 324 |
pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>; |
| 325 |
pinctrl-names = "default"; |
| 326 |
hdmi-supply = <&vcc_5v>; |
| 327 |
}; |
| 328 |
|
| 329 |
&hdmi_tx_tmds_port { |
| 330 |
hdmi_tx_tmds_out: endpoint { |
| 331 |
remote-endpoint = <&hdmi_connector_in>; |
| 332 |
}; |
| 333 |
}; |
| 334 |
|
| 335 |
/* Main i2c bus */ |
| 336 |
&i2c2 { |
| 337 |
status = "okay"; |
| 338 |
pinctrl-0 = <&i2c2_sda_x_pins>, <&i2c2_sck_x_pins>; |
| 339 |
pinctrl-names = "default"; |
| 340 |
}; |
| 341 |
|
| 342 |
&pcie { |
| 343 |
status = "okay"; |
| 344 |
reset-gpios = <&gpio GPIOA_8 GPIO_ACTIVE_LOW>; |
| 345 |
}; |
| 346 |
|
| 347 |
&pwm_ab { |
| 348 |
status = "okay"; |
| 349 |
pinctrl-0 = <&pwm_a_e_pins>; |
| 350 |
pinctrl-names = "default"; |
| 351 |
}; |
| 352 |
|
| 353 |
&pwm_ef { |
| 354 |
status = "okay"; |
| 355 |
pinctrl-0 = <&pwm_e_pins>; |
| 356 |
pinctrl-names = "default"; |
| 357 |
}; |
| 358 |
|
| 359 |
&pwm_AO_cd { |
| 360 |
pinctrl-0 = <&pwm_ao_d_e_pins>; |
| 361 |
pinctrl-names = "default"; |
| 362 |
status = "okay"; |
| 363 |
}; |
| 364 |
|
| 365 |
&saradc { |
| 366 |
status = "okay"; |
| 367 |
vref-supply = <&vddao_1v8>; |
| 368 |
}; |
| 369 |
|
| 370 |
/* SDIO */ |
| 371 |
&sd_emmc_a { |
| 372 |
/* enable if WiFi/BT board connected */ |
| 373 |
status = "disabled"; |
| 374 |
pinctrl-0 = <&sdio_pins>; |
| 375 |
pinctrl-1 = <&sdio_clk_gate_pins>; |
| 376 |
pinctrl-names = "default", "clk-gate"; |
| 377 |
#address-cells = <1>; |
| 378 |
#size-cells = <0>; |
| 379 |
|
| 380 |
bus-width = <4>; |
| 381 |
sd-uhs-sdr104; |
| 382 |
max-frequency = <50000000>; |
| 383 |
|
| 384 |
non-removable; |
| 385 |
disable-wp; |
| 386 |
|
| 387 |
/* WiFi firmware requires power in suspend */ |
| 388 |
keep-power-in-suspend; |
| 389 |
|
| 390 |
mmc-pwrseq = <&sdio_pwrseq>; |
| 391 |
|
| 392 |
vmmc-supply = <&vsys_3v3>; |
| 393 |
vqmmc-supply = <&vddao_1v8>; |
| 394 |
|
| 395 |
rtl8822cs: wifi@1 { |
| 396 |
reg = <1>; |
| 397 |
}; |
| 398 |
}; |
| 399 |
|
| 400 |
/* SD card */ |
| 401 |
&sd_emmc_b { |
| 402 |
status = "okay"; |
| 403 |
pinctrl-0 = <&sdcard_c_pins>; |
| 404 |
pinctrl-1 = <&sdcard_clk_gate_c_pins>; |
| 405 |
pinctrl-names = "default", "clk-gate"; |
| 406 |
|
| 407 |
bus-width = <4>; |
| 408 |
cap-sd-highspeed; |
| 409 |
max-frequency = <50000000>; |
| 410 |
disable-wp; |
| 411 |
|
| 412 |
cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>; |
| 413 |
vmmc-supply = <&vsys_3v3>; |
| 414 |
vqmmc-supply = <&vsys_3v3>; |
| 415 |
}; |
| 416 |
|
| 417 |
/* eMMC */ |
| 418 |
&sd_emmc_c { |
| 419 |
status = "okay"; |
| 420 |
pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>; |
| 421 |
pinctrl-1 = <&emmc_clk_gate_pins>; |
| 422 |
pinctrl-names = "default", "clk-gate"; |
| 423 |
|
| 424 |
bus-width = <8>; |
| 425 |
cap-mmc-highspeed; |
| 426 |
mmc-ddr-1_8v; |
| 427 |
mmc-hs200-1_8v; |
| 428 |
max-frequency = <200000000>; |
| 429 |
disable-wp; |
| 430 |
|
| 431 |
mmc-pwrseq = <&emmc_pwrseq>; |
| 432 |
vmmc-supply = <&vcc_3v3>; |
| 433 |
vqmmc-supply = <&emmc_1v8>; |
| 434 |
}; |
| 435 |
|
| 436 |
&tdmif_b { |
| 437 |
status = "okay"; |
| 438 |
}; |
| 439 |
|
| 440 |
&tdmout_b { |
| 441 |
status = "okay"; |
| 442 |
}; |
| 443 |
|
| 444 |
&tohdmitx { |
| 445 |
status = "okay"; |
| 446 |
}; |
| 447 |
|
| 448 |
&uart_A { |
| 449 |
/* enable if WiFi/BT board connected */ |
| 450 |
status = "disabled"; |
| 451 |
pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>; |
| 452 |
pinctrl-names = "default"; |
| 453 |
uart-has-rtscts; |
| 454 |
|
| 455 |
bluetooth { |
| 456 |
compatible = "realtek,rtl8822cs-bt"; |
| 457 |
enable-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; |
| 458 |
host-wake-gpios = <&gpio GPIOX_19 GPIO_ACTIVE_HIGH>; |
| 459 |
device-wake-gpios = <&gpio GPIOX_18 GPIO_ACTIVE_HIGH>; |
| 460 |
}; |
| 461 |
}; |
| 462 |
|
| 463 |
&uart_AO { |
| 464 |
status = "okay"; |
| 465 |
pinctrl-0 = <&uart_ao_a_pins>; |
| 466 |
pinctrl-names = "default"; |
| 467 |
}; |
| 468 |
|
| 469 |
&usb2_phy0 { |
| 470 |
phy-supply = <&dc_in>; |
| 471 |
}; |
| 472 |
|
| 473 |
&usb2_phy1 { |
| 474 |
phy-supply = <&usb_pwr>; |
| 475 |
}; |
| 476 |
|
| 477 |
&usb3_pcie_phy { |
| 478 |
phy-supply = <&usb_pwr>; |
| 479 |
}; |
| 480 |
|
| 481 |
&usb { |
| 482 |
status = "okay"; |
| 483 |
dr_mode = "peripheral"; |
| 484 |
phys = <&usb2_phy0>, <&usb2_phy1>; |
| 485 |
phy-names = "usb2-phy0", "usb2-phy1"; |
| 486 |
}; |