1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2 /* 3 * Copyright (c) 2019 BayLibre, SAS 4 * Author: Neil Armstrong <narmstrong@baylibre. 5 * Copyright (c) 2023 Christian Hewitt <christi 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-tohdmit 12 13 / { 14 aliases { 15 serial0 = &uart_AO; 16 ethernet0 = ðmac; 17 rtc1 = &vrtc; 18 }; 19 20 chosen { 21 stdout-path = "serial0:115200n 22 }; 23 24 memory@0 { 25 device_type = "memory"; 26 reg = <0x0 0x0 0x0 0x80000000> 27 }; 28 29 adc-keys { 30 compatible = "adc-keys"; 31 io-channels = <&saradc 2>; 32 io-channel-names = "buttons"; 33 keyup-threshold-microvolt = <1 34 35 button-function { 36 label = "RST"; 37 linux,code = <KEY_POWE 38 press-threshold-microv 39 }; 40 }; 41 42 emmc_pwrseq: emmc-pwrseq { 43 compatible = "mmc-pwrseq-emmc" 44 reset-gpios = <&gpio BOOT_12 G 45 }; 46 47 hdmi-connector { 48 compatible = "hdmi-connector"; 49 type = "a"; 50 51 port { 52 hdmi_connector_in: end 53 remote-endpoin 54 }; 55 }; 56 }; 57 58 leds { 59 compatible = "gpio-leds"; 60 61 led-0 { 62 color = <LED_COLOR_ID_ 63 function = LED_FUNCTIO 64 gpios = <&gpio_ao GPIO 65 linux,default-trigger 66 }; 67 68 led-1 { 69 color = <LED_COLOR_ID_ 70 function = LED_FUNCTIO 71 gpios = <&gpio_ao GPIO 72 }; 73 }; 74 75 sdio_pwrseq: sdio-pwrseq { 76 compatible = "mmc-pwrseq-simpl 77 reset-gpios = <&gpio GPIOX_6 G 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>; /* 87 }; 88 89 dc_in: regulator-dc-in { 90 compatible = "regulator-fixed" 91 regulator-name = "DC_IN"; 92 regulator-min-microvolt = <500 93 regulator-max-microvolt = <500 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 = <500 101 regulator-max-microvolt = <500 102 vin-supply = <&dc_in>; 103 104 gpio = <&gpio GPIOH_8 GPIO_OPE 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 = <330 112 regulator-max-microvolt = <330 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 = <180 121 regulator-max-microvolt = <180 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 = <180 130 regulator-max-microvolt = <180 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 = <690 139 regulator-max-microvolt = <105 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 = <690 151 regulator-max-microvolt = <105 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 = <330 163 regulator-max-microvolt = <330 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 = <180 172 regulator-max-microvolt = <180 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 = <500 181 regulator-max-microvolt = <500 182 vin-supply = <&vcc_5v>; 183 184 gpio = <&gpio GPIOA_6 GPIO_ACT 185 enable-active-high; 186 }; 187 188 sound { 189 compatible = "amlogic,axg-soun 190 model = "BPI-M2S"; 191 audio-aux-devs = <&tdmout_b>; 192 audio-routing = "TDMOUT_B IN 0 193 "TDMOUT_B IN 1 194 "TDMOUT_B IN 2 195 "TDM_B Playbac 196 197 assigned-clocks = <&clkc CLKID 198 <&clkc CLKID 199 <&clkc CLKID 200 assigned-clock-parents = <0>, 201 assigned-clock-rates = <294912 202 <270950 203 <393216 204 205 dai-link-0 { 206 sound-dai = <&frddr_a> 207 }; 208 209 dai-link-1 { 210 sound-dai = <&frddr_b> 211 }; 212 213 dai-link-2 { 214 sound-dai = <&frddr_c> 215 }; 216 217 /* 8ch hdmi interface */ 218 dai-link-3 { 219 sound-dai = <&tdmif_b> 220 dai-format = "i2s"; 221 dai-tdm-slot-tx-mask-0 222 dai-tdm-slot-tx-mask-1 223 dai-tdm-slot-tx-mask-2 224 dai-tdm-slot-tx-mask-3 225 mclk-fs = <256>; 226 227 codec { 228 sound-dai = <& 229 }; 230 }; 231 232 /* hdmi glue */ 233 dai-link-4 { 234 sound-dai = <&tohdmitx 235 236 codec { 237 sound-dai = <& 238 }; 239 }; 240 }; 241 }; 242 243 &arb { 244 status = "okay"; 245 }; 246 247 &clkc_audio { 248 status = "okay"; 249 }; 250 251 &cecb_AO { 252 pinctrl-0 = <&cec_ao_b_h_pins>; 253 pinctrl-names = "default"; 254 status = "okay"; 255 hdmi-phandle = <&hdmi_tx>; 256 }; 257 258 &cpu0 { 259 cpu-supply = <&vddcpu_b>; 260 operating-points-v2 = <&cpu_opp_table_ 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_ 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 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 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 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 296 clocks = <&clkc CLKID_CPUB_CLK>; 297 clock-latency = <50000>; 298 }; 299 300 ðmac { 301 pinctrl-0 = <ð_pins>, <ð_rgmii_p 302 pinctrl-names = "default"; 303 status = "okay"; 304 phy-mode = "rgmii"; 305 phy-handle = <&external_phy>; 306 amlogic,tx-delay-ns = <2>; 307 }; 308 309 &ext_mdio { 310 external_phy: ethernet-phy@0 { 311 /* Realtek RTL8211F (0x001cc91 312 reg = <0>; 313 max-speed = <1000>; 314 315 reset-assert-us = <10000>; 316 reset-deassert-us = <80000>; 317 reset-gpios = <&gpio GPIOZ_15 318 319 interrupt-parent = <&gpio_intc 320 /* MAC_INTR on GPIOZ_14 */ 321 interrupts = <IRQID_GPIOZ_14 I 322 }; 323 }; 324 325 &frddr_a { 326 status = "okay"; 327 }; 328 329 &frddr_b { 330 status = "okay"; 331 }; 332 333 &frddr_c { 334 status = "okay"; 335 }; 336 337 &hdmi_tx { 338 status = "okay"; 339 pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmi 340 pinctrl-names = "default"; 341 hdmi-supply = <&vcc_5v>; 342 }; 343 344 &hdmi_tx_tmds_port { 345 hdmi_tx_tmds_out: endpoint { 346 remote-endpoint = <&hdmi_conne 347 }; 348 }; 349 350 /* Main i2c bus */ 351 &i2c2 { 352 status = "okay"; 353 pinctrl-0 = <&i2c2_sda_x_pins>, <&i2c2 354 pinctrl-names = "default"; 355 }; 356 357 &pcie { 358 status = "okay"; 359 reset-gpios = <&gpio GPIOA_8 GPIO_ACTI 360 }; 361 362 &pwm_ab { 363 status = "okay"; 364 pinctrl-0 = <&pwm_a_e_pins>; 365 pinctrl-names = "default"; 366 clocks = <&xtal>; 367 clock-names = "clkin0"; 368 }; 369 370 &pwm_ef { 371 status = "okay"; 372 pinctrl-0 = <&pwm_e_pins>; 373 pinctrl-names = "default"; 374 }; 375 376 &pwm_AO_cd { 377 pinctrl-0 = <&pwm_ao_d_e_pins>; 378 pinctrl-names = "default"; 379 clocks = <&xtal>; 380 clock-names = "clkin1"; 381 status = "okay"; 382 }; 383 384 &saradc { 385 status = "okay"; 386 vref-supply = <&vddao_1v8>; 387 }; 388 389 /* SDIO */ 390 &sd_emmc_a { 391 /* enable if WiFi/BT board connected * 392 status = "disabled"; 393 pinctrl-0 = <&sdio_pins>; 394 pinctrl-1 = <&sdio_clk_gate_pins>; 395 pinctrl-names = "default", "clk-gate"; 396 #address-cells = <1>; 397 #size-cells = <0>; 398 399 bus-width = <4>; 400 sd-uhs-sdr104; 401 max-frequency = <50000000>; 402 403 non-removable; 404 disable-wp; 405 406 /* WiFi firmware requires power in sus 407 keep-power-in-suspend; 408 409 mmc-pwrseq = <&sdio_pwrseq>; 410 411 vmmc-supply = <&vsys_3v3>; 412 vqmmc-supply = <&vddao_1v8>; 413 414 rtl8822cs: wifi@1 { 415 reg = <1>; 416 }; 417 }; 418 419 /* SD card */ 420 &sd_emmc_b { 421 status = "okay"; 422 pinctrl-0 = <&sdcard_c_pins>; 423 pinctrl-1 = <&sdcard_clk_gate_c_pins>; 424 pinctrl-names = "default", "clk-gate"; 425 426 bus-width = <4>; 427 cap-sd-highspeed; 428 max-frequency = <50000000>; 429 disable-wp; 430 431 cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_ 432 vmmc-supply = <&vsys_3v3>; 433 vqmmc-supply = <&vsys_3v3>; 434 }; 435 436 /* eMMC */ 437 &sd_emmc_c { 438 status = "okay"; 439 pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_ 440 pinctrl-1 = <&emmc_clk_gate_pins>; 441 pinctrl-names = "default", "clk-gate"; 442 443 bus-width = <8>; 444 cap-mmc-highspeed; 445 mmc-ddr-1_8v; 446 mmc-hs200-1_8v; 447 max-frequency = <200000000>; 448 disable-wp; 449 450 mmc-pwrseq = <&emmc_pwrseq>; 451 vmmc-supply = <&vcc_3v3>; 452 vqmmc-supply = <&emmc_1v8>; 453 }; 454 455 &tdmif_b { 456 status = "okay"; 457 }; 458 459 &tdmout_b { 460 status = "okay"; 461 }; 462 463 &tohdmitx { 464 status = "okay"; 465 }; 466 467 &uart_A { 468 /* enable if WiFi/BT board connected * 469 status = "disabled"; 470 pinctrl-0 = <&uart_a_pins>, <&uart_a_c 471 pinctrl-names = "default"; 472 uart-has-rtscts; 473 474 bluetooth { 475 compatible = "realtek,rtl8822c 476 enable-gpios = <&gpio GPIOX_17 477 host-wake-gpios = <&gpio GPIOX 478 device-wake-gpios = <&gpio GPI 479 }; 480 }; 481 482 &uart_AO { 483 status = "okay"; 484 pinctrl-0 = <&uart_ao_a_pins>; 485 pinctrl-names = "default"; 486 }; 487 488 &usb2_phy0 { 489 phy-supply = <&dc_in>; 490 }; 491 492 &usb2_phy1 { 493 phy-supply = <&usb_pwr>; 494 }; 495 496 &usb3_pcie_phy { 497 phy-supply = <&usb_pwr>; 498 }; 499 500 &usb { 501 status = "okay"; 502 dr_mode = "peripheral"; 503 phys = <&usb2_phy0>, <&usb2_phy1>; 504 phy-names = "usb2-phy0", "usb2-phy1"; 505 };
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.