17d0873ebSEmmanuel Vadot// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 27d0873ebSEmmanuel Vadot/* 37d0873ebSEmmanuel Vadot * Copyright (C) 2024 Ryan Walklin <ryan@testtoast.com>. 47d0873ebSEmmanuel Vadot */ 57d0873ebSEmmanuel Vadot 67d0873ebSEmmanuel Vadot/dts-v1/; 77d0873ebSEmmanuel Vadot 87d0873ebSEmmanuel Vadot#include "sun50i-h616.dtsi" 9*0e8011faSEmmanuel Vadot#include "sun50i-h616-cpu-opp.dtsi" 107d0873ebSEmmanuel Vadot#include <dt-bindings/gpio/gpio.h> 117d0873ebSEmmanuel Vadot#include <dt-bindings/input/linux-event-codes.h> 127d0873ebSEmmanuel Vadot#include <dt-bindings/interrupt-controller/arm-gic.h> 137d0873ebSEmmanuel Vadot#include <dt-bindings/leds/common.h> 147d0873ebSEmmanuel Vadot 157d0873ebSEmmanuel Vadot/ { 167d0873ebSEmmanuel Vadot model = "Anbernic RG35XX 2024"; 177d0873ebSEmmanuel Vadot chassis-type = "handset"; 187d0873ebSEmmanuel Vadot compatible = "anbernic,rg35xx-2024", "allwinner,sun50i-h700"; 197d0873ebSEmmanuel Vadot 207d0873ebSEmmanuel Vadot aliases { 217d0873ebSEmmanuel Vadot serial0 = &uart0; 227d0873ebSEmmanuel Vadot }; 237d0873ebSEmmanuel Vadot 247d0873ebSEmmanuel Vadot chosen { 257d0873ebSEmmanuel Vadot stdout-path = "serial0:115200n8"; 267d0873ebSEmmanuel Vadot }; 277d0873ebSEmmanuel Vadot 287d0873ebSEmmanuel Vadot gpio_keys_gamepad: gpio-keys-gamepad { 297d0873ebSEmmanuel Vadot compatible = "gpio-keys"; 307d0873ebSEmmanuel Vadot 317d0873ebSEmmanuel Vadot button-a { 327d0873ebSEmmanuel Vadot label = "Action-Pad A"; 337d0873ebSEmmanuel Vadot gpios = <&pio 0 0 GPIO_ACTIVE_LOW>; /* PA0 */ 347d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 357d0873ebSEmmanuel Vadot linux,code = <BTN_EAST>; 367d0873ebSEmmanuel Vadot }; 377d0873ebSEmmanuel Vadot 387d0873ebSEmmanuel Vadot button-b { 397d0873ebSEmmanuel Vadot label = "Action-Pad B"; 407d0873ebSEmmanuel Vadot gpios = <&pio 0 1 GPIO_ACTIVE_LOW>; /* PA1 */ 417d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 427d0873ebSEmmanuel Vadot linux,code = <BTN_SOUTH>; 437d0873ebSEmmanuel Vadot }; 447d0873ebSEmmanuel Vadot 457d0873ebSEmmanuel Vadot button-down { 467d0873ebSEmmanuel Vadot label = "D-Pad Down"; 477d0873ebSEmmanuel Vadot gpios = <&pio 4 0 GPIO_ACTIVE_LOW>; /* PE0 */ 487d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 497d0873ebSEmmanuel Vadot linux,code = <BTN_DPAD_DOWN>; 507d0873ebSEmmanuel Vadot }; 517d0873ebSEmmanuel Vadot 527d0873ebSEmmanuel Vadot button-l1 { 537d0873ebSEmmanuel Vadot label = "Key L1"; 547d0873ebSEmmanuel Vadot gpios = <&pio 0 10 GPIO_ACTIVE_LOW>; /* PA10 */ 557d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 567d0873ebSEmmanuel Vadot linux,code = <BTN_TL>; 577d0873ebSEmmanuel Vadot }; 587d0873ebSEmmanuel Vadot 597d0873ebSEmmanuel Vadot button-l2 { 607d0873ebSEmmanuel Vadot label = "Key L2"; 617d0873ebSEmmanuel Vadot gpios = <&pio 0 11 GPIO_ACTIVE_LOW>; /* PA11 */ 627d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 637d0873ebSEmmanuel Vadot linux,code = <BTN_TL2>; 647d0873ebSEmmanuel Vadot }; 657d0873ebSEmmanuel Vadot 667d0873ebSEmmanuel Vadot button-left { 677d0873ebSEmmanuel Vadot label = "D-Pad left"; 687d0873ebSEmmanuel Vadot gpios = <&pio 0 8 GPIO_ACTIVE_LOW>; /* PA8 */ 697d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 707d0873ebSEmmanuel Vadot linux,code = <BTN_DPAD_LEFT>; 717d0873ebSEmmanuel Vadot }; 727d0873ebSEmmanuel Vadot 737d0873ebSEmmanuel Vadot button-menu { 747d0873ebSEmmanuel Vadot label = "Key Menu"; 757d0873ebSEmmanuel Vadot gpios = <&pio 4 3 GPIO_ACTIVE_LOW>; /* PE3 */ 767d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 777d0873ebSEmmanuel Vadot linux,code = <BTN_MODE>; 787d0873ebSEmmanuel Vadot }; 797d0873ebSEmmanuel Vadot 807d0873ebSEmmanuel Vadot button-r1 { 817d0873ebSEmmanuel Vadot label = "Key R1"; 827d0873ebSEmmanuel Vadot gpios = <&pio 0 12 GPIO_ACTIVE_LOW>; /* PA12 */ 837d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 847d0873ebSEmmanuel Vadot linux,code = <BTN_TR>; 857d0873ebSEmmanuel Vadot }; 867d0873ebSEmmanuel Vadot 877d0873ebSEmmanuel Vadot button-r2 { 887d0873ebSEmmanuel Vadot label = "Key R2"; 897d0873ebSEmmanuel Vadot gpios = <&pio 0 7 GPIO_ACTIVE_LOW>; /* PA7 */ 907d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 917d0873ebSEmmanuel Vadot linux,code = <BTN_TR2>; 927d0873ebSEmmanuel Vadot }; 937d0873ebSEmmanuel Vadot 947d0873ebSEmmanuel Vadot button-right { 957d0873ebSEmmanuel Vadot label = "D-Pad Right"; 967d0873ebSEmmanuel Vadot gpios = <&pio 0 9 GPIO_ACTIVE_LOW>; /* PA9 */ 977d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 987d0873ebSEmmanuel Vadot linux,code = <BTN_DPAD_RIGHT>; 997d0873ebSEmmanuel Vadot }; 1007d0873ebSEmmanuel Vadot 1017d0873ebSEmmanuel Vadot button-select { 1027d0873ebSEmmanuel Vadot label = "Key Select"; 1037d0873ebSEmmanuel Vadot gpios = <&pio 0 5 GPIO_ACTIVE_LOW>; /* PA5 */ 1047d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 1057d0873ebSEmmanuel Vadot linux,code = <BTN_SELECT>; 1067d0873ebSEmmanuel Vadot }; 1077d0873ebSEmmanuel Vadot button-start { 1087d0873ebSEmmanuel Vadot label = "Key Start"; 1097d0873ebSEmmanuel Vadot gpios = <&pio 0 4 GPIO_ACTIVE_LOW>; /* PA4 */ 1107d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 1117d0873ebSEmmanuel Vadot linux,code = <BTN_START>; 1127d0873ebSEmmanuel Vadot }; 1137d0873ebSEmmanuel Vadot 1147d0873ebSEmmanuel Vadot button-up { 1157d0873ebSEmmanuel Vadot label = "D-Pad Up"; 1167d0873ebSEmmanuel Vadot gpios = <&pio 0 6 GPIO_ACTIVE_LOW>; /* PA6 */ 1177d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 1187d0873ebSEmmanuel Vadot linux,code = <BTN_DPAD_UP>; 1197d0873ebSEmmanuel Vadot }; 1207d0873ebSEmmanuel Vadot 1217d0873ebSEmmanuel Vadot button-x { 1227d0873ebSEmmanuel Vadot label = "Action-Pad X"; 1237d0873ebSEmmanuel Vadot gpios = <&pio 0 3 GPIO_ACTIVE_LOW>; /* PA3 */ 1247d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 1257d0873ebSEmmanuel Vadot linux,code = <BTN_NORTH>; 1267d0873ebSEmmanuel Vadot }; 1277d0873ebSEmmanuel Vadot 1287d0873ebSEmmanuel Vadot button-y { 1297d0873ebSEmmanuel Vadot label = "Action Pad Y"; 1307d0873ebSEmmanuel Vadot gpios = <&pio 0 2 GPIO_ACTIVE_LOW>; /* PA2 */ 1317d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 1327d0873ebSEmmanuel Vadot linux,code = <BTN_WEST>; 1337d0873ebSEmmanuel Vadot }; 1347d0873ebSEmmanuel Vadot }; 1357d0873ebSEmmanuel Vadot 1367d0873ebSEmmanuel Vadot gpio-keys-volume { 1377d0873ebSEmmanuel Vadot compatible = "gpio-keys"; 1387d0873ebSEmmanuel Vadot autorepeat; 1397d0873ebSEmmanuel Vadot 1407d0873ebSEmmanuel Vadot button-vol-up { 1417d0873ebSEmmanuel Vadot label = "Key Volume Up"; 1427d0873ebSEmmanuel Vadot gpios = <&pio 4 1 GPIO_ACTIVE_LOW>; /* PE1 */ 1437d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 1447d0873ebSEmmanuel Vadot linux,code = <KEY_VOLUMEUP>; 1457d0873ebSEmmanuel Vadot }; 1467d0873ebSEmmanuel Vadot 1477d0873ebSEmmanuel Vadot button-vol-down { 1487d0873ebSEmmanuel Vadot label = "Key Volume Down"; 1497d0873ebSEmmanuel Vadot gpios = <&pio 4 2 GPIO_ACTIVE_LOW>; /* PE2 */ 1507d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 1517d0873ebSEmmanuel Vadot linux,code = <KEY_VOLUMEDOWN>; 1527d0873ebSEmmanuel Vadot }; 1537d0873ebSEmmanuel Vadot }; 1547d0873ebSEmmanuel Vadot 1557d0873ebSEmmanuel Vadot leds { 1567d0873ebSEmmanuel Vadot compatible = "gpio-leds"; 1577d0873ebSEmmanuel Vadot 1587d0873ebSEmmanuel Vadot led-0 { 1597d0873ebSEmmanuel Vadot function = LED_FUNCTION_POWER; 1607d0873ebSEmmanuel Vadot color = <LED_COLOR_ID_GREEN>; 1617d0873ebSEmmanuel Vadot gpios = <&pio 8 12 GPIO_ACTIVE_HIGH>; /* PI12 */ 1627d0873ebSEmmanuel Vadot default-state = "on"; 1637d0873ebSEmmanuel Vadot }; 1647d0873ebSEmmanuel Vadot }; 1657d0873ebSEmmanuel Vadot 1667d0873ebSEmmanuel Vadot reg_vcc5v: regulator-vcc5v { /* USB-C power input */ 1677d0873ebSEmmanuel Vadot compatible = "regulator-fixed"; 1687d0873ebSEmmanuel Vadot regulator-name = "vcc-5v"; 1697d0873ebSEmmanuel Vadot regulator-min-microvolt = <5000000>; 1707d0873ebSEmmanuel Vadot regulator-max-microvolt = <5000000>; 1717d0873ebSEmmanuel Vadot }; 1727d0873ebSEmmanuel Vadot}; 1737d0873ebSEmmanuel Vadot 1747d0873ebSEmmanuel Vadot&cpu0 { 1757d0873ebSEmmanuel Vadot cpu-supply = <®_dcdc1>; 1767d0873ebSEmmanuel Vadot}; 1777d0873ebSEmmanuel Vadot 1787d0873ebSEmmanuel Vadot&ehci0 { 1797d0873ebSEmmanuel Vadot status = "okay"; 1807d0873ebSEmmanuel Vadot}; 1817d0873ebSEmmanuel Vadot 1827d0873ebSEmmanuel Vadot&mmc0 { 1837d0873ebSEmmanuel Vadot vmmc-supply = <®_cldo3>; 1847d0873ebSEmmanuel Vadot disable-wp; 1857d0873ebSEmmanuel Vadot cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ 1867d0873ebSEmmanuel Vadot bus-width = <4>; 1877d0873ebSEmmanuel Vadot status = "okay"; 1887d0873ebSEmmanuel Vadot}; 1897d0873ebSEmmanuel Vadot 1907d0873ebSEmmanuel Vadot&ohci0 { 1917d0873ebSEmmanuel Vadot status = "okay"; 1927d0873ebSEmmanuel Vadot}; 1937d0873ebSEmmanuel Vadot 1947d0873ebSEmmanuel Vadot&pio { 1957d0873ebSEmmanuel Vadot vcc-pa-supply = <®_cldo3>; 1967d0873ebSEmmanuel Vadot vcc-pc-supply = <®_cldo3>; 1977d0873ebSEmmanuel Vadot vcc-pe-supply = <®_cldo3>; 1987d0873ebSEmmanuel Vadot vcc-pf-supply = <®_cldo3>; 1997d0873ebSEmmanuel Vadot vcc-pg-supply = <®_aldo4>; 2007d0873ebSEmmanuel Vadot vcc-ph-supply = <®_cldo3>; 2017d0873ebSEmmanuel Vadot vcc-pi-supply = <®_cldo3>; 2027d0873ebSEmmanuel Vadot}; 2037d0873ebSEmmanuel Vadot 2047d0873ebSEmmanuel Vadot&r_rsb { 2057d0873ebSEmmanuel Vadot status = "okay"; 2067d0873ebSEmmanuel Vadot 2077d0873ebSEmmanuel Vadot axp717: pmic@3a3 { 2087d0873ebSEmmanuel Vadot compatible = "x-powers,axp717"; 2097d0873ebSEmmanuel Vadot reg = <0x3a3>; 2107d0873ebSEmmanuel Vadot interrupt-controller; 2117d0873ebSEmmanuel Vadot #interrupt-cells = <1>; 2127d0873ebSEmmanuel Vadot interrupt-parent = <&nmi_intc>; 2137d0873ebSEmmanuel Vadot interrupts = <0 IRQ_TYPE_LEVEL_LOW>; 2147d0873ebSEmmanuel Vadot 2157d0873ebSEmmanuel Vadot vin1-supply = <®_vcc5v>; 2167d0873ebSEmmanuel Vadot vin2-supply = <®_vcc5v>; 2177d0873ebSEmmanuel Vadot vin3-supply = <®_vcc5v>; 2187d0873ebSEmmanuel Vadot vin4-supply = <®_vcc5v>; 2197d0873ebSEmmanuel Vadot 2207d0873ebSEmmanuel Vadot regulators { 2217d0873ebSEmmanuel Vadot reg_dcdc1: dcdc1 { 2227d0873ebSEmmanuel Vadot regulator-always-on; 2237d0873ebSEmmanuel Vadot regulator-min-microvolt = <900000>; 224*0e8011faSEmmanuel Vadot regulator-max-microvolt = <1160000>; 2257d0873ebSEmmanuel Vadot regulator-name = "vdd-cpu"; 2267d0873ebSEmmanuel Vadot }; 2277d0873ebSEmmanuel Vadot 2287d0873ebSEmmanuel Vadot reg_dcdc2: dcdc2 { 2297d0873ebSEmmanuel Vadot regulator-always-on; 2307d0873ebSEmmanuel Vadot regulator-min-microvolt = <940000>; 2317d0873ebSEmmanuel Vadot regulator-max-microvolt = <940000>; 2327d0873ebSEmmanuel Vadot regulator-name = "vdd-gpu-sys"; 2337d0873ebSEmmanuel Vadot }; 2347d0873ebSEmmanuel Vadot 2357d0873ebSEmmanuel Vadot reg_dcdc3: dcdc3 { 2367d0873ebSEmmanuel Vadot regulator-always-on; 2377d0873ebSEmmanuel Vadot regulator-min-microvolt = <1100000>; 2387d0873ebSEmmanuel Vadot regulator-max-microvolt = <1100000>; 2397d0873ebSEmmanuel Vadot regulator-name = "vdd-dram"; 2407d0873ebSEmmanuel Vadot }; 2417d0873ebSEmmanuel Vadot 2427d0873ebSEmmanuel Vadot reg_aldo1: aldo1 { 2437d0873ebSEmmanuel Vadot /* 1.8v - unused */ 2447d0873ebSEmmanuel Vadot }; 2457d0873ebSEmmanuel Vadot 2467d0873ebSEmmanuel Vadot reg_aldo2: aldo2 { 2477d0873ebSEmmanuel Vadot /* 1.8v - unused */ 2487d0873ebSEmmanuel Vadot }; 2497d0873ebSEmmanuel Vadot 2507d0873ebSEmmanuel Vadot reg_aldo3: aldo3 { 2517d0873ebSEmmanuel Vadot /* 1.8v - unused */ 2527d0873ebSEmmanuel Vadot }; 2537d0873ebSEmmanuel Vadot 2547d0873ebSEmmanuel Vadot reg_aldo4: aldo4 { 2557d0873ebSEmmanuel Vadot regulator-min-microvolt = <1800000>; 2567d0873ebSEmmanuel Vadot regulator-max-microvolt = <1800000>; 2577d0873ebSEmmanuel Vadot regulator-name = "vcc-pg"; 2587d0873ebSEmmanuel Vadot }; 2597d0873ebSEmmanuel Vadot 2607d0873ebSEmmanuel Vadot reg_bldo1: bldo1 { 2617d0873ebSEmmanuel Vadot /* 1.8v - unused */ 2627d0873ebSEmmanuel Vadot }; 2637d0873ebSEmmanuel Vadot 2647d0873ebSEmmanuel Vadot reg_bldo2: bldo2 { 2657d0873ebSEmmanuel Vadot regulator-always-on; 2667d0873ebSEmmanuel Vadot regulator-min-microvolt = <1800000>; 2677d0873ebSEmmanuel Vadot regulator-max-microvolt = <1800000>; 2687d0873ebSEmmanuel Vadot regulator-name = "vcc-pll"; 2697d0873ebSEmmanuel Vadot }; 2707d0873ebSEmmanuel Vadot 2717d0873ebSEmmanuel Vadot reg_bldo3: bldo3 { 2727d0873ebSEmmanuel Vadot /* 2.8v - unused */ 2737d0873ebSEmmanuel Vadot }; 2747d0873ebSEmmanuel Vadot 2757d0873ebSEmmanuel Vadot reg_bldo4: bldo4 { 2767d0873ebSEmmanuel Vadot /* 1.2v - unused */ 2777d0873ebSEmmanuel Vadot }; 2787d0873ebSEmmanuel Vadot 2797d0873ebSEmmanuel Vadot reg_cldo1: cldo1 { 2807d0873ebSEmmanuel Vadot /* 3.3v - audio codec - not yet implemented */ 2817d0873ebSEmmanuel Vadot }; 2827d0873ebSEmmanuel Vadot 2837d0873ebSEmmanuel Vadot reg_cldo2: cldo2 { 2847d0873ebSEmmanuel Vadot /* 3.3v - unused */ 2857d0873ebSEmmanuel Vadot }; 2867d0873ebSEmmanuel Vadot 2877d0873ebSEmmanuel Vadot reg_cldo3: cldo3 { 2887d0873ebSEmmanuel Vadot regulator-always-on; 2897d0873ebSEmmanuel Vadot regulator-min-microvolt = <3300000>; 2907d0873ebSEmmanuel Vadot regulator-max-microvolt = <3300000>; 2917d0873ebSEmmanuel Vadot regulator-name = "vcc-io"; 2927d0873ebSEmmanuel Vadot }; 2937d0873ebSEmmanuel Vadot 2947d0873ebSEmmanuel Vadot reg_cldo4: cldo4 { 2957d0873ebSEmmanuel Vadot regulator-min-microvolt = <3300000>; 2967d0873ebSEmmanuel Vadot regulator-max-microvolt = <3300000>; 2977d0873ebSEmmanuel Vadot regulator-name = "vcc-wifi"; 2987d0873ebSEmmanuel Vadot }; 2997d0873ebSEmmanuel Vadot 3007d0873ebSEmmanuel Vadot reg_boost: boost { 3017d0873ebSEmmanuel Vadot regulator-min-microvolt = <5000000>; 3027d0873ebSEmmanuel Vadot regulator-max-microvolt = <5200000>; 3037d0873ebSEmmanuel Vadot regulator-name = "boost"; 3047d0873ebSEmmanuel Vadot }; 3057d0873ebSEmmanuel Vadot 3067d0873ebSEmmanuel Vadot reg_cpusldo: cpusldo { 3077d0873ebSEmmanuel Vadot /* unused */ 3087d0873ebSEmmanuel Vadot }; 3097d0873ebSEmmanuel Vadot }; 3107d0873ebSEmmanuel Vadot }; 3117d0873ebSEmmanuel Vadot}; 3127d0873ebSEmmanuel Vadot 3137d0873ebSEmmanuel Vadot&uart0 { 3147d0873ebSEmmanuel Vadot pinctrl-names = "default"; 3157d0873ebSEmmanuel Vadot pinctrl-0 = <&uart0_ph_pins>; 3167d0873ebSEmmanuel Vadot status = "okay"; 3177d0873ebSEmmanuel Vadot}; 3187d0873ebSEmmanuel Vadot 3197d0873ebSEmmanuel Vadot/* the AXP717 has USB type-C role switch functionality, not yet described by the binding */ 3207d0873ebSEmmanuel Vadot&usbotg { 3217d0873ebSEmmanuel Vadot dr_mode = "peripheral"; /* USB type-C receptable */ 3227d0873ebSEmmanuel Vadot status = "okay"; 3237d0873ebSEmmanuel Vadot}; 3247d0873ebSEmmanuel Vadot 3257d0873ebSEmmanuel Vadot&usbphy { 3267d0873ebSEmmanuel Vadot status = "okay"; 3277d0873ebSEmmanuel Vadot}; 328