| 1 |
// SPDX-License-Identifier: (GPL-2.0+ OR MIT) |
| 2 |
/* |
| 3 |
* Copyright (c) 2018 BayLibre SAS. All rights reserved. |
| 4 |
*/ |
| 5 |
|
| 6 |
/dts-v1/; |
| 7 |
|
| 8 |
#include "meson-g12a.dtsi" |
| 9 |
#include <dt-bindings/gpio/gpio.h> |
| 10 |
#include <dt-bindings/gpio/meson-g12a-gpio.h> |
| 11 |
#include <dt-bindings/sound/meson-g12a-tohdmitx.h> |
| 12 |
|
| 13 |
/ { |
| 14 |
compatible = "amediatech,x96-max", "amlogic,g12a"; |
| 15 |
model = "Shenzhen Amediatech Technology Co., Ltd X96 Max"; |
| 16 |
|
| 17 |
aliases { |
| 18 |
serial0 = &uart_AO; |
| 19 |
ethernet0 = ðmac; |
| 20 |
}; |
| 21 |
|
| 22 |
spdif_dit: audio-codec-1 { |
| 23 |
#sound-dai-cells = <0>; |
| 24 |
compatible = "linux,spdif-dit"; |
| 25 |
sound-name-prefix = "DIT"; |
| 26 |
}; |
| 27 |
|
| 28 |
chosen { |
| 29 |
stdout-path = "serial0:115200n8"; |
| 30 |
}; |
| 31 |
memory@0 { |
| 32 |
device_type = "memory"; |
| 33 |
reg = <0x0 0x0 0x0 0x40000000>; |
| 34 |
}; |
| 35 |
|
| 36 |
cvbs-connector { |
| 37 |
compatible = "composite-video-connector"; |
| 38 |
|
| 39 |
port { |
| 40 |
cvbs_connector_in: endpoint { |
| 41 |
remote-endpoint = <&cvbs_vdac_out>; |
| 42 |
}; |
| 43 |
}; |
| 44 |
}; |
| 45 |
|
| 46 |
hdmi-connector { |
| 47 |
compatible = "hdmi-connector"; |
| 48 |
type = "a"; |
| 49 |
|
| 50 |
port { |
| 51 |
hdmi_connector_in: endpoint { |
| 52 |
remote-endpoint = <&hdmi_tx_tmds_out>; |
| 53 |
}; |
| 54 |
}; |
| 55 |
}; |
| 56 |
|
| 57 |
emmc_pwrseq: emmc-pwrseq { |
| 58 |
compatible = "mmc-pwrseq-emmc"; |
| 59 |
reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>; |
| 60 |
}; |
| 61 |
|
| 62 |
sdio_pwrseq: sdio-pwrseq { |
| 63 |
compatible = "mmc-pwrseq-simple"; |
| 64 |
reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>; |
| 65 |
clocks = <&wifi32k>; |
| 66 |
clock-names = "ext_clock"; |
| 67 |
}; |
| 68 |
|
| 69 |
flash_1v8: regulator-flash-1v8 { |
| 70 |
compatible = "regulator-fixed"; |
| 71 |
regulator-name = "FLASH_1V8"; |
| 72 |
regulator-min-microvolt = <1800000>; |
| 73 |
regulator-max-microvolt = <1800000>; |
| 74 |
vin-supply = <&vcc_3v3>; |
| 75 |
regulator-always-on; |
| 76 |
}; |
| 77 |
|
| 78 |
dc_in: regulator-dc-in { |
| 79 |
compatible = "regulator-fixed"; |
| 80 |
regulator-name = "DC_IN"; |
| 81 |
regulator-min-microvolt = <5000000>; |
| 82 |
regulator-max-microvolt = <5000000>; |
| 83 |
regulator-always-on; |
| 84 |
}; |
| 85 |
|
| 86 |
vcc_1v8: regulator-vcc-1v8 { |
| 87 |
compatible = "regulator-fixed"; |
| 88 |
regulator-name = "VCC_1V8"; |
| 89 |
regulator-min-microvolt = <1800000>; |
| 90 |
regulator-max-microvolt = <1800000>; |
| 91 |
vin-supply = <&vcc_3v3>; |
| 92 |
regulator-always-on; |
| 93 |
}; |
| 94 |
|
| 95 |
vcc_3v3: regulator-vcc-3v3 { |
| 96 |
compatible = "regulator-fixed"; |
| 97 |
regulator-name = "VCC_3V3"; |
| 98 |
regulator-min-microvolt = <3300000>; |
| 99 |
regulator-max-microvolt = <3300000>; |
| 100 |
vin-supply = <&vddao_3v3>; |
| 101 |
regulator-always-on; |
| 102 |
/* FIXME: actually controlled by VDDCPU_B_EN */ |
| 103 |
}; |
| 104 |
|
| 105 |
vcc_5v: regulator-vcc-5v { |
| 106 |
compatible = "regulator-fixed"; |
| 107 |
regulator-name = "VCC_5V"; |
| 108 |
regulator-min-microvolt = <5000000>; |
| 109 |
regulator-max-microvolt = <5000000>; |
| 110 |
vin-supply = <&dc_in>; |
| 111 |
|
| 112 |
gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>; |
| 113 |
}; |
| 114 |
|
| 115 |
vddao_1v8: regulator-vddao-1v8 { |
| 116 |
compatible = "regulator-fixed"; |
| 117 |
regulator-name = "VDDAO_1V8"; |
| 118 |
regulator-min-microvolt = <1800000>; |
| 119 |
regulator-max-microvolt = <1800000>; |
| 120 |
vin-supply = <&vddao_3v3>; |
| 121 |
regulator-always-on; |
| 122 |
}; |
| 123 |
|
| 124 |
vddao_3v3: regulator-vddao-3v3 { |
| 125 |
compatible = "regulator-fixed"; |
| 126 |
regulator-name = "VDDAO_3V3"; |
| 127 |
regulator-min-microvolt = <3300000>; |
| 128 |
regulator-max-microvolt = <3300000>; |
| 129 |
vin-supply = <&dc_in>; |
| 130 |
regulator-always-on; |
| 131 |
}; |
| 132 |
|
| 133 |
vddcpu: regulator-vddcpu { |
| 134 |
compatible = "pwm-regulator"; |
| 135 |
|
| 136 |
regulator-name = "VDDCPU"; |
| 137 |
regulator-min-microvolt = <721000>; |
| 138 |
regulator-max-microvolt = <1022000>; |
| 139 |
|
| 140 |
pwm-supply = <&dc_in>; |
| 141 |
|
| 142 |
pwms = <&pwm_AO_cd 1 1250 0>; |
| 143 |
pwm-dutycycle-range = <100 0>; |
| 144 |
|
| 145 |
regulator-boot-on; |
| 146 |
regulator-always-on; |
| 147 |
}; |
| 148 |
|
| 149 |
sound { |
| 150 |
compatible = "amlogic,axg-sound-card"; |
| 151 |
model = "X96-MAX"; |
| 152 |
audio-aux-devs = <&tdmout_b>; |
| 153 |
audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1", |
| 154 |
"TDMOUT_B IN 1", "FRDDR_B OUT 1", |
| 155 |
"TDMOUT_B IN 2", "FRDDR_C OUT 1", |
| 156 |
"TDM_B Playback", "TDMOUT_B OUT", |
| 157 |
"SPDIFOUT_A IN 0", "FRDDR_A OUT 3", |
| 158 |
"SPDIFOUT_A IN 1", "FRDDR_B OUT 3", |
| 159 |
"SPDIFOUT_A IN 2", "FRDDR_C OUT 3"; |
| 160 |
|
| 161 |
clocks = <&clkc CLKID_MPLL2>, |
| 162 |
<&clkc CLKID_MPLL0>, |
| 163 |
<&clkc CLKID_MPLL1>; |
| 164 |
|
| 165 |
assigned-clocks = <&clkc CLKID_MPLL2>, |
| 166 |
<&clkc CLKID_MPLL0>, |
| 167 |
<&clkc CLKID_MPLL1>; |
| 168 |
assigned-clock-rates = <294912000>, |
| 169 |
<270950400>, |
| 170 |
<393216000>; |
| 171 |
|
| 172 |
dai-link-0 { |
| 173 |
sound-dai = <&frddr_a>; |
| 174 |
}; |
| 175 |
|
| 176 |
dai-link-1 { |
| 177 |
sound-dai = <&frddr_b>; |
| 178 |
}; |
| 179 |
|
| 180 |
dai-link-2 { |
| 181 |
sound-dai = <&frddr_c>; |
| 182 |
}; |
| 183 |
|
| 184 |
/* 8ch hdmi interface */ |
| 185 |
dai-link-3 { |
| 186 |
sound-dai = <&tdmif_b>; |
| 187 |
dai-format = "i2s"; |
| 188 |
dai-tdm-slot-tx-mask-0 = <1 1>; |
| 189 |
dai-tdm-slot-tx-mask-1 = <1 1>; |
| 190 |
dai-tdm-slot-tx-mask-2 = <1 1>; |
| 191 |
dai-tdm-slot-tx-mask-3 = <1 1>; |
| 192 |
mclk-fs = <256>; |
| 193 |
|
| 194 |
codec { |
| 195 |
sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>; |
| 196 |
}; |
| 197 |
}; |
| 198 |
|
| 199 |
/* spdif hdmi or toslink interface */ |
| 200 |
dai-link-4 { |
| 201 |
sound-dai = <&spdifout_a>; |
| 202 |
|
| 203 |
codec-0 { |
| 204 |
sound-dai = <&spdif_dit>; |
| 205 |
}; |
| 206 |
|
| 207 |
codec-1 { |
| 208 |
sound-dai = <&tohdmitx TOHDMITX_SPDIF_IN_A>; |
| 209 |
}; |
| 210 |
}; |
| 211 |
|
| 212 |
/* spdif hdmi interface */ |
| 213 |
dai-link-5 { |
| 214 |
sound-dai = <&spdifout_b>; |
| 215 |
|
| 216 |
codec { |
| 217 |
sound-dai = <&tohdmitx TOHDMITX_SPDIF_IN_B>; |
| 218 |
}; |
| 219 |
}; |
| 220 |
|
| 221 |
/* hdmi glue */ |
| 222 |
dai-link-6 { |
| 223 |
sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>; |
| 224 |
|
| 225 |
codec { |
| 226 |
sound-dai = <&hdmi_tx>; |
| 227 |
}; |
| 228 |
}; |
| 229 |
}; |
| 230 |
|
| 231 |
wifi32k: wifi32k { |
| 232 |
compatible = "pwm-clock"; |
| 233 |
#clock-cells = <0>; |
| 234 |
clock-frequency = <32768>; |
| 235 |
pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */ |
| 236 |
}; |
| 237 |
}; |
| 238 |
|
| 239 |
&arb { |
| 240 |
status = "okay"; |
| 241 |
}; |
| 242 |
|
| 243 |
&cec_AO { |
| 244 |
pinctrl-0 = <&cec_ao_a_h_pins>; |
| 245 |
pinctrl-names = "default"; |
| 246 |
status = "disabled"; |
| 247 |
hdmi-phandle = <&hdmi_tx>; |
| 248 |
}; |
| 249 |
|
| 250 |
&cecb_AO { |
| 251 |
pinctrl-0 = <&cec_ao_b_h_pins>; |
| 252 |
pinctrl-names = "default"; |
| 253 |
status = "okay"; |
| 254 |
hdmi-phandle = <&hdmi_tx>; |
| 255 |
}; |
| 256 |
|
| 257 |
&clkc_audio { |
| 258 |
status = "okay"; |
| 259 |
}; |
| 260 |
|
| 261 |
&cpu0 { |
| 262 |
cpu-supply = <&vddcpu>; |
| 263 |
}; |
| 264 |
|
| 265 |
&cpu1 { |
| 266 |
cpu-supply = <&vddcpu>; |
| 267 |
}; |
| 268 |
|
| 269 |
&cpu2 { |
| 270 |
cpu-supply = <&vddcpu>; |
| 271 |
}; |
| 272 |
|
| 273 |
&cpu3 { |
| 274 |
cpu-supply = <&vddcpu>; |
| 275 |
}; |
| 276 |
|
| 277 |
&cvbs_vdac_port { |
| 278 |
cvbs_vdac_out: endpoint { |
| 279 |
remote-endpoint = <&cvbs_connector_in>; |
| 280 |
}; |
| 281 |
}; |
| 282 |
|
| 283 |
&frddr_a { |
| 284 |
status = "okay"; |
| 285 |
}; |
| 286 |
|
| 287 |
&frddr_b { |
| 288 |
status = "okay"; |
| 289 |
}; |
| 290 |
|
| 291 |
&frddr_c { |
| 292 |
status = "okay"; |
| 293 |
}; |
| 294 |
|
| 295 |
&hdmi_tx { |
| 296 |
status = "okay"; |
| 297 |
pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>; |
| 298 |
pinctrl-names = "default"; |
| 299 |
hdmi-supply = <&vcc_5v>; |
| 300 |
}; |
| 301 |
|
| 302 |
&hdmi_tx_tmds_port { |
| 303 |
hdmi_tx_tmds_out: endpoint { |
| 304 |
remote-endpoint = <&hdmi_connector_in>; |
| 305 |
}; |
| 306 |
}; |
| 307 |
|
| 308 |
&ir { |
| 309 |
status = "okay"; |
| 310 |
pinctrl-0 = <&remote_input_ao_pins>; |
| 311 |
pinctrl-names = "default"; |
| 312 |
linux,rc-map-name = "rc-x96max"; |
| 313 |
}; |
| 314 |
|
| 315 |
&pwm_AO_cd { |
| 316 |
pinctrl-0 = <&pwm_ao_d_e_pins>; |
| 317 |
pinctrl-names = "default"; |
| 318 |
status = "okay"; |
| 319 |
}; |
| 320 |
|
| 321 |
&ext_mdio { |
| 322 |
external_phy: ethernet-phy@0 { |
| 323 |
/* Realtek RTL8211F (0x001cc916) */ |
| 324 |
reg = <0>; |
| 325 |
max-speed = <1000>; |
| 326 |
eee-broken-1000t; |
| 327 |
|
| 328 |
reset-assert-us = <10000>; |
| 329 |
reset-deassert-us = <80000>; |
| 330 |
reset-gpios = <&gpio GPIOZ_15 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>; |
| 331 |
|
| 332 |
interrupt-parent = <&gpio_intc>; |
| 333 |
/* MAC_INTR on GPIOZ_14 */ |
| 334 |
interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>; |
| 335 |
}; |
| 336 |
}; |
| 337 |
|
| 338 |
ðmac { |
| 339 |
pinctrl-0 = <ð_pins>, <ð_rgmii_pins>; |
| 340 |
pinctrl-names = "default"; |
| 341 |
status = "okay"; |
| 342 |
phy-mode = "rgmii"; |
| 343 |
phy-handle = <&external_phy>; |
| 344 |
amlogic,tx-delay-ns = <2>; |
| 345 |
}; |
| 346 |
|
| 347 |
&pwm_ef { |
| 348 |
status = "okay"; |
| 349 |
pinctrl-0 = <&pwm_e_pins>; |
| 350 |
pinctrl-names = "default"; |
| 351 |
}; |
| 352 |
|
| 353 |
&uart_A { |
| 354 |
status = "okay"; |
| 355 |
pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>; |
| 356 |
pinctrl-names = "default"; |
| 357 |
uart-has-rtscts; |
| 358 |
|
| 359 |
bluetooth { |
| 360 |
compatible = "brcm,bcm43438-bt"; |
| 361 |
shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; |
| 362 |
max-speed = <2000000>; |
| 363 |
clocks = <&wifi32k>; |
| 364 |
clock-names = "lpo"; |
| 365 |
}; |
| 366 |
}; |
| 367 |
|
| 368 |
&uart_AO { |
| 369 |
status = "okay"; |
| 370 |
pinctrl-0 = <&uart_ao_a_pins>; |
| 371 |
pinctrl-names = "default"; |
| 372 |
}; |
| 373 |
|
| 374 |
&usb { |
| 375 |
status = "okay"; |
| 376 |
dr_mode = "host"; |
| 377 |
}; |
| 378 |
|
| 379 |
/* SDIO */ |
| 380 |
&sd_emmc_a { |
| 381 |
status = "okay"; |
| 382 |
pinctrl-0 = <&sdio_pins>; |
| 383 |
pinctrl-1 = <&sdio_clk_gate_pins>; |
| 384 |
pinctrl-names = "default", "clk-gate"; |
| 385 |
#address-cells = <1>; |
| 386 |
#size-cells = <0>; |
| 387 |
|
| 388 |
bus-width = <4>; |
| 389 |
cap-sd-highspeed; |
| 390 |
sd-uhs-sdr50; |
| 391 |
max-frequency = <100000000>; |
| 392 |
|
| 393 |
non-removable; |
| 394 |
disable-wp; |
| 395 |
|
| 396 |
/* WiFi firmware requires power to be kept while in suspend */ |
| 397 |
keep-power-in-suspend; |
| 398 |
|
| 399 |
mmc-pwrseq = <&sdio_pwrseq>; |
| 400 |
|
| 401 |
vmmc-supply = <&vddao_3v3>; |
| 402 |
vqmmc-supply = <&vddao_1v8>; |
| 403 |
|
| 404 |
brcmf: wifi@1 { |
| 405 |
reg = <1>; |
| 406 |
compatible = "brcm,bcm4329-fmac"; |
| 407 |
}; |
| 408 |
}; |
| 409 |
|
| 410 |
/* SD card */ |
| 411 |
&sd_emmc_b { |
| 412 |
status = "okay"; |
| 413 |
pinctrl-0 = <&sdcard_c_pins>; |
| 414 |
pinctrl-1 = <&sdcard_clk_gate_c_pins>; |
| 415 |
pinctrl-names = "default", "clk-gate"; |
| 416 |
|
| 417 |
bus-width = <4>; |
| 418 |
cap-sd-highspeed; |
| 419 |
max-frequency = <100000000>; |
| 420 |
disable-wp; |
| 421 |
|
| 422 |
cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>; |
| 423 |
vmmc-supply = <&vddao_3v3>; |
| 424 |
vqmmc-supply = <&vddao_3v3>; |
| 425 |
}; |
| 426 |
|
| 427 |
/* eMMC */ |
| 428 |
&sd_emmc_c { |
| 429 |
status = "okay"; |
| 430 |
pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>; |
| 431 |
pinctrl-1 = <&emmc_clk_gate_pins>; |
| 432 |
pinctrl-names = "default", "clk-gate"; |
| 433 |
|
| 434 |
bus-width = <8>; |
| 435 |
cap-mmc-highspeed; |
| 436 |
max-frequency = <100000000>; |
| 437 |
non-removable; |
| 438 |
disable-wp; |
| 439 |
|
| 440 |
mmc-pwrseq = <&emmc_pwrseq>; |
| 441 |
vmmc-supply = <&vcc_3v3>; |
| 442 |
vqmmc-supply = <&flash_1v8>; |
| 443 |
}; |
| 444 |
|
| 445 |
&spdifout_a { |
| 446 |
pinctrl-0 = <&spdif_out_h_pins>; |
| 447 |
pinctrl-names = "default"; |
| 448 |
status = "okay"; |
| 449 |
}; |
| 450 |
|
| 451 |
&spdifout_b { |
| 452 |
status = "okay"; |
| 453 |
}; |
| 454 |
|
| 455 |
&tdmif_b { |
| 456 |
status = "okay"; |
| 457 |
}; |
| 458 |
|
| 459 |
&tdmout_b { |
| 460 |
status = "okay"; |
| 461 |
}; |
| 462 |
|
| 463 |
&tohdmitx { |
| 464 |
status = "okay"; |
| 465 |
}; |