// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) /* * Copyright (C) 2024 Ryan Walklin . */ /dts-v1/; #include "sun50i-h616.dtsi" #include "sun50i-h616-cpu-opp.dtsi" #include #include #include #include / { model = "Anbernic RG35XX 2024"; chassis-type = "handset"; compatible = "anbernic,rg35xx-2024", "allwinner,sun50i-h700"; aliases { serial0 = &uart0; }; battery: battery { compatible = "simple-battery"; constant-charge-current-max-microamp = <1024000>; voltage-max-design-microvolt = <4200000>; }; chosen { stdout-path = "serial0:115200n8"; }; gpio_keys_gamepad: gpio-keys-gamepad { compatible = "gpio-keys"; button-a { label = "Action-Pad A"; gpios = <&pio 0 0 GPIO_ACTIVE_LOW>; /* PA0 */ linux,input-type = ; linux,code = ; }; button-b { label = "Action-Pad B"; gpios = <&pio 0 1 GPIO_ACTIVE_LOW>; /* PA1 */ linux,input-type = ; linux,code = ; }; button-down { label = "D-Pad Down"; gpios = <&pio 4 0 GPIO_ACTIVE_LOW>; /* PE0 */ linux,input-type = ; linux,code = ; }; button-l1 { label = "Key L1"; gpios = <&pio 0 10 GPIO_ACTIVE_LOW>; /* PA10 */ linux,input-type = ; linux,code = ; }; button-l2 { label = "Key L2"; gpios = <&pio 0 11 GPIO_ACTIVE_LOW>; /* PA11 */ linux,input-type = ; linux,code = ; }; button-left { label = "D-Pad left"; gpios = <&pio 0 8 GPIO_ACTIVE_LOW>; /* PA8 */ linux,input-type = ; linux,code = ; }; button-menu { label = "Key Menu"; gpios = <&pio 4 3 GPIO_ACTIVE_LOW>; /* PE3 */ linux,input-type = ; linux,code = ; }; button-r1 { label = "Key R1"; gpios = <&pio 0 12 GPIO_ACTIVE_LOW>; /* PA12 */ linux,input-type = ; linux,code = ; }; button-r2 { label = "Key R2"; gpios = <&pio 0 7 GPIO_ACTIVE_LOW>; /* PA7 */ linux,input-type = ; linux,code = ; }; button-right { label = "D-Pad Right"; gpios = <&pio 0 9 GPIO_ACTIVE_LOW>; /* PA9 */ linux,input-type = ; linux,code = ; }; button-select { label = "Key Select"; gpios = <&pio 0 5 GPIO_ACTIVE_LOW>; /* PA5 */ linux,input-type = ; linux,code = ; }; button-start { label = "Key Start"; gpios = <&pio 0 4 GPIO_ACTIVE_LOW>; /* PA4 */ linux,input-type = ; linux,code = ; }; button-up { label = "D-Pad Up"; gpios = <&pio 0 6 GPIO_ACTIVE_LOW>; /* PA6 */ linux,input-type = ; linux,code = ; }; button-x { label = "Action-Pad X"; gpios = <&pio 0 3 GPIO_ACTIVE_LOW>; /* PA3 */ linux,input-type = ; linux,code = ; }; button-y { label = "Action Pad Y"; gpios = <&pio 0 2 GPIO_ACTIVE_LOW>; /* PA2 */ linux,input-type = ; linux,code = ; }; }; gpio-keys-volume { compatible = "gpio-keys"; autorepeat; button-vol-up { label = "Key Volume Up"; gpios = <&pio 4 1 GPIO_ACTIVE_LOW>; /* PE1 */ linux,input-type = ; linux,code = ; }; button-vol-down { label = "Key Volume Down"; gpios = <&pio 4 2 GPIO_ACTIVE_LOW>; /* PE2 */ linux,input-type = ; linux,code = ; }; }; leds { compatible = "gpio-leds"; led-0 { function = LED_FUNCTION_POWER; color = ; gpios = <&pio 8 12 GPIO_ACTIVE_HIGH>; /* PI12 */ default-state = "on"; }; }; reg_vcc5v: regulator-vcc5v { /* USB-C power input */ compatible = "regulator-fixed"; regulator-name = "vcc-5v"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; }; }; &cpu0 { cpu-supply = <®_dcdc1>; }; &ehci0 { status = "okay"; }; &mmc0 { vmmc-supply = <®_cldo3>; disable-wp; cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ bus-width = <4>; status = "okay"; }; &ohci0 { status = "okay"; }; &pio { vcc-pa-supply = <®_cldo3>; vcc-pc-supply = <®_cldo3>; vcc-pe-supply = <®_cldo3>; vcc-pf-supply = <®_cldo3>; vcc-pg-supply = <®_aldo4>; vcc-ph-supply = <®_cldo3>; vcc-pi-supply = <®_cldo3>; }; &r_i2c { status = "okay"; axp717: pmic@34 { compatible = "x-powers,axp717"; reg = <0x34>; interrupt-controller; #interrupt-cells = <1>; interrupt-parent = <&nmi_intc>; interrupts = <0 IRQ_TYPE_LEVEL_LOW>; vin1-supply = <®_vcc5v>; vin2-supply = <®_vcc5v>; vin3-supply = <®_vcc5v>; vin4-supply = <®_vcc5v>; axp_adc: adc { compatible = "x-powers,axp717-adc"; #io-channel-cells = <1>; }; battery_power: battery-power { compatible = "x-powers,axp717-battery-power-supply"; monitored-battery = <&battery>; }; regulators { reg_dcdc1: dcdc1 { regulator-always-on; regulator-min-microvolt = <900000>; regulator-max-microvolt = <1160000>; regulator-name = "vdd-cpu"; }; reg_dcdc2: dcdc2 { regulator-always-on; regulator-min-microvolt = <940000>; regulator-max-microvolt = <940000>; regulator-name = "vdd-gpu-sys"; }; reg_dcdc3: dcdc3 { regulator-always-on; regulator-min-microvolt = <1100000>; regulator-max-microvolt = <1100000>; regulator-name = "vdd-dram"; }; reg_aldo1: aldo1 { /* 1.8v - unused */ }; reg_aldo2: aldo2 { /* 1.8v - unused */ }; reg_aldo3: aldo3 { /* 1.8v - unused */ }; reg_aldo4: aldo4 { regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; regulator-name = "vcc-pg"; }; reg_bldo1: bldo1 { /* 1.8v - unused */ }; reg_bldo2: bldo2 { regulator-always-on; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; regulator-name = "vcc-pll"; }; reg_bldo3: bldo3 { /* 2.8v - unused */ }; reg_bldo4: bldo4 { /* 1.2v - unused */ }; reg_cldo1: cldo1 { /* 3.3v - audio codec - not yet implemented */ }; reg_cldo2: cldo2 { /* 3.3v - unused */ }; reg_cldo3: cldo3 { regulator-always-on; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; regulator-name = "vcc-io"; }; reg_cldo4: cldo4 { regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; regulator-name = "vcc-wifi"; }; reg_boost: boost { regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5200000>; regulator-name = "boost"; }; reg_cpusldo: cpusldo { /* unused */ }; }; usb_power: usb-power { compatible = "x-powers,axp717-usb-power-supply"; input-current-limit-microamp = <1500000>; }; }; }; &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_ph_pins>; status = "okay"; }; /* the AXP717 has USB type-C role switch functionality, not yet described by the binding */ &usbotg { dr_mode = "peripheral"; /* USB type-C receptable */ status = "okay"; }; &usbphy { status = "okay"; };