1/* 2 * Copyright (c) 2016 Endless Computers, Inc. 3 * Author: Carlo Caione <carlo@endlessm.com> 4 * 5 * This file is dual-licensed: you can use it either under the terms 6 * of the GPL or the X11 license, at your option. Note that this dual 7 * licensing only applies to this file, and not this project as a 8 * whole. 9 * 10 * a) This library is free software; you can redistribute it and/or 11 * modify it under the terms of the GNU General Public License as 12 * published by the Free Software Foundation; either version 2 of the 13 * License, or (at your option) any later version. 14 * 15 * This library is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU General Public License for more details. 19 * 20 * Or, alternatively, 21 * 22 * b) Permission is hereby granted, free of charge, to any person 23 * obtaining a copy of this software and associated documentation 24 * files (the "Software"), to deal in the Software without 25 * restriction, including without limitation the rights to use, 26 * copy, modify, merge, publish, distribute, sublicense, and/or 27 * sell copies of the Software, and to permit persons to whom the 28 * Software is furnished to do so, subject to the following 29 * conditions: 30 * 31 * The above copyright notice and this permission notice shall be 32 * included in all copies or substantial portions of the Software. 33 * 34 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 35 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 36 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 37 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 38 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 39 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 40 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 41 * OTHER DEALINGS IN THE SOFTWARE. 42 */ 43 44#include "meson-gx.dtsi" 45#include <dt-bindings/clock/gxbb-clkc.h> 46#include <dt-bindings/clock/gxbb-aoclkc.h> 47#include <dt-bindings/gpio/meson-gxl-gpio.h> 48#include <dt-bindings/reset/amlogic,meson-gxbb-reset.h> 49 50/ { 51 compatible = "amlogic,meson-gxl"; 52 53 reserved-memory { 54 /* Alternate 3 MiB reserved for ARM Trusted Firmware (BL31) */ 55 secmon_reserved_alt: secmon@05000000 { 56 reg = <0x0 0x05000000 0x0 0x300000>; 57 no-map; 58 }; 59 }; 60}; 61 62ðmac { 63 reg = <0x0 0xc9410000 0x0 0x10000 64 0x0 0xc8834540 0x0 0x4>; 65 66 clocks = <&clkc CLKID_ETH>, 67 <&clkc CLKID_FCLK_DIV2>, 68 <&clkc CLKID_MPLL2>; 69 clock-names = "stmmaceth", "clkin0", "clkin1"; 70 71 mdio0: mdio { 72 #address-cells = <1>; 73 #size-cells = <0>; 74 compatible = "snps,dwmac-mdio"; 75 }; 76}; 77 78&aobus { 79 pinctrl_aobus: pinctrl@14 { 80 compatible = "amlogic,meson-gxl-aobus-pinctrl"; 81 #address-cells = <2>; 82 #size-cells = <2>; 83 ranges; 84 85 gpio_ao: bank@14 { 86 reg = <0x0 0x00014 0x0 0x8>, 87 <0x0 0x0002c 0x0 0x4>, 88 <0x0 0x00024 0x0 0x8>; 89 reg-names = "mux", "pull", "gpio"; 90 gpio-controller; 91 #gpio-cells = <2>; 92 gpio-ranges = <&pinctrl_aobus 0 0 14>; 93 }; 94 95 uart_ao_a_pins: uart_ao_a { 96 mux { 97 groups = "uart_tx_ao_a", "uart_rx_ao_a"; 98 function = "uart_ao"; 99 }; 100 }; 101 102 uart_ao_a_cts_rts_pins: uart_ao_a_cts_rts { 103 mux { 104 groups = "uart_cts_ao_a", 105 "uart_rts_ao_a"; 106 function = "uart_ao"; 107 }; 108 }; 109 110 uart_ao_b_pins: uart_ao_b { 111 mux { 112 groups = "uart_tx_ao_b", "uart_rx_ao_b"; 113 function = "uart_ao_b"; 114 }; 115 }; 116 117 uart_ao_b_0_1_pins: uart_ao_b_0_1 { 118 mux { 119 groups = "uart_tx_ao_b_0", "uart_rx_ao_b_1"; 120 function = "uart_ao_b"; 121 }; 122 }; 123 124 uart_ao_b_cts_rts_pins: uart_ao_b_cts_rts { 125 mux { 126 groups = "uart_cts_ao_b", 127 "uart_rts_ao_b"; 128 function = "uart_ao_b"; 129 }; 130 }; 131 132 remote_input_ao_pins: remote_input_ao { 133 mux { 134 groups = "remote_input_ao"; 135 function = "remote_input_ao"; 136 }; 137 }; 138 139 i2c_ao_pins: i2c_ao { 140 mux { 141 groups = "i2c_sck_ao", 142 "i2c_sda_ao"; 143 function = "i2c_ao"; 144 }; 145 }; 146 147 pwm_ao_a_3_pins: pwm_ao_a_3 { 148 mux { 149 groups = "pwm_ao_a_3"; 150 function = "pwm_ao_a"; 151 }; 152 }; 153 154 pwm_ao_a_8_pins: pwm_ao_a_8 { 155 mux { 156 groups = "pwm_ao_a_8"; 157 function = "pwm_ao_a"; 158 }; 159 }; 160 161 pwm_ao_b_pins: pwm_ao_b { 162 mux { 163 groups = "pwm_ao_b"; 164 function = "pwm_ao_b"; 165 }; 166 }; 167 168 pwm_ao_b_6_pins: pwm_ao_b_6 { 169 mux { 170 groups = "pwm_ao_b_6"; 171 function = "pwm_ao_b"; 172 }; 173 }; 174 175 i2s_out_ch23_ao_pins: i2s_out_ch23_ao { 176 mux { 177 groups = "i2s_out_ch23_ao"; 178 function = "i2s_out_ao"; 179 }; 180 }; 181 182 i2s_out_ch45_ao_pins: i2s_out_ch45_ao { 183 mux { 184 groups = "i2s_out_ch45_ao"; 185 function = "i2s_out_ao"; 186 }; 187 }; 188 189 spdif_out_ao_6_pins: spdif_out_ao_6 { 190 mux { 191 groups = "spdif_out_ao_6"; 192 function = "spdif_out_ao"; 193 }; 194 }; 195 196 spdif_out_ao_9_pins: spdif_out_ao_9 { 197 mux { 198 groups = "spdif_out_ao_9"; 199 function = "spdif_out_ao"; 200 }; 201 }; 202 203 ao_cec_pins: ao_cec { 204 mux { 205 groups = "ao_cec"; 206 function = "cec_ao"; 207 }; 208 }; 209 210 ee_cec_pins: ee_cec { 211 mux { 212 groups = "ee_cec"; 213 function = "cec_ao"; 214 }; 215 }; 216 }; 217}; 218 219&cec_AO { 220 clocks = <&clkc_AO CLKID_AO_CEC_32K>; 221 clock-names = "core"; 222}; 223 224&clkc_AO { 225 compatible = "amlogic,meson-gxl-aoclkc", "amlogic,meson-gx-aoclkc"; 226}; 227 228&hdmi_tx { 229 compatible = "amlogic,meson-gxl-dw-hdmi", "amlogic,meson-gx-dw-hdmi"; 230 resets = <&reset RESET_HDMITX_CAPB3>, 231 <&reset RESET_HDMI_SYSTEM_RESET>, 232 <&reset RESET_HDMI_TX>; 233 reset-names = "hdmitx_apb", "hdmitx", "hdmitx_phy"; 234 clocks = <&clkc CLKID_HDMI_PCLK>, 235 <&clkc CLKID_CLK81>, 236 <&clkc CLKID_GCLK_VENCI_INT0>; 237 clock-names = "isfr", "iahb", "venci"; 238}; 239 240&hiubus { 241 clkc: clock-controller@0 { 242 compatible = "amlogic,gxl-clkc", "amlogic,gxbb-clkc"; 243 #clock-cells = <1>; 244 reg = <0x0 0x0 0x0 0x3db>; 245 }; 246}; 247 248&i2c_A { 249 clocks = <&clkc CLKID_I2C>; 250}; 251 252&i2c_AO { 253 clocks = <&clkc CLKID_AO_I2C>; 254}; 255 256&i2c_B { 257 clocks = <&clkc CLKID_I2C>; 258}; 259 260&i2c_C { 261 clocks = <&clkc CLKID_I2C>; 262}; 263 264&periphs { 265 pinctrl_periphs: pinctrl@4b0 { 266 compatible = "amlogic,meson-gxl-periphs-pinctrl"; 267 #address-cells = <2>; 268 #size-cells = <2>; 269 ranges; 270 271 gpio: bank@4b0 { 272 reg = <0x0 0x004b0 0x0 0x28>, 273 <0x0 0x004e8 0x0 0x14>, 274 <0x0 0x00520 0x0 0x14>, 275 <0x0 0x00430 0x0 0x40>; 276 reg-names = "mux", "pull", "pull-enable", "gpio"; 277 gpio-controller; 278 #gpio-cells = <2>; 279 gpio-ranges = <&pinctrl_periphs 0 10 101>; 280 }; 281 282 emmc_pins: emmc { 283 mux { 284 groups = "emmc_nand_d07", 285 "emmc_cmd", 286 "emmc_clk", 287 "emmc_ds"; 288 function = "emmc"; 289 }; 290 }; 291 292 emmc_clk_gate_pins: emmc_clk_gate { 293 mux { 294 groups = "BOOT_8"; 295 function = "gpio_periphs"; 296 }; 297 cfg-pull-down { 298 pins = "BOOT_8"; 299 bias-pull-down; 300 }; 301 }; 302 303 nor_pins: nor { 304 mux { 305 groups = "nor_d", 306 "nor_q", 307 "nor_c", 308 "nor_cs"; 309 function = "nor"; 310 }; 311 }; 312 313 spi_pins: spi-pins { 314 mux { 315 groups = "spi_miso", 316 "spi_mosi", 317 "spi_sclk"; 318 function = "spi"; 319 }; 320 }; 321 322 spi_ss0_pins: spi-ss0 { 323 mux { 324 groups = "spi_ss0"; 325 function = "spi"; 326 }; 327 }; 328 329 sdcard_pins: sdcard { 330 mux { 331 groups = "sdcard_d0", 332 "sdcard_d1", 333 "sdcard_d2", 334 "sdcard_d3", 335 "sdcard_cmd", 336 "sdcard_clk"; 337 function = "sdcard"; 338 }; 339 }; 340 341 sdcard_clk_gate_pins: sdcard_clk_gate { 342 mux { 343 groups = "CARD_2"; 344 function = "gpio_periphs"; 345 }; 346 cfg-pull-down { 347 pins = "CARD_2"; 348 bias-pull-down; 349 }; 350 }; 351 352 sdio_pins: sdio { 353 mux { 354 groups = "sdio_d0", 355 "sdio_d1", 356 "sdio_d2", 357 "sdio_d3", 358 "sdio_cmd", 359 "sdio_clk"; 360 function = "sdio"; 361 }; 362 }; 363 364 sdio_clk_gate_pins: sdio_clk_gate { 365 mux { 366 groups = "GPIOX_4"; 367 function = "gpio_periphs"; 368 }; 369 cfg-pull-down { 370 pins = "GPIOX_4"; 371 bias-pull-down; 372 }; 373 }; 374 375 sdio_irq_pins: sdio_irq { 376 mux { 377 groups = "sdio_irq"; 378 function = "sdio"; 379 }; 380 }; 381 382 uart_a_pins: uart_a { 383 mux { 384 groups = "uart_tx_a", 385 "uart_rx_a"; 386 function = "uart_a"; 387 }; 388 }; 389 390 uart_a_cts_rts_pins: uart_a_cts_rts { 391 mux { 392 groups = "uart_cts_a", 393 "uart_rts_a"; 394 function = "uart_a"; 395 }; 396 }; 397 398 uart_b_pins: uart_b { 399 mux { 400 groups = "uart_tx_b", 401 "uart_rx_b"; 402 function = "uart_b"; 403 }; 404 }; 405 406 uart_b_cts_rts_pins: uart_b_cts_rts { 407 mux { 408 groups = "uart_cts_b", 409 "uart_rts_b"; 410 function = "uart_b"; 411 }; 412 }; 413 414 uart_c_pins: uart_c { 415 mux { 416 groups = "uart_tx_c", 417 "uart_rx_c"; 418 function = "uart_c"; 419 }; 420 }; 421 422 uart_c_cts_rts_pins: uart_c_cts_rts { 423 mux { 424 groups = "uart_cts_c", 425 "uart_rts_c"; 426 function = "uart_c"; 427 }; 428 }; 429 430 i2c_a_pins: i2c_a { 431 mux { 432 groups = "i2c_sck_a", 433 "i2c_sda_a"; 434 function = "i2c_a"; 435 }; 436 }; 437 438 i2c_b_pins: i2c_b { 439 mux { 440 groups = "i2c_sck_b", 441 "i2c_sda_b"; 442 function = "i2c_b"; 443 }; 444 }; 445 446 i2c_c_pins: i2c_c { 447 mux { 448 groups = "i2c_sck_c", 449 "i2c_sda_c"; 450 function = "i2c_c"; 451 }; 452 }; 453 454 eth_pins: eth_c { 455 mux { 456 groups = "eth_mdio", 457 "eth_mdc", 458 "eth_clk_rx_clk", 459 "eth_rx_dv", 460 "eth_rxd0", 461 "eth_rxd1", 462 "eth_rxd2", 463 "eth_rxd3", 464 "eth_rgmii_tx_clk", 465 "eth_tx_en", 466 "eth_txd0", 467 "eth_txd1", 468 "eth_txd2", 469 "eth_txd3"; 470 function = "eth"; 471 }; 472 }; 473 474 eth_link_led_pins: eth_link_led { 475 mux { 476 groups = "eth_link_led"; 477 function = "eth_led"; 478 }; 479 }; 480 481 eth_act_led_pins: eth_act_led { 482 mux { 483 groups = "eth_act_led"; 484 function = "eth_led"; 485 }; 486 }; 487 488 pwm_a_pins: pwm_a { 489 mux { 490 groups = "pwm_a"; 491 function = "pwm_a"; 492 }; 493 }; 494 495 pwm_b_pins: pwm_b { 496 mux { 497 groups = "pwm_b"; 498 function = "pwm_b"; 499 }; 500 }; 501 502 pwm_c_pins: pwm_c { 503 mux { 504 groups = "pwm_c"; 505 function = "pwm_c"; 506 }; 507 }; 508 509 pwm_d_pins: pwm_d { 510 mux { 511 groups = "pwm_d"; 512 function = "pwm_d"; 513 }; 514 }; 515 516 pwm_e_pins: pwm_e { 517 mux { 518 groups = "pwm_e"; 519 function = "pwm_e"; 520 }; 521 }; 522 523 pwm_f_clk_pins: pwm_f_clk { 524 mux { 525 groups = "pwm_f_clk"; 526 function = "pwm_f"; 527 }; 528 }; 529 530 pwm_f_x_pins: pwm_f_x { 531 mux { 532 groups = "pwm_f_x"; 533 function = "pwm_f"; 534 }; 535 }; 536 537 hdmi_hpd_pins: hdmi_hpd { 538 mux { 539 groups = "hdmi_hpd"; 540 function = "hdmi_hpd"; 541 }; 542 }; 543 544 hdmi_i2c_pins: hdmi_i2c { 545 mux { 546 groups = "hdmi_sda", "hdmi_scl"; 547 function = "hdmi_i2c"; 548 }; 549 }; 550 551 i2s_am_clk_pins: i2s_am_clk { 552 mux { 553 groups = "i2s_am_clk"; 554 function = "i2s_out"; 555 }; 556 }; 557 558 i2s_out_ao_clk_pins: i2s_out_ao_clk { 559 mux { 560 groups = "i2s_out_ao_clk"; 561 function = "i2s_out"; 562 }; 563 }; 564 565 i2s_out_lr_clk_pins: i2s_out_lr_clk { 566 mux { 567 groups = "i2s_out_lr_clk"; 568 function = "i2s_out"; 569 }; 570 }; 571 572 i2s_out_ch01_pins: i2s_out_ch01 { 573 mux { 574 groups = "i2s_out_ch01"; 575 function = "i2s_out"; 576 }; 577 }; 578 i2sout_ch23_z_pins: i2sout_ch23_z { 579 mux { 580 groups = "i2sout_ch23_z"; 581 function = "i2s_out"; 582 }; 583 }; 584 585 i2sout_ch45_z_pins: i2sout_ch45_z { 586 mux { 587 groups = "i2sout_ch45_z"; 588 function = "i2s_out"; 589 }; 590 }; 591 592 i2sout_ch67_z_pins: i2sout_ch67_z { 593 mux { 594 groups = "i2sout_ch67_z"; 595 function = "i2s_out"; 596 }; 597 }; 598 599 spdif_out_h_pins: spdif_out_ao_h { 600 mux { 601 groups = "spdif_out_h"; 602 function = "spdif_out"; 603 }; 604 }; 605 }; 606 607 eth-phy-mux { 608 compatible = "mdio-mux-mmioreg", "mdio-mux"; 609 #address-cells = <1>; 610 #size-cells = <0>; 611 reg = <0x0 0x55c 0x0 0x4>; 612 mux-mask = <0xffffffff>; 613 mdio-parent-bus = <&mdio0>; 614 615 internal_mdio: mdio@e40908ff { 616 reg = <0xe40908ff>; 617 #address-cells = <1>; 618 #size-cells = <0>; 619 620 internal_phy: ethernet-phy@8 { 621 compatible = "ethernet-phy-id0181.4400", "ethernet-phy-ieee802.3-c22"; 622 reg = <8>; 623 max-speed = <100>; 624 }; 625 }; 626 627 external_mdio: mdio@2009087f { 628 reg = <0x2009087f>; 629 #address-cells = <1>; 630 #size-cells = <0>; 631 }; 632 }; 633}; 634 635&saradc { 636 compatible = "amlogic,meson-gxl-saradc", "amlogic,meson-saradc"; 637 clocks = <&xtal>, 638 <&clkc CLKID_SAR_ADC>, 639 <&clkc CLKID_SANA>, 640 <&clkc CLKID_SAR_ADC_CLK>, 641 <&clkc CLKID_SAR_ADC_SEL>; 642 clock-names = "clkin", "core", "sana", "adc_clk", "adc_sel"; 643}; 644 645&sd_emmc_a { 646 clocks = <&clkc CLKID_SD_EMMC_A>, 647 <&clkc CLKID_SD_EMMC_A_CLK0>, 648 <&clkc CLKID_FCLK_DIV2>; 649 clock-names = "core", "clkin0", "clkin1"; 650}; 651 652&sd_emmc_b { 653 clocks = <&clkc CLKID_SD_EMMC_B>, 654 <&clkc CLKID_SD_EMMC_B_CLK0>, 655 <&clkc CLKID_FCLK_DIV2>; 656 clock-names = "core", "clkin0", "clkin1"; 657}; 658 659&sd_emmc_c { 660 clocks = <&clkc CLKID_SD_EMMC_C>, 661 <&clkc CLKID_SD_EMMC_C_CLK0>, 662 <&clkc CLKID_FCLK_DIV2>; 663 clock-names = "core", "clkin0", "clkin1"; 664}; 665 666&spicc { 667 clocks = <&clkc CLKID_SPICC>; 668 clock-names = "core"; 669 resets = <&reset RESET_PERIPHS_SPICC>; 670 num-cs = <1>; 671}; 672 673&spifc { 674 clocks = <&clkc CLKID_SPI>; 675}; 676 677&uart_A { 678 clocks = <&xtal>, <&clkc CLKID_UART0>, <&xtal>; 679 clock-names = "xtal", "core", "baud"; 680}; 681 682&uart_AO { 683 clocks = <&xtal>, <&clkc CLKID_CLK81>, <&xtal>; 684 clock-names = "xtal", "pclk", "baud"; 685}; 686 687&uart_AO_B { 688 clocks = <&xtal>, <&clkc CLKID_CLK81>, <&xtal>; 689 clock-names = "xtal", "pclk", "baud"; 690}; 691 692&uart_B { 693 clocks = <&xtal>, <&clkc CLKID_UART1>, <&xtal>; 694 clock-names = "xtal", "core", "baud"; 695}; 696 697&uart_C { 698 clocks = <&xtal>, <&clkc CLKID_UART2>, <&xtal>; 699 clock-names = "xtal", "core", "baud"; 700}; 701 702&vpu { 703 compatible = "amlogic,meson-gxl-vpu", "amlogic,meson-gx-vpu"; 704}; 705