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