0001 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
0002 /*
0003 * Copyright (c) 2019 Hardkernel Co., Ltd
0004 * Copyright (c) 2020 Theobroma Systems Design und Consulting GmbH
0005 */
0006
0007 /dts-v1/;
0008 #include <dt-bindings/gpio/gpio.h>
0009 #include <dt-bindings/input/input.h>
0010 #include <dt-bindings/pinctrl/rockchip.h>
0011 #include "rk3326.dtsi"
0012
0013 / {
0014 model = "ODROID-GO Advance";
0015 compatible = "hardkernel,rk3326-odroid-go2", "rockchip,rk3326";
0016
0017 aliases {
0018 mmc0 = &sdmmc;
0019 };
0020
0021 chosen {
0022 stdout-path = "serial2:115200n8";
0023 };
0024
0025 adc-joystick {
0026 compatible = "adc-joystick";
0027 io-channels = <&saradc 1>,
0028 <&saradc 2>;
0029 #address-cells = <1>;
0030 #size-cells = <0>;
0031
0032 axis@0 {
0033 reg = <0>;
0034 abs-flat = <10>;
0035 abs-fuzz = <10>;
0036 abs-range = <172 772>;
0037 linux,code = <ABS_X>;
0038 };
0039
0040 axis@1 {
0041 reg = <1>;
0042 abs-flat = <10>;
0043 abs-fuzz = <10>;
0044 abs-range = <278 815>;
0045 linux,code = <ABS_Y>;
0046 };
0047 };
0048
0049 backlight: backlight {
0050 compatible = "pwm-backlight";
0051 power-supply = <&vcc_bl>;
0052 pwms = <&pwm1 0 25000 0>;
0053 };
0054
0055 gpio-keys {
0056 compatible = "gpio-keys";
0057 pinctrl-names = "default";
0058 pinctrl-0 = <&btn_pins>;
0059
0060 /*
0061 * *** ODROIDGO2-Advance Switch layout ***
0062 * |------------------------------------------------|
0063 * | sw15 sw16 |
0064 * |------------------------------------------------|
0065 * | sw1 |-------------------| sw8 |
0066 * | sw3 sw4 | | sw7 sw5 |
0067 * | sw2 | LCD Display | sw6 |
0068 * | | | |
0069 * | |-------------------| |
0070 * | sw9 sw10 sw11 sw12 sw13 sw14 |
0071 * |------------------------------------------------|
0072 */
0073
0074 button-sw1 {
0075 gpios = <&gpio1 RK_PB4 GPIO_ACTIVE_LOW>;
0076 label = "DPAD-UP";
0077 linux,code = <BTN_DPAD_UP>;
0078 };
0079 button-sw2 {
0080 gpios = <&gpio1 RK_PB5 GPIO_ACTIVE_LOW>;
0081 label = "DPAD-DOWN";
0082 linux,code = <BTN_DPAD_DOWN>;
0083 };
0084 button-sw3 {
0085 gpios = <&gpio1 RK_PB6 GPIO_ACTIVE_LOW>;
0086 label = "DPAD-LEFT";
0087 linux,code = <BTN_DPAD_LEFT>;
0088 };
0089 button-sw4 {
0090 gpios = <&gpio1 RK_PB7 GPIO_ACTIVE_LOW>;
0091 label = "DPAD-RIGHT";
0092 linux,code = <BTN_DPAD_RIGHT>;
0093 };
0094 button-sw5 {
0095 gpios = <&gpio1 RK_PA2 GPIO_ACTIVE_LOW>;
0096 label = "BTN-A";
0097 linux,code = <BTN_EAST>;
0098 };
0099 button-sw6 {
0100 gpios = <&gpio1 RK_PA5 GPIO_ACTIVE_LOW>;
0101 label = "BTN-B";
0102 linux,code = <BTN_SOUTH>;
0103 };
0104 button-sw7 {
0105 gpios = <&gpio1 RK_PA6 GPIO_ACTIVE_LOW>;
0106 label = "BTN-Y";
0107 linux,code = <BTN_WEST>;
0108 };
0109 button-sw8 {
0110 gpios = <&gpio1 RK_PA7 GPIO_ACTIVE_LOW>;
0111 label = "BTN-X";
0112 linux,code = <BTN_NORTH>;
0113 };
0114 button-sw9 {
0115 gpios = <&gpio2 RK_PA0 GPIO_ACTIVE_LOW>;
0116 label = "F1";
0117 linux,code = <BTN_TRIGGER_HAPPY1>;
0118 };
0119 button-sw10 {
0120 gpios = <&gpio2 RK_PA1 GPIO_ACTIVE_LOW>;
0121 label = "F2";
0122 linux,code = <BTN_TRIGGER_HAPPY2>;
0123 };
0124 button-sw11 {
0125 gpios = <&gpio2 RK_PA2 GPIO_ACTIVE_LOW>;
0126 label = "F3";
0127 linux,code = <BTN_TRIGGER_HAPPY3>;
0128 };
0129 button-sw12 {
0130 gpios = <&gpio2 RK_PA3 GPIO_ACTIVE_LOW>;
0131 label = "F4";
0132 linux,code = <BTN_TRIGGER_HAPPY4>;
0133 };
0134 button-sw13 {
0135 gpios = <&gpio2 RK_PA4 GPIO_ACTIVE_LOW>;
0136 label = "F5";
0137 linux,code = <BTN_TRIGGER_HAPPY5>;
0138 };
0139 button-sw14 {
0140 gpios = <&gpio2 RK_PA5 GPIO_ACTIVE_LOW>;
0141 label = "F6";
0142 linux,code = <BTN_TRIGGER_HAPPY6>;
0143 };
0144 button-sw15 {
0145 gpios = <&gpio2 RK_PA6 GPIO_ACTIVE_LOW>;
0146 label = "TOP-LEFT";
0147 linux,code = <BTN_TL>;
0148 };
0149 button-sw16 {
0150 gpios = <&gpio2 RK_PA7 GPIO_ACTIVE_LOW>;
0151 label = "TOP-RIGHT";
0152 linux,code = <BTN_TR>;
0153 };
0154 };
0155
0156 leds: gpio-leds {
0157 compatible = "gpio-leds";
0158 pinctrl-names = "default";
0159 pinctrl-0 = <&blue_led_pin>;
0160
0161 blue_led: led-0 {
0162 label = "blue:heartbeat";
0163 gpios = <&gpio0 RK_PC1 GPIO_ACTIVE_HIGH>;
0164 linux,default-trigger = "heartbeat";
0165 };
0166 };
0167
0168 rk817-sound {
0169 compatible = "simple-audio-card";
0170 simple-audio-card,name = "Analog";
0171 simple-audio-card,format = "i2s";
0172 simple-audio-card,hp-det-gpio = <&gpio2 RK_PC6 GPIO_ACTIVE_HIGH>;
0173 simple-audio-card,mclk-fs = <256>;
0174 simple-audio-card,widgets =
0175 "Microphone", "Mic Jack",
0176 "Headphone", "Headphones",
0177 "Speaker", "Speaker";
0178 simple-audio-card,routing =
0179 "MICL", "Mic Jack",
0180 "Headphones", "HPOL",
0181 "Headphones", "HPOR",
0182 "Speaker", "SPKO";
0183
0184 simple-audio-card,codec {
0185 sound-dai = <&rk817>;
0186 };
0187
0188 simple-audio-card,cpu {
0189 sound-dai = <&i2s1_2ch>;
0190 };
0191 };
0192
0193 vccsys: vccsys {
0194 compatible = "regulator-fixed";
0195 regulator-name = "vcc3v8_sys";
0196 regulator-always-on;
0197 regulator-min-microvolt = <3800000>;
0198 regulator-max-microvolt = <3800000>;
0199 };
0200
0201 vcc_host: vcc_host {
0202 compatible = "regulator-fixed";
0203 regulator-name = "vcc_host";
0204 regulator-min-microvolt = <5000000>;
0205 regulator-max-microvolt = <5000000>;
0206
0207 gpio = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>;
0208 enable-active-high;
0209 regulator-always-on;
0210 regulator-boot-on;
0211 vin-supply = <&usb_midu>;
0212 };
0213 };
0214
0215 &cpu0 {
0216 cpu-supply = <&vdd_arm>;
0217 };
0218
0219 &cpu1 {
0220 cpu-supply = <&vdd_arm>;
0221 };
0222
0223 &cpu2 {
0224 cpu-supply = <&vdd_arm>;
0225 };
0226
0227 &cpu3 {
0228 cpu-supply = <&vdd_arm>;
0229 };
0230
0231 &cru {
0232 assigned-clocks = <&cru PLL_NPLL>,
0233 <&cru ACLK_BUS_PRE>, <&cru ACLK_PERI_PRE>,
0234 <&cru HCLK_BUS_PRE>, <&cru HCLK_PERI_PRE>,
0235 <&cru PCLK_BUS_PRE>, <&cru SCLK_GPU>,
0236 <&cru PLL_CPLL>;
0237
0238 assigned-clock-rates = <1188000000>,
0239 <200000000>, <200000000>,
0240 <150000000>, <150000000>,
0241 <100000000>, <200000000>,
0242 <17000000>;
0243 };
0244
0245 &display_subsystem {
0246 status = "okay";
0247 };
0248
0249 &dsi {
0250 status = "okay";
0251
0252 ports {
0253 mipi_out: port@1 {
0254 reg = <1>;
0255
0256 mipi_out_panel: endpoint {
0257 remote-endpoint = <&mipi_in_panel>;
0258 };
0259 };
0260 };
0261
0262 panel@0 {
0263 compatible = "elida,kd35t133";
0264 reg = <0>;
0265 backlight = <&backlight>;
0266 iovcc-supply = <&vcc_lcd>;
0267 reset-gpios = <&gpio3 RK_PC0 GPIO_ACTIVE_LOW>;
0268 rotation = <270>;
0269 vdd-supply = <&vcc_lcd>;
0270
0271 port {
0272 mipi_in_panel: endpoint {
0273 remote-endpoint = <&mipi_out_panel>;
0274 };
0275 };
0276 };
0277 };
0278
0279 &dsi_dphy {
0280 status = "okay";
0281 };
0282
0283 &gpu {
0284 mali-supply = <&vdd_logic>;
0285 status = "okay";
0286 };
0287
0288 &i2c0 {
0289 clock-frequency = <400000>;
0290 i2c-scl-falling-time-ns = <16>;
0291 i2c-scl-rising-time-ns = <280>;
0292 status = "okay";
0293
0294 rk817: pmic@20 {
0295 compatible = "rockchip,rk817";
0296 reg = <0x20>;
0297 interrupt-parent = <&gpio0>;
0298 interrupts = <RK_PB2 IRQ_TYPE_LEVEL_LOW>;
0299 clock-output-names = "rk808-clkout1", "xin32k";
0300 clock-names = "mclk";
0301 clocks = <&cru SCLK_I2S1_OUT>;
0302 pinctrl-names = "default";
0303 pinctrl-0 = <&pmic_int>, <&i2s1_2ch_mclk>;
0304 wakeup-source;
0305 #clock-cells = <1>;
0306 #sound-dai-cells = <0>;
0307
0308 vcc1-supply = <&vccsys>;
0309 vcc2-supply = <&vccsys>;
0310 vcc3-supply = <&vccsys>;
0311 vcc4-supply = <&vccsys>;
0312 vcc5-supply = <&vccsys>;
0313 vcc6-supply = <&vccsys>;
0314 vcc7-supply = <&vccsys>;
0315 vcc8-supply = <&vccsys>;
0316
0317 regulators {
0318 vdd_logic: DCDC_REG1 {
0319 regulator-name = "vdd_logic";
0320 regulator-min-microvolt = <950000>;
0321 regulator-max-microvolt = <1150000>;
0322 regulator-ramp-delay = <6001>;
0323 regulator-always-on;
0324 regulator-boot-on;
0325
0326 regulator-state-mem {
0327 regulator-on-in-suspend;
0328 regulator-suspend-microvolt = <950000>;
0329 };
0330 };
0331
0332 vdd_arm: DCDC_REG2 {
0333 regulator-name = "vdd_arm";
0334 regulator-min-microvolt = <950000>;
0335 regulator-max-microvolt = <1350000>;
0336 regulator-ramp-delay = <6001>;
0337 regulator-always-on;
0338 regulator-boot-on;
0339
0340 regulator-state-mem {
0341 regulator-off-in-suspend;
0342 regulator-suspend-microvolt = <950000>;
0343 };
0344 };
0345
0346 vcc_ddr: DCDC_REG3 {
0347 regulator-name = "vcc_ddr";
0348 regulator-always-on;
0349 regulator-boot-on;
0350
0351 regulator-state-mem {
0352 regulator-on-in-suspend;
0353 };
0354 };
0355
0356 vcc_3v3: DCDC_REG4 {
0357 regulator-name = "vcc_3v3";
0358 regulator-min-microvolt = <3300000>;
0359 regulator-max-microvolt = <3300000>;
0360 regulator-always-on;
0361 regulator-boot-on;
0362
0363 regulator-state-mem {
0364 regulator-off-in-suspend;
0365 regulator-suspend-microvolt = <3300000>;
0366 };
0367 };
0368
0369 vcc_1v8: LDO_REG2 {
0370 regulator-name = "vcc_1v8";
0371 regulator-min-microvolt = <1800000>;
0372 regulator-max-microvolt = <1800000>;
0373 regulator-always-on;
0374 regulator-boot-on;
0375
0376 regulator-state-mem {
0377 regulator-on-in-suspend;
0378 regulator-suspend-microvolt = <1800000>;
0379 };
0380 };
0381
0382 vdd_1v0: LDO_REG3 {
0383 regulator-name = "vdd_1v0";
0384 regulator-min-microvolt = <1000000>;
0385 regulator-max-microvolt = <1000000>;
0386 regulator-always-on;
0387 regulator-boot-on;
0388
0389 regulator-state-mem {
0390 regulator-on-in-suspend;
0391 regulator-suspend-microvolt = <1000000>;
0392 };
0393 };
0394
0395 vcc3v3_pmu: LDO_REG4 {
0396 regulator-name = "vcc3v3_pmu";
0397 regulator-min-microvolt = <3300000>;
0398 regulator-max-microvolt = <3300000>;
0399 regulator-always-on;
0400 regulator-boot-on;
0401
0402 regulator-state-mem {
0403 regulator-on-in-suspend;
0404 regulator-suspend-microvolt = <3300000>;
0405 };
0406 };
0407
0408 vccio_sd: LDO_REG5 {
0409 regulator-name = "vccio_sd";
0410 regulator-min-microvolt = <1800000>;
0411 regulator-max-microvolt = <3300000>;
0412 regulator-always-on;
0413 regulator-boot-on;
0414
0415 regulator-state-mem {
0416 regulator-on-in-suspend;
0417 regulator-suspend-microvolt = <3300000>;
0418 };
0419 };
0420
0421 vcc_sd: LDO_REG6 {
0422 regulator-name = "vcc_sd";
0423 regulator-min-microvolt = <3300000>;
0424 regulator-max-microvolt = <3300000>;
0425 regulator-boot-on;
0426
0427 regulator-state-mem {
0428 regulator-on-in-suspend;
0429 regulator-suspend-microvolt = <3300000>;
0430 };
0431 };
0432
0433 vcc_bl: LDO_REG7 {
0434 regulator-name = "vcc_bl";
0435 regulator-min-microvolt = <3300000>;
0436 regulator-max-microvolt = <3300000>;
0437
0438 regulator-state-mem {
0439 regulator-off-in-suspend;
0440 regulator-suspend-microvolt = <3300000>;
0441 };
0442 };
0443
0444 vcc_lcd: LDO_REG8 {
0445 regulator-name = "vcc_lcd";
0446 regulator-min-microvolt = <2800000>;
0447 regulator-max-microvolt = <2800000>;
0448
0449 regulator-state-mem {
0450 regulator-off-in-suspend;
0451 regulator-suspend-microvolt = <2800000>;
0452 };
0453 };
0454
0455 vcc_cam: LDO_REG9 {
0456 regulator-name = "vcc_cam";
0457 regulator-min-microvolt = <3000000>;
0458 regulator-max-microvolt = <3000000>;
0459
0460 regulator-state-mem {
0461 regulator-off-in-suspend;
0462 regulator-suspend-microvolt = <3000000>;
0463 };
0464 };
0465
0466 usb_midu: BOOST {
0467 regulator-name = "usb_midu";
0468 regulator-min-microvolt = <5000000>;
0469 regulator-max-microvolt = <5400000>;
0470 regulator-always-on;
0471 regulator-boot-on;
0472 };
0473 };
0474
0475 rk817_codec: codec {
0476 rockchip,mic-in-differential;
0477 };
0478 };
0479 };
0480
0481 /* EXT Header(P2): 7(SCL:GPIO0.C2), 8(SDA:GPIO0.C3) */
0482 &i2c1 {
0483 clock-frequency = <400000>;
0484 status = "okay";
0485 };
0486
0487 /* I2S 1 Channel Used */
0488 &i2s1_2ch {
0489 status = "okay";
0490 };
0491
0492 &io_domains {
0493 vccio1-supply = <&vcc_3v3>;
0494 vccio2-supply = <&vccio_sd>;
0495 vccio3-supply = <&vcc_3v3>;
0496 vccio4-supply = <&vcc_3v3>;
0497 vccio5-supply = <&vcc_3v3>;
0498 vccio6-supply = <&vcc_3v3>;
0499 status = "okay";
0500 };
0501
0502 &pmu_io_domains {
0503 pmuio1-supply = <&vcc3v3_pmu>;
0504 pmuio2-supply = <&vcc3v3_pmu>;
0505 status = "okay";
0506 };
0507
0508 &pwm1 {
0509 status = "okay";
0510 };
0511
0512 &saradc {
0513 vref-supply = <&vcc_1v8>;
0514 status = "okay";
0515 };
0516
0517 &sdmmc {
0518 cap-sd-highspeed;
0519 card-detect-delay = <200>;
0520 cd-gpios = <&gpio0 RK_PA3 GPIO_ACTIVE_LOW>; /*[> CD GPIO <]*/
0521 sd-uhs-sdr12;
0522 sd-uhs-sdr25;
0523 sd-uhs-sdr50;
0524 sd-uhs-sdr104;
0525 vmmc-supply = <&vcc_sd>;
0526 vqmmc-supply = <&vccio_sd>;
0527 status = "okay";
0528 };
0529
0530 &sfc {
0531 pinctrl-0 = <&sfc_clk &sfc_cs0 &sfc_bus2>;
0532 pinctrl-names = "default";
0533 #address-cells = <1>;
0534 #size-cells = <0>;
0535 status = "okay";
0536
0537 flash@0 {
0538 compatible = "jedec,spi-nor";
0539 reg = <0>;
0540 spi-max-frequency = <108000000>;
0541 spi-rx-bus-width = <2>;
0542 spi-tx-bus-width = <1>;
0543 };
0544 };
0545
0546 &tsadc {
0547 status = "okay";
0548 };
0549
0550 &u2phy {
0551 status = "okay";
0552
0553 u2phy_host: host-port {
0554 status = "okay";
0555 };
0556
0557 u2phy_otg: otg-port {
0558 status = "disabled";
0559 };
0560 };
0561
0562 &usb20_otg {
0563 status = "okay";
0564 };
0565
0566 /* EXT Header(P2): 2(RXD:GPIO1.C0),3(TXD:.C1),4(CTS:.C2),5(RTS:.C3) */
0567 &uart1 {
0568 pinctrl-names = "default";
0569 pinctrl-0 = <&uart1_xfer &uart1_cts>;
0570 status = "okay";
0571 };
0572
0573 &uart2 {
0574 pinctrl-names = "default";
0575 pinctrl-0 = <&uart2m1_xfer>;
0576 status = "okay";
0577 };
0578
0579 &vopb {
0580 status = "okay";
0581 };
0582
0583 &vopb_mmu {
0584 status = "okay";
0585 };
0586
0587 &pinctrl {
0588 btns {
0589 btn_pins: btn-pins {
0590 rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>,
0591 <1 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>,
0592 <1 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>,
0593 <1 RK_PA7 RK_FUNC_GPIO &pcfg_pull_up>,
0594 <1 RK_PB4 RK_FUNC_GPIO &pcfg_pull_up>,
0595 <1 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>,
0596 <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_up>,
0597 <1 RK_PB7 RK_FUNC_GPIO &pcfg_pull_up>,
0598 <2 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>,
0599 <2 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>,
0600 <2 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>,
0601 <2 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>,
0602 <2 RK_PA4 RK_FUNC_GPIO &pcfg_pull_up>,
0603 <2 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>,
0604 <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>,
0605 <2 RK_PA7 RK_FUNC_GPIO &pcfg_pull_up>;
0606 };
0607 };
0608
0609 headphone {
0610 hp_det: hp-det {
0611 rockchip,pins = <2 RK_PC6 RK_FUNC_GPIO &pcfg_pull_down>;
0612 };
0613 };
0614
0615 leds {
0616 blue_led_pin: blue-led-pin {
0617 rockchip,pins = <0 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
0618 };
0619 };
0620
0621 pmic {
0622 dc_det: dc-det {
0623 rockchip,pins = <0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
0624 };
0625
0626 pmic_int: pmic-int {
0627 rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>;
0628 };
0629
0630 soc_slppin_gpio: soc_slppin_gpio {
0631 rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_output_low>;
0632 };
0633
0634 soc_slppin_rst: soc_slppin_rst {
0635 rockchip,pins = <0 RK_PA4 2 &pcfg_pull_none>;
0636 };
0637
0638 soc_slppin_slp: soc_slppin_slp {
0639 rockchip,pins = <0 RK_PA4 1 &pcfg_pull_none>;
0640 };
0641 };
0642 };