1*7d0873ebSEmmanuel Vadot// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2*7d0873ebSEmmanuel Vadot/* 3*7d0873ebSEmmanuel Vadot * Copyright (C) 2024 Ryan Walklin <ryan@testtoast.com>. 4*7d0873ebSEmmanuel Vadot */ 5*7d0873ebSEmmanuel Vadot 6*7d0873ebSEmmanuel Vadot/dts-v1/; 7*7d0873ebSEmmanuel Vadot 8*7d0873ebSEmmanuel Vadot#include "sun50i-h616.dtsi" 9*7d0873ebSEmmanuel Vadot 10*7d0873ebSEmmanuel Vadot#include <dt-bindings/gpio/gpio.h> 11*7d0873ebSEmmanuel Vadot#include <dt-bindings/input/linux-event-codes.h> 12*7d0873ebSEmmanuel Vadot#include <dt-bindings/interrupt-controller/arm-gic.h> 13*7d0873ebSEmmanuel Vadot#include <dt-bindings/leds/common.h> 14*7d0873ebSEmmanuel Vadot 15*7d0873ebSEmmanuel Vadot/ { 16*7d0873ebSEmmanuel Vadot model = "Anbernic RG35XX 2024"; 17*7d0873ebSEmmanuel Vadot chassis-type = "handset"; 18*7d0873ebSEmmanuel Vadot compatible = "anbernic,rg35xx-2024", "allwinner,sun50i-h700"; 19*7d0873ebSEmmanuel Vadot 20*7d0873ebSEmmanuel Vadot aliases { 21*7d0873ebSEmmanuel Vadot serial0 = &uart0; 22*7d0873ebSEmmanuel Vadot }; 23*7d0873ebSEmmanuel Vadot 24*7d0873ebSEmmanuel Vadot chosen { 25*7d0873ebSEmmanuel Vadot stdout-path = "serial0:115200n8"; 26*7d0873ebSEmmanuel Vadot }; 27*7d0873ebSEmmanuel Vadot 28*7d0873ebSEmmanuel Vadot gpio_keys_gamepad: gpio-keys-gamepad { 29*7d0873ebSEmmanuel Vadot compatible = "gpio-keys"; 30*7d0873ebSEmmanuel Vadot 31*7d0873ebSEmmanuel Vadot button-a { 32*7d0873ebSEmmanuel Vadot label = "Action-Pad A"; 33*7d0873ebSEmmanuel Vadot gpios = <&pio 0 0 GPIO_ACTIVE_LOW>; /* PA0 */ 34*7d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 35*7d0873ebSEmmanuel Vadot linux,code = <BTN_EAST>; 36*7d0873ebSEmmanuel Vadot }; 37*7d0873ebSEmmanuel Vadot 38*7d0873ebSEmmanuel Vadot button-b { 39*7d0873ebSEmmanuel Vadot label = "Action-Pad B"; 40*7d0873ebSEmmanuel Vadot gpios = <&pio 0 1 GPIO_ACTIVE_LOW>; /* PA1 */ 41*7d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 42*7d0873ebSEmmanuel Vadot linux,code = <BTN_SOUTH>; 43*7d0873ebSEmmanuel Vadot }; 44*7d0873ebSEmmanuel Vadot 45*7d0873ebSEmmanuel Vadot button-down { 46*7d0873ebSEmmanuel Vadot label = "D-Pad Down"; 47*7d0873ebSEmmanuel Vadot gpios = <&pio 4 0 GPIO_ACTIVE_LOW>; /* PE0 */ 48*7d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 49*7d0873ebSEmmanuel Vadot linux,code = <BTN_DPAD_DOWN>; 50*7d0873ebSEmmanuel Vadot }; 51*7d0873ebSEmmanuel Vadot 52*7d0873ebSEmmanuel Vadot button-l1 { 53*7d0873ebSEmmanuel Vadot label = "Key L1"; 54*7d0873ebSEmmanuel Vadot gpios = <&pio 0 10 GPIO_ACTIVE_LOW>; /* PA10 */ 55*7d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 56*7d0873ebSEmmanuel Vadot linux,code = <BTN_TL>; 57*7d0873ebSEmmanuel Vadot }; 58*7d0873ebSEmmanuel Vadot 59*7d0873ebSEmmanuel Vadot button-l2 { 60*7d0873ebSEmmanuel Vadot label = "Key L2"; 61*7d0873ebSEmmanuel Vadot gpios = <&pio 0 11 GPIO_ACTIVE_LOW>; /* PA11 */ 62*7d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 63*7d0873ebSEmmanuel Vadot linux,code = <BTN_TL2>; 64*7d0873ebSEmmanuel Vadot }; 65*7d0873ebSEmmanuel Vadot 66*7d0873ebSEmmanuel Vadot button-left { 67*7d0873ebSEmmanuel Vadot label = "D-Pad left"; 68*7d0873ebSEmmanuel Vadot gpios = <&pio 0 8 GPIO_ACTIVE_LOW>; /* PA8 */ 69*7d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 70*7d0873ebSEmmanuel Vadot linux,code = <BTN_DPAD_LEFT>; 71*7d0873ebSEmmanuel Vadot }; 72*7d0873ebSEmmanuel Vadot 73*7d0873ebSEmmanuel Vadot button-menu { 74*7d0873ebSEmmanuel Vadot label = "Key Menu"; 75*7d0873ebSEmmanuel Vadot gpios = <&pio 4 3 GPIO_ACTIVE_LOW>; /* PE3 */ 76*7d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 77*7d0873ebSEmmanuel Vadot linux,code = <BTN_MODE>; 78*7d0873ebSEmmanuel Vadot }; 79*7d0873ebSEmmanuel Vadot 80*7d0873ebSEmmanuel Vadot button-r1 { 81*7d0873ebSEmmanuel Vadot label = "Key R1"; 82*7d0873ebSEmmanuel Vadot gpios = <&pio 0 12 GPIO_ACTIVE_LOW>; /* PA12 */ 83*7d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 84*7d0873ebSEmmanuel Vadot linux,code = <BTN_TR>; 85*7d0873ebSEmmanuel Vadot }; 86*7d0873ebSEmmanuel Vadot 87*7d0873ebSEmmanuel Vadot button-r2 { 88*7d0873ebSEmmanuel Vadot label = "Key R2"; 89*7d0873ebSEmmanuel Vadot gpios = <&pio 0 7 GPIO_ACTIVE_LOW>; /* PA7 */ 90*7d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 91*7d0873ebSEmmanuel Vadot linux,code = <BTN_TR2>; 92*7d0873ebSEmmanuel Vadot }; 93*7d0873ebSEmmanuel Vadot 94*7d0873ebSEmmanuel Vadot button-right { 95*7d0873ebSEmmanuel Vadot label = "D-Pad Right"; 96*7d0873ebSEmmanuel Vadot gpios = <&pio 0 9 GPIO_ACTIVE_LOW>; /* PA9 */ 97*7d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 98*7d0873ebSEmmanuel Vadot linux,code = <BTN_DPAD_RIGHT>; 99*7d0873ebSEmmanuel Vadot }; 100*7d0873ebSEmmanuel Vadot 101*7d0873ebSEmmanuel Vadot button-select { 102*7d0873ebSEmmanuel Vadot label = "Key Select"; 103*7d0873ebSEmmanuel Vadot gpios = <&pio 0 5 GPIO_ACTIVE_LOW>; /* PA5 */ 104*7d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 105*7d0873ebSEmmanuel Vadot linux,code = <BTN_SELECT>; 106*7d0873ebSEmmanuel Vadot }; 107*7d0873ebSEmmanuel Vadot button-start { 108*7d0873ebSEmmanuel Vadot label = "Key Start"; 109*7d0873ebSEmmanuel Vadot gpios = <&pio 0 4 GPIO_ACTIVE_LOW>; /* PA4 */ 110*7d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 111*7d0873ebSEmmanuel Vadot linux,code = <BTN_START>; 112*7d0873ebSEmmanuel Vadot }; 113*7d0873ebSEmmanuel Vadot 114*7d0873ebSEmmanuel Vadot button-up { 115*7d0873ebSEmmanuel Vadot label = "D-Pad Up"; 116*7d0873ebSEmmanuel Vadot gpios = <&pio 0 6 GPIO_ACTIVE_LOW>; /* PA6 */ 117*7d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 118*7d0873ebSEmmanuel Vadot linux,code = <BTN_DPAD_UP>; 119*7d0873ebSEmmanuel Vadot }; 120*7d0873ebSEmmanuel Vadot 121*7d0873ebSEmmanuel Vadot button-x { 122*7d0873ebSEmmanuel Vadot label = "Action-Pad X"; 123*7d0873ebSEmmanuel Vadot gpios = <&pio 0 3 GPIO_ACTIVE_LOW>; /* PA3 */ 124*7d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 125*7d0873ebSEmmanuel Vadot linux,code = <BTN_NORTH>; 126*7d0873ebSEmmanuel Vadot }; 127*7d0873ebSEmmanuel Vadot 128*7d0873ebSEmmanuel Vadot button-y { 129*7d0873ebSEmmanuel Vadot label = "Action Pad Y"; 130*7d0873ebSEmmanuel Vadot gpios = <&pio 0 2 GPIO_ACTIVE_LOW>; /* PA2 */ 131*7d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 132*7d0873ebSEmmanuel Vadot linux,code = <BTN_WEST>; 133*7d0873ebSEmmanuel Vadot }; 134*7d0873ebSEmmanuel Vadot }; 135*7d0873ebSEmmanuel Vadot 136*7d0873ebSEmmanuel Vadot gpio-keys-volume { 137*7d0873ebSEmmanuel Vadot compatible = "gpio-keys"; 138*7d0873ebSEmmanuel Vadot autorepeat; 139*7d0873ebSEmmanuel Vadot 140*7d0873ebSEmmanuel Vadot button-vol-up { 141*7d0873ebSEmmanuel Vadot label = "Key Volume Up"; 142*7d0873ebSEmmanuel Vadot gpios = <&pio 4 1 GPIO_ACTIVE_LOW>; /* PE1 */ 143*7d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 144*7d0873ebSEmmanuel Vadot linux,code = <KEY_VOLUMEUP>; 145*7d0873ebSEmmanuel Vadot }; 146*7d0873ebSEmmanuel Vadot 147*7d0873ebSEmmanuel Vadot button-vol-down { 148*7d0873ebSEmmanuel Vadot label = "Key Volume Down"; 149*7d0873ebSEmmanuel Vadot gpios = <&pio 4 2 GPIO_ACTIVE_LOW>; /* PE2 */ 150*7d0873ebSEmmanuel Vadot linux,input-type = <EV_KEY>; 151*7d0873ebSEmmanuel Vadot linux,code = <KEY_VOLUMEDOWN>; 152*7d0873ebSEmmanuel Vadot }; 153*7d0873ebSEmmanuel Vadot }; 154*7d0873ebSEmmanuel Vadot 155*7d0873ebSEmmanuel Vadot leds { 156*7d0873ebSEmmanuel Vadot compatible = "gpio-leds"; 157*7d0873ebSEmmanuel Vadot 158*7d0873ebSEmmanuel Vadot led-0 { 159*7d0873ebSEmmanuel Vadot function = LED_FUNCTION_POWER; 160*7d0873ebSEmmanuel Vadot color = <LED_COLOR_ID_GREEN>; 161*7d0873ebSEmmanuel Vadot gpios = <&pio 8 12 GPIO_ACTIVE_HIGH>; /* PI12 */ 162*7d0873ebSEmmanuel Vadot default-state = "on"; 163*7d0873ebSEmmanuel Vadot }; 164*7d0873ebSEmmanuel Vadot }; 165*7d0873ebSEmmanuel Vadot 166*7d0873ebSEmmanuel Vadot reg_vcc5v: regulator-vcc5v { /* USB-C power input */ 167*7d0873ebSEmmanuel Vadot compatible = "regulator-fixed"; 168*7d0873ebSEmmanuel Vadot regulator-name = "vcc-5v"; 169*7d0873ebSEmmanuel Vadot regulator-min-microvolt = <5000000>; 170*7d0873ebSEmmanuel Vadot regulator-max-microvolt = <5000000>; 171*7d0873ebSEmmanuel Vadot }; 172*7d0873ebSEmmanuel Vadot}; 173*7d0873ebSEmmanuel Vadot 174*7d0873ebSEmmanuel Vadot&cpu0 { 175*7d0873ebSEmmanuel Vadot cpu-supply = <®_dcdc1>; 176*7d0873ebSEmmanuel Vadot}; 177*7d0873ebSEmmanuel Vadot 178*7d0873ebSEmmanuel Vadot&ehci0 { 179*7d0873ebSEmmanuel Vadot status = "okay"; 180*7d0873ebSEmmanuel Vadot}; 181*7d0873ebSEmmanuel Vadot 182*7d0873ebSEmmanuel Vadot&mmc0 { 183*7d0873ebSEmmanuel Vadot vmmc-supply = <®_cldo3>; 184*7d0873ebSEmmanuel Vadot disable-wp; 185*7d0873ebSEmmanuel Vadot cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ 186*7d0873ebSEmmanuel Vadot bus-width = <4>; 187*7d0873ebSEmmanuel Vadot status = "okay"; 188*7d0873ebSEmmanuel Vadot}; 189*7d0873ebSEmmanuel Vadot 190*7d0873ebSEmmanuel Vadot&ohci0 { 191*7d0873ebSEmmanuel Vadot status = "okay"; 192*7d0873ebSEmmanuel Vadot}; 193*7d0873ebSEmmanuel Vadot 194*7d0873ebSEmmanuel Vadot&pio { 195*7d0873ebSEmmanuel Vadot vcc-pa-supply = <®_cldo3>; 196*7d0873ebSEmmanuel Vadot vcc-pc-supply = <®_cldo3>; 197*7d0873ebSEmmanuel Vadot vcc-pe-supply = <®_cldo3>; 198*7d0873ebSEmmanuel Vadot vcc-pf-supply = <®_cldo3>; 199*7d0873ebSEmmanuel Vadot vcc-pg-supply = <®_aldo4>; 200*7d0873ebSEmmanuel Vadot vcc-ph-supply = <®_cldo3>; 201*7d0873ebSEmmanuel Vadot vcc-pi-supply = <®_cldo3>; 202*7d0873ebSEmmanuel Vadot}; 203*7d0873ebSEmmanuel Vadot 204*7d0873ebSEmmanuel Vadot&r_rsb { 205*7d0873ebSEmmanuel Vadot status = "okay"; 206*7d0873ebSEmmanuel Vadot 207*7d0873ebSEmmanuel Vadot axp717: pmic@3a3 { 208*7d0873ebSEmmanuel Vadot compatible = "x-powers,axp717"; 209*7d0873ebSEmmanuel Vadot reg = <0x3a3>; 210*7d0873ebSEmmanuel Vadot interrupt-controller; 211*7d0873ebSEmmanuel Vadot #interrupt-cells = <1>; 212*7d0873ebSEmmanuel Vadot interrupt-parent = <&nmi_intc>; 213*7d0873ebSEmmanuel Vadot interrupts = <0 IRQ_TYPE_LEVEL_LOW>; 214*7d0873ebSEmmanuel Vadot 215*7d0873ebSEmmanuel Vadot vin1-supply = <®_vcc5v>; 216*7d0873ebSEmmanuel Vadot vin2-supply = <®_vcc5v>; 217*7d0873ebSEmmanuel Vadot vin3-supply = <®_vcc5v>; 218*7d0873ebSEmmanuel Vadot vin4-supply = <®_vcc5v>; 219*7d0873ebSEmmanuel Vadot 220*7d0873ebSEmmanuel Vadot regulators { 221*7d0873ebSEmmanuel Vadot reg_dcdc1: dcdc1 { 222*7d0873ebSEmmanuel Vadot regulator-always-on; 223*7d0873ebSEmmanuel Vadot regulator-min-microvolt = <900000>; 224*7d0873ebSEmmanuel Vadot regulator-max-microvolt = <1100000>; 225*7d0873ebSEmmanuel Vadot regulator-name = "vdd-cpu"; 226*7d0873ebSEmmanuel Vadot }; 227*7d0873ebSEmmanuel Vadot 228*7d0873ebSEmmanuel Vadot reg_dcdc2: dcdc2 { 229*7d0873ebSEmmanuel Vadot regulator-always-on; 230*7d0873ebSEmmanuel Vadot regulator-min-microvolt = <940000>; 231*7d0873ebSEmmanuel Vadot regulator-max-microvolt = <940000>; 232*7d0873ebSEmmanuel Vadot regulator-name = "vdd-gpu-sys"; 233*7d0873ebSEmmanuel Vadot }; 234*7d0873ebSEmmanuel Vadot 235*7d0873ebSEmmanuel Vadot reg_dcdc3: dcdc3 { 236*7d0873ebSEmmanuel Vadot regulator-always-on; 237*7d0873ebSEmmanuel Vadot regulator-min-microvolt = <1100000>; 238*7d0873ebSEmmanuel Vadot regulator-max-microvolt = <1100000>; 239*7d0873ebSEmmanuel Vadot regulator-name = "vdd-dram"; 240*7d0873ebSEmmanuel Vadot }; 241*7d0873ebSEmmanuel Vadot 242*7d0873ebSEmmanuel Vadot reg_aldo1: aldo1 { 243*7d0873ebSEmmanuel Vadot /* 1.8v - unused */ 244*7d0873ebSEmmanuel Vadot }; 245*7d0873ebSEmmanuel Vadot 246*7d0873ebSEmmanuel Vadot reg_aldo2: aldo2 { 247*7d0873ebSEmmanuel Vadot /* 1.8v - unused */ 248*7d0873ebSEmmanuel Vadot }; 249*7d0873ebSEmmanuel Vadot 250*7d0873ebSEmmanuel Vadot reg_aldo3: aldo3 { 251*7d0873ebSEmmanuel Vadot /* 1.8v - unused */ 252*7d0873ebSEmmanuel Vadot }; 253*7d0873ebSEmmanuel Vadot 254*7d0873ebSEmmanuel Vadot reg_aldo4: aldo4 { 255*7d0873ebSEmmanuel Vadot regulator-min-microvolt = <1800000>; 256*7d0873ebSEmmanuel Vadot regulator-max-microvolt = <1800000>; 257*7d0873ebSEmmanuel Vadot regulator-name = "vcc-pg"; 258*7d0873ebSEmmanuel Vadot }; 259*7d0873ebSEmmanuel Vadot 260*7d0873ebSEmmanuel Vadot reg_bldo1: bldo1 { 261*7d0873ebSEmmanuel Vadot /* 1.8v - unused */ 262*7d0873ebSEmmanuel Vadot }; 263*7d0873ebSEmmanuel Vadot 264*7d0873ebSEmmanuel Vadot reg_bldo2: bldo2 { 265*7d0873ebSEmmanuel Vadot regulator-always-on; 266*7d0873ebSEmmanuel Vadot regulator-min-microvolt = <1800000>; 267*7d0873ebSEmmanuel Vadot regulator-max-microvolt = <1800000>; 268*7d0873ebSEmmanuel Vadot regulator-name = "vcc-pll"; 269*7d0873ebSEmmanuel Vadot }; 270*7d0873ebSEmmanuel Vadot 271*7d0873ebSEmmanuel Vadot reg_bldo3: bldo3 { 272*7d0873ebSEmmanuel Vadot /* 2.8v - unused */ 273*7d0873ebSEmmanuel Vadot }; 274*7d0873ebSEmmanuel Vadot 275*7d0873ebSEmmanuel Vadot reg_bldo4: bldo4 { 276*7d0873ebSEmmanuel Vadot /* 1.2v - unused */ 277*7d0873ebSEmmanuel Vadot }; 278*7d0873ebSEmmanuel Vadot 279*7d0873ebSEmmanuel Vadot reg_cldo1: cldo1 { 280*7d0873ebSEmmanuel Vadot /* 3.3v - audio codec - not yet implemented */ 281*7d0873ebSEmmanuel Vadot }; 282*7d0873ebSEmmanuel Vadot 283*7d0873ebSEmmanuel Vadot reg_cldo2: cldo2 { 284*7d0873ebSEmmanuel Vadot /* 3.3v - unused */ 285*7d0873ebSEmmanuel Vadot }; 286*7d0873ebSEmmanuel Vadot 287*7d0873ebSEmmanuel Vadot reg_cldo3: cldo3 { 288*7d0873ebSEmmanuel Vadot regulator-always-on; 289*7d0873ebSEmmanuel Vadot regulator-min-microvolt = <3300000>; 290*7d0873ebSEmmanuel Vadot regulator-max-microvolt = <3300000>; 291*7d0873ebSEmmanuel Vadot regulator-name = "vcc-io"; 292*7d0873ebSEmmanuel Vadot }; 293*7d0873ebSEmmanuel Vadot 294*7d0873ebSEmmanuel Vadot reg_cldo4: cldo4 { 295*7d0873ebSEmmanuel Vadot regulator-min-microvolt = <3300000>; 296*7d0873ebSEmmanuel Vadot regulator-max-microvolt = <3300000>; 297*7d0873ebSEmmanuel Vadot regulator-name = "vcc-wifi"; 298*7d0873ebSEmmanuel Vadot }; 299*7d0873ebSEmmanuel Vadot 300*7d0873ebSEmmanuel Vadot reg_boost: boost { 301*7d0873ebSEmmanuel Vadot regulator-min-microvolt = <5000000>; 302*7d0873ebSEmmanuel Vadot regulator-max-microvolt = <5200000>; 303*7d0873ebSEmmanuel Vadot regulator-name = "boost"; 304*7d0873ebSEmmanuel Vadot }; 305*7d0873ebSEmmanuel Vadot 306*7d0873ebSEmmanuel Vadot reg_cpusldo: cpusldo { 307*7d0873ebSEmmanuel Vadot /* unused */ 308*7d0873ebSEmmanuel Vadot }; 309*7d0873ebSEmmanuel Vadot }; 310*7d0873ebSEmmanuel Vadot }; 311*7d0873ebSEmmanuel Vadot}; 312*7d0873ebSEmmanuel Vadot 313*7d0873ebSEmmanuel Vadot&uart0 { 314*7d0873ebSEmmanuel Vadot pinctrl-names = "default"; 315*7d0873ebSEmmanuel Vadot pinctrl-0 = <&uart0_ph_pins>; 316*7d0873ebSEmmanuel Vadot status = "okay"; 317*7d0873ebSEmmanuel Vadot}; 318*7d0873ebSEmmanuel Vadot 319*7d0873ebSEmmanuel Vadot/* the AXP717 has USB type-C role switch functionality, not yet described by the binding */ 320*7d0873ebSEmmanuel Vadot&usbotg { 321*7d0873ebSEmmanuel Vadot dr_mode = "peripheral"; /* USB type-C receptable */ 322*7d0873ebSEmmanuel Vadot status = "okay"; 323*7d0873ebSEmmanuel Vadot}; 324*7d0873ebSEmmanuel Vadot 325*7d0873ebSEmmanuel Vadot&usbphy { 326*7d0873ebSEmmanuel Vadot status = "okay"; 327*7d0873ebSEmmanuel Vadot}; 328