1/* 2 * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd 3 * 4 * SPDX-License-Identifier: (GPL-2.0+ OR MIT) 5 */ 6/dts-v1/; 7#include <dt-bindings/gpio/gpio.h> 8#include <dt-bindings/input/input.h> 9#include <dt-bindings/pinctrl/rockchip.h> 10#include <dt-bindings/pwm/pwm.h> 11#include <dt-bindings/sensor-dev.h> 12#include "rk3126.dtsi" 13#include "rk312x-android.dtsi" 14 15/ { 16 model = "Rockchip RK3126 m88 board"; 17 compatible = "rockchip,rk3126-m88", "rockchip,rk3126"; 18 19 adc-keys { 20 compatible = "adc-keys"; 21 io-channels = <&saradc 2>; 22 io-channel-names = "buttons"; 23 poll-interval = <100>; 24 keyup-threshold-microvolt = <2429000>; 25 26 button-up { 27 label = "Volume Up"; 28 linux,code = <KEY_VOLUMEUP>; 29 press-threshold-microvolt = <0>; 30 }; 31 32 button-down { 33 label = "Volume Down"; 34 linux,code = <KEY_VOLUMEDOWN>; 35 press-threshold-microvolt = <1650000>; 36 }; 37 }; 38 39 backlight: backlight { 40 compatible = "pwm-backlight"; 41 pwms = <&pwm0 0 25000 0>; 42 brightness-levels = < 43 0 1 2 3 4 5 6 7 8 9 10 44 11 12 13 14 15 16 17 18 19 20 45 21 22 23 24 25 26 27 28 29 30 46 31 32 33 34 35 36 37 38 39 40 47 41 42 43 44 45 46 47 48 49 50 48 51 52 53 54 55 56 57 58 59 60 49 61 62 63 64 65 66 67 68 69 70 50 71 72 73 74 75 76 77 78 79 80 51 81 82 83 84 85 86 87 88 89 90 52 91 92 93 94 95 96 97 98 99 100 53 101 102 103 104 105 106 107 108 54 109 110 111 112 113 114 115 116 55 117 118 119 120 121 122 123 124 56 125 126 127 128 129 130 131 132 57 133 134 135 136 137 138 139 140 58 141 142 143 144 145 146 147 148 59 149 150 151 152 153 154 155 156 60 157 158 159 160 161 162 163 164 61 165 166 167 169 169 170 171 172 62 173 174 175 176 177 178 179 180 63 181 182 183 184 185 186 187 188 64 189 190 191 192 193 194 195 196 65 197 198 199 200 201 202 203 204 66 205 208 208 208 209 210 211 212 67 213 214 215 216 217 218 219 220 68 221 222 223 224 225 226 227 228 69 229 230 231 232 233 234 235 236 70 237 238 239 240 241 242 243 244 71 245 246 247 248 249 250 251 252 72 253 254 255>; 73 default-brightness-level = <128>; 74 }; 75 76 charge-animation { 77 compatible = "rockchip,uboot-charge"; 78 rockchip,uboot-charge-on = <1>; 79 rockchip,android-charge-on = <0>; 80 rockchip,uboot-low-power-voltage = <3500>; 81 rockchip,screen-on-voltage = <3600>; 82 status = "okay"; 83 }; 84 85 panel { 86 compatible = "simple-panel"; 87 backlight = <&backlight>; 88 power-supply = <&ldo6>; 89 power-invert; 90 enable-delay-ms = <120>; 91 disable-delay-ms = <20>; 92 unprepare-delay-ms = <20>; 93 bus-format = <MEDIA_BUS_FMT_RGB666_1X18>; 94 95 width-mm = <153>; 96 height-mm = <85>; 97 98 display-timings { 99 native-mode = <&timing0>; 100 101 timing0: timing0 { 102 clock-frequency = <51200000>; 103 hactive = <1024>; 104 vactive = <600>; 105 hback-porch = <100>; 106 hfront-porch = <120>; 107 vback-porch = <10>; 108 vfront-porch = <15>; 109 hsync-len = <100>; 110 vsync-len = <10>; 111 hsync-active = <0>; 112 vsync-active = <0>; 113 de-active = <0>; 114 pixelclk-active = <0>; 115 }; 116 }; 117 118 port { 119 panel_in_rgb: endpoint { 120 remote-endpoint = <&rgb_out_panel>; 121 }; 122 }; 123 }; 124 125 rockchip_headset { 126 compatible = "rockchip_headset"; 127 io-channels = <&saradc 2>; 128 }; 129 130 sound { 131 compatible = "simple-audio-card"; 132 simple-audio-card,format = "i2s"; 133 simple-audio-card,mclk-fs = <256>; 134 simple-audio-card,name = "rockchip,rk312x"; 135 simple-audio-card,cpu { 136 sound-dai = <&i2s_2ch>; 137 }; 138 simple-audio-card,codec { 139 sound-dai = <&codec>; 140 }; 141 }; 142 143 vccadc_ref: vccadc-ref { 144 compatible = "regulator-fixed"; 145 regulator-name = "SARADC_AVDD33"; 146 regulator-always-on; 147 regulator-boot-on; 148 regulator-min-microvolt = <3300000>; 149 regulator-max-microvolt = <3300000>; 150 }; 151 152 vcc_sys: vcc-sys { 153 compatible = "regulator-fixed"; 154 regulator-name = "vcc_sys"; 155 regulator-min-microvolt = <4000000>; 156 regulator-max-microvolt = <4000000>; 157 regulator-always-on; 158 }; 159 160 xin32k: xin32k { 161 compatible = "fixed-clock"; 162 clock-frequency = <32768>; 163 clock-output-names = "xin32k"; 164 #clock-cells = <0>; 165 }; 166 167 wireless-bluetooth { 168 compatible = "bluetooth-platdata"; 169 /* wifi-bt-power-toggle; */ 170 171 keep_wifi_power_on = <1>; 172 uart_rts_gpios = <&gpio1 11 GPIO_ACTIVE_LOW>; /* GPIO1_B3 */ 173 pinctrl-names = "default","rts_gpio"; 174 pinctrl-0 = <&uart1_rts>; 175 pinctrl-1 = <&uart1_rts_gpio>; 176 BT,reset_gpio = <&gpio2 9 GPIO_ACTIVE_HIGH>; /* GPIO2_B1 */ 177 BT,wake_gpio = <&gpio0 27 GPIO_ACTIVE_HIGH>; /* GPIO0_D3 */ 178 BT,wake_host_irq = <&gpio2 21 GPIO_ACTIVE_LOW>; /* GPIO2_C5 */ 179 status = "okay"; 180 }; 181 182 wireless-wlan { 183 compatible = "wlan-platdata"; 184 185 wifi_chip_type = "rtl8723cs"; 186 WIFI,host_wake_irq = <&gpio0 RK_PD3 GPIO_ACTIVE_HIGH>; 187 status = "okay"; 188 }; 189}; 190 191&codec { 192 #sound-dai-cells = <0>; 193 spk-ctl-gpios = <&gpio2 10 GPIO_ACTIVE_HIGH>; 194 spk-mute-delay = <200>; 195 hp-mute-delay = <100>; 196 is_rk3128 = <0>; 197 spk_volume = <25>; 198 hp_volume = <25>; 199 capture_volume = <26>; 200 gpio_debug = <1>; 201 codec_hp_det = <0>; 202 status = "okay"; 203}; 204 205&cif_new { 206 status = "okay"; 207 208 ports { 209 port@0 { 210 cif_in_fcam: endpoint@0 { 211 remote-endpoint = <&gc0312_out>; 212 vsync-active = <0>; 213 hsync-active = <1>; 214 }; 215 216 cif_in_bcam: endpoint@1 { 217 remote-endpoint = <&gc2035_out>; 218 vsync-active = <1>; 219 hsync-active = <1>; 220 }; 221 }; 222 }; 223}; 224 225&cpu0 { 226 cpu-supply = <&vdd_arm>; 227}; 228 229&dmc { 230 center-supply = <&vdd_log>; 231}; 232 233&emmc { 234 bus-width = <8>; 235 cap-mmc-highspeed; 236 no-sdio; 237 no-sd; 238 mmc-ddr-1_8v; 239 disable-wp; 240 non-removable; 241 num-slots = <1>; 242 status = "okay"; 243}; 244 245&gpu { 246 status = "okay"; 247 mali-supply = <&vdd_log>; 248}; 249 250&i2c0 { 251 status = "okay"; 252 clock-frequency = <400000>; 253 254 rk816: pmic@1a { 255 compatible = "rockchip,rk816"; 256 reg = <0x1a>; 257 interrupt-parent = <&gpio0>; 258 interrupts = <2 IRQ_TYPE_LEVEL_LOW>; 259 pinctrl-names = "default"; 260 pinctrl-0 = <&pmic_int_l>; 261 rockchip,system-power-controller; 262 wakeup-source; 263 gpio-controller; 264 #gpio-cells = <2>; 265 #clock-cells = <1>; 266 clock-output-names = "rk816-clkout1", "rk816-clkout2"; 267 extcon = <&u2phy>; 268 269 vcc1-supply = <&vcc_sys>; 270 vcc2-supply = <&vcc_sys>; 271 vcc3-supply = <&vcc_sys>; 272 vcc4-supply = <&vcc_sys>; 273 vcc5-supply = <&vcc_io>; 274 vcc6-supply = <&vcc_sys>; 275 276 gpio { 277 status = "okay"; 278 }; 279 280 pwrkey { 281 status = "okay"; 282 }; 283 284 rtc { 285 status = "okay"; 286 }; 287 288 battery { 289 compatible = "rk816-battery"; 290 ocv_table = < 3500 3625 3685 3697 3718 3735 3748 291 3760 3774 3788 3802 3816 3834 3853 292 3877 3908 3946 3975 4018 4071 4106>; 293 design_capacity = <2500>; 294 design_qmax = <2750>; 295 bat_res = <100>; 296 max_input_current = <1500>; 297 max_chrg_current = <1300>; 298 max_chrg_voltage = <4200>; 299 sleep_enter_current = <300>; 300 sleep_exit_current = <300>; 301 sleep_filter_current = <100>; 302 power_off_thresd = <3500>; 303 zero_algorithm_vol = <3850>; 304 max_soc_offset = <60>; 305 monitor_sec = <5>; 306 virtual_power = <0>; 307 power_dc2otg = <0>; 308 dc_det_adc = <0>; 309 }; 310 311 regulators { 312 313 vdd_arm: DCDC_REG1{ 314 regulator-name= "vdd_arm"; 315 regulator-min-microvolt = <750000>; 316 regulator-max-microvolt = <1500000>; 317 regulator-ramp-delay = <6001>; 318 regulator-initial-mode = <1>; 319 regulator-always-on; 320 regulator-boot-on; 321 regulator-state-mem { 322 regulator-off-in-suspend; 323 regulator-suspend-microvolt = <900000>; 324 }; 325 }; 326 327 vdd_log: DCDC_REG2 { 328 regulator-name= "vdd_logic"; 329 regulator-min-microvolt = <750000>; 330 regulator-max-microvolt = <1500000>; 331 regulator-ramp-delay = <6001>; 332 regulator-initial-mode = <1>; 333 regulator-always-on; 334 regulator-boot-on; 335 regulator-state-mem { 336 regulator-on-in-suspend; 337 regulator-suspend-microvolt = <1000000>; 338 }; 339 }; 340 341 vcc_ddr: DCDC_REG3 { 342 regulator-name = "vcc_ddr"; 343 regulator-always-on; 344 regulator-boot-on; 345 }; 346 347 vcc_io: DCDC_REG4 { 348 regulator-name = "vcc_io"; 349 regulator-min-microvolt = <3300000>; 350 regulator-max-microvolt = <3300000>; 351 regulator-initial-mode = <1>; 352 regulator-always-on; 353 regulator-boot-on; 354 regulator-state-mem { 355 regulator-on-in-suspend; 356 regulator-suspend-microvolt = <3000000>; 357 }; 358 }; 359 360 vcc28_cif: LDO_REG1 { 361 regulator-name = "vcc28_cif"; 362 regulator-min-microvolt = <2800000>; 363 regulator-max-microvolt = <2800000>; 364 regulator-always-on; 365 regulator-boot-on; 366 regulator-state-mem { 367 regulator-off-in-suspend; 368 }; 369 }; 370 371 vcc18_cif: LDO_REG2 { 372 regulator-name = "vcc18_cif"; 373 regulator-min-microvolt = <1800000>; 374 regulator-max-microvolt = <1800000>; 375 regulator-always-on; 376 regulator-boot-on; 377 regulator-state-mem { 378 regulator-off-in-suspend; 379 }; 380 }; 381 382 vdd_11: LDO_REG3 { 383 regulator-name = "vdd_11"; 384 regulator-min-microvolt = <1100000>; 385 regulator-max-microvolt = <1100000>; 386 regulator-always-on; 387 regulator-boot-on; 388 regulator-state-mem { 389 regulator-on-in-suspend; 390 regulator-suspend-microvolt = <1100000>; 391 }; 392 }; 393 394 ldo4: LDO_REG4 { 395 regulator-name= "ldo4"; 396 regulator-min-microvolt = <3300000>; 397 regulator-max-microvolt = <3300000>; 398 regulator-always-on; 399 regulator-boot-on; 400 regulator-state-mem { 401 regulator-off-in-suspend; 402 }; 403 }; 404 405 ldo5: LDO_REG5 { 406 regulator-name= "ldo5"; 407 regulator-min-microvolt = <3000000>; 408 regulator-max-microvolt = <3000000>; 409 regulator-always-on; 410 regulator-boot-on; 411 regulator-state-mem { 412 regulator-on-in-suspend; 413 }; 414 }; 415 416 ldo6: LDO_REG6 { 417 regulator-name= "ldo6"; 418 regulator-min-microvolt = <3300000>; 419 regulator-max-microvolt = <3300000>; 420 regulator-state-mem { 421 regulator-on-in-suspend; 422 regulator-suspend-microvolt = <3300000>; 423 }; 424 }; 425 }; 426 }; 427 428 gc0312@21 { 429 compatible = "galaxycore,gc0312"; 430 reg = <0x21>; 431 432 clocks = <&cru SCLK_CIF_OUT>; 433 clock-names = "xvclk"; 434 435 avdd-supply = <&vcc28_cif>; 436 dovdd-supply = <&vcc18_cif>; 437 dvdd-supply = <&vcc18_cif>; 438 439 pwdn-gpios = <&gpio3 RK_PB3 GPIO_ACTIVE_HIGH>; 440 rockchip,camera-module-index = <1>; 441 rockchip,camera-module-facing = "front"; 442 rockchip,camera-module-name = "default"; 443 rockchip,camera-module-lens-name = "default"; 444 port { 445 gc0312_out: endpoint { 446 remote-endpoint = <&cif_in_fcam>; 447 }; 448 }; 449 }; 450 451 gc2035@3c { 452 compatible = "galaxycore,gc2035"; 453 reg = <0x3c>; 454 455 clocks = <&cru SCLK_CIF_OUT>; 456 clock-names = "xvclk"; 457 458 avdd-supply = <&vcc28_cif>; 459 dovdd-supply = <&vcc18_cif>; 460 dvdd-supply = <&vcc18_cif>; 461 462 //pwdn-gpios = <&rk816 0 GPIO_ACTIVE_HIGH>; 463 rockchip,camera-module-index = <0>; 464 rockchip,camera-module-facing = "back"; 465 rockchip,camera-module-name = "default"; 466 rockchip,camera-module-lens-name = "default"; 467 port { 468 gc2035_out: endpoint { 469 remote-endpoint = <&cif_in_bcam>; 470 }; 471 }; 472 }; 473 474 sensor@4c { 475 compatible = "gs_mc3230"; 476 reg = <0x4c>; 477 type = <SENSOR_TYPE_ACCEL>; 478 irq_enable = <0>; 479 poll_delay_ms = <30>; 480 layout = <2>; 481 reprobe_en = <1>; 482 }; 483 484 ts@40 { 485 compatible = "gslX680-d708"; 486 reg = <0x40>; 487 touch-gpio = <&gpio2 20 IRQ_TYPE_LEVEL_LOW>; 488 //wake-gpio = <&gpio2 12 IRQ_TYPE_LEVEL_LOW>; 489 rst-supply = <&ldo6>; 490 screen_max_x = <800>; 491 screen_max_y = <480>; 492 revert_y = <0>; 493 status = "okay"; 494 }; 495 496}; 497 498&i2s_2ch { 499 #sound-dai-cells = <0>; 500 status = "okay"; 501}; 502 503&iep { 504 status = "okay"; 505}; 506 507&iep_mmu { 508 status = "okay"; 509}; 510 511&mpp_srv { 512 status = "okay"; 513}; 514 515&nandc { 516 status = "okay"; 517}; 518 519&pinctrl { 520 lcdc { 521 lcdc_rgb_pins: lcdc-rgb-pins { 522 rockchip,pins = 523 <2 RK_PB0 1 &pcfg_pull_none>, /* DCLK */ 524 <2 RK_PB3 1 &pcfg_pull_none>, /* DEN */ 525 <2 RK_PB4 1 &pcfg_pull_none>, /* DATA10 */ 526 <2 RK_PB5 1 &pcfg_pull_none>, /* DATA11 */ 527 <2 RK_PB6 1 &pcfg_pull_none>, /* DATA12 */ 528 <2 RK_PB7 1 &pcfg_pull_none>, /* DATA13 */ 529 <2 RK_PC0 1 &pcfg_pull_none>, /* DATA14 */ 530 <2 RK_PC1 1 &pcfg_pull_none>, /* DATA15 */ 531 <2 RK_PC2 1 &pcfg_pull_none>, /* DATA16 */ 532 <2 RK_PC3 1 &pcfg_pull_none>; /* DATA17 */ 533 }; 534 535 lcdc_sleep_pins: lcdc-sleep-pins { 536 rockchip,pins = 537 <2 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>, /* DCLK */ 538 <2 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>, /* DEN */ 539 <2 RK_PB4 RK_FUNC_GPIO &pcfg_pull_none>, /* DATA10 */ 540 <2 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>, /* DATA11 */ 541 <2 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>, /* DATA12 */ 542 <2 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>, /* DATA13 */ 543 <2 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>, /* DATA14 */ 544 <2 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>, /* DATA15 */ 545 <2 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>, /* DATA16 */ 546 <2 RK_PC3 RK_FUNC_GPIO &pcfg_pull_none>; /* DATA17 */ 547 }; 548 }; 549 550 pmic { 551 pmic_int_l: pmic-int-l { 552 rockchip,pins = 553 <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_default>; 554 }; 555 }; 556 557 wireless-bluetooth { 558 uart1_rts_gpio: uart1-rts-gpio { 559 rockchip,pins = <1 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>; 560 }; 561 }; 562}; 563 564&pwm0 { 565 status = "okay"; 566}; 567 568&rga { 569 status = "okay"; 570}; 571 572&saradc { 573 status = "okay"; 574 vref-supply = <&vccadc_ref>; 575}; 576 577&sdmmc { 578 cap-mmc-highspeed; 579 no-sdio; 580 no-mmc; 581 broken-cd; 582 card-detect-delay = <800>; 583 ignore-pm-notify; 584 keep-power-in-suspend; 585 /*cd-gpios = <&gpio2 4 GPIO_ACTIVE_HIGH>; [> CD GPIO <]*/ 586 status = "disabled"; 587}; 588 589&sdio { 590 max-frequency = <50000000>; 591 cap-sd-highspeed; 592 no-sd; 593 no-mmc; 594 ignore-pm-notify; 595 keep-power-in-suspend; 596 non-removable; 597 vmmc-supply = <&ldo5>; 598 status = "okay"; 599}; 600 601&tsadc { 602 status = "okay"; 603}; 604 605&rgb { 606 pinctrl-names = "default", "sleep"; 607 pinctrl-0 = <&lcdc_rgb_pins>; 608 pinctrl-1 = <&lcdc_sleep_pins>; 609 status = "okay"; 610 611 ports { 612 port@1 { 613 reg = <1>; 614 615 rgb_out_panel: endpoint { 616 remote-endpoint = <&panel_in_rgb>; 617 }; 618 }; 619 }; 620}; 621 622&route_rgb { 623 status = "okay"; 624}; 625 626&u2phy { 627 status = "okay"; 628 629 u2phy_otg: otg-port { 630 status = "okay"; 631 }; 632 633 u2phy_host: host-port { 634 status = "okay"; 635 }; 636}; 637 638&uart1 { 639 pinctrl-names = "default"; 640 pinctrl-0 = <&uart1_xfer &uart1_cts>; 641 status = "okay"; 642}; 643 644&usb_otg { 645 status = "okay"; 646}; 647 648&vop { 649 status = "okay"; 650}; 651 652&vop_mmu { 653 status = "okay"; 654}; 655 656&vdpu { 657 status = "okay"; 658}; 659 660&vepu { 661 status = "okay"; 662}; 663 664&vpu_mmu { 665 status = "okay"; 666}; 667