1// SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2 3/dts-v1/; 4 5#include <dt-bindings/input/input.h> 6#include <dt-bindings/leds/common.h> 7#include "rk3128.dtsi" 8 9/ { 10 model = "Geniatech XPI-3128"; 11 compatible = "geniatech,xpi-3128", "rockchip,rk3128"; 12 13 aliases { 14 ethernet0 = &gmac; 15 mmc0 = &emmc; 16 mmc1 = &sdmmc; 17 }; 18 19 memory@60000000 { 20 device_type = "memory"; 21 reg = <0x60000000 0x40000000>; 22 }; 23 24 chosen { 25 stdout-path = &uart1; 26 }; 27 28 adc-keys { 29 compatible = "adc-keys"; 30 io-channels = <&saradc 1>; 31 io-channel-names = "buttons"; 32 keyup-threshold-microvolt = <3300000>; 33 34 button-recovery { 35 label = "Recovery"; 36 linux,code = <KEY_VENDOR>; 37 press-threshold-microvolt = <0>; 38 }; 39 }; 40 41 dc_5v: dc-5v-regulator { 42 compatible = "regulator-fixed"; 43 regulator-name = "DC_5V"; 44 regulator-min-microvolt = <5000000>; 45 regulator-max-microvolt = <5000000>; 46 regulator-always-on; 47 regulator-boot-on; 48 }; 49 50 /* 51 * This is a vbus-supply, which also supplies the GL852G usb hub, 52 * thus has to be always-on 53 */ 54 host_pwr_5v: host-pwr-5v-regulator { 55 compatible = "regulator-fixed"; 56 gpio = <&gpio3 RK_PC4 GPIO_ACTIVE_HIGH>; 57 startup-delay-us = <1500>; 58 regulator-name = "HOST_PWR_5V"; 59 regulator-min-microvolt = <5000000>; 60 regulator-max-microvolt = <5000000>; 61 vin-supply = <&dc_5v>; 62 pinctrl-names = "default"; 63 pinctrl-0 = <&host_drv>; 64 enable-active-high; 65 regulator-always-on; 66 }; 67 68 ir-receiver { 69 compatible = "gpio-ir-receiver"; 70 gpios = <&gpio3 RK_PD2 GPIO_ACTIVE_LOW>; 71 pinctrl-names = "default"; 72 pinctrl-0 = <&ir_int>; 73 }; 74 75 leds { 76 compatible = "gpio-leds"; 77 78 led-power { 79 gpios = <&gpio0 RK_PD2 GPIO_ACTIVE_HIGH>; 80 function = LED_FUNCTION_POWER; 81 color = <LED_COLOR_ID_BLUE>; 82 default-state = "on"; 83 pinctrl-names = "default"; 84 pinctrl-0 = <&power_led>; 85 }; 86 87 led-spd { 88 gpios = <&gpio3 RK_PB3 GPIO_ACTIVE_LOW>; 89 function = LED_FUNCTION_LAN; 90 color = <LED_COLOR_ID_GREEN>; 91 /* 92 * currently not allowed to be set as per 93 * https://www.kernel.org/doc/Documentation/devicetree/bindings/leds/common.yaml 94 * and needs to set in userspace: 95 * 96 * linux,default-trigger = "netdev"; 97 */ 98 pinctrl-names = "default"; 99 pinctrl-0 = <&spd_led>; 100 }; 101 }; 102 103 mcu3v3: mcu3v3-regulator { 104 compatible = "regulator-fixed"; 105 regulator-name = "MCU3V3"; 106 regulator-min-microvolt = <3300000>; 107 regulator-max-microvolt = <3300000>; 108 vin-supply = <&vcc_io>; 109 regulator-always-on; 110 regulator-boot-on; 111 }; 112 113 vcc_ddr: vcc-ddr-regulator { 114 compatible = "regulator-fixed"; 115 regulator-name = "VCC_DDR"; 116 regulator-min-microvolt = <1500000>; 117 regulator-max-microvolt = <1500000>; 118 vin-supply = <&vcc_sys>; 119 regulator-always-on; 120 regulator-boot-on; 121 }; 122 123 vcc_io: vcc-io-regulator { 124 compatible = "regulator-fixed"; 125 regulator-name = "VCC_IO"; 126 regulator-min-microvolt = <3300000>; 127 regulator-max-microvolt = <3300000>; 128 vin-supply = <&vcc_sys>; 129 regulator-always-on; 130 regulator-boot-on; 131 }; 132 133 vcc_lan: vcc-lan-regulator { 134 compatible = "regulator-fixed"; 135 regulator-name = "VCC_LAN"; 136 regulator-min-microvolt = <3300000>; 137 regulator-max-microvolt = <3300000>; 138 vin-supply = <&vcc_io>; 139 regulator-always-on; 140 regulator-boot-on; 141 }; 142 143 vcc_sd: vcc-sd-regulator { 144 compatible = "regulator-fixed"; 145 gpio = <&gpio1 RK_PB6 GPIO_ACTIVE_LOW>; 146 startup-delay-us = <500>; 147 regulator-name = "VCC_SD"; 148 regulator-min-microvolt = <3300000>; 149 regulator-max-microvolt = <3300000>; 150 vin-supply = <&vcc_io>; 151 pinctrl-names = "default"; 152 pinctrl-0 = <&sdmmc_pwren>; 153 }; 154 155 vcc_sys: vcc-sys-regulator { 156 compatible = "regulator-fixed"; 157 regulator-name = "VCC_SYS"; 158 regulator-min-microvolt = <5000000>; 159 regulator-max-microvolt = <5000000>; 160 vin-supply = <&dc_5v>; 161 regulator-always-on; 162 regulator-boot-on; 163 }; 164 165 vcc33_hdmi: vcc33-hdmi-regulator { 166 compatible = "regulator-fixed"; 167 regulator-name = "VCC33_HDMI"; 168 regulator-min-microvolt = <3300000>; 169 regulator-max-microvolt = <3300000>; 170 vin-supply = <&vcca_33>; 171 regulator-always-on; 172 regulator-boot-on; 173 }; 174 175 vcca_33: vcca-33-regulator { 176 compatible = "regulator-fixed"; 177 regulator-name = "VCCA_33"; 178 regulator-min-microvolt = <3300000>; 179 regulator-max-microvolt = <3300000>; 180 vin-supply = <&vcc_sys>; 181 regulator-always-on; 182 regulator-boot-on; 183 }; 184 185 vdd_11: vdd-11-regulator { 186 compatible = "regulator-fixed"; 187 regulator-name = "VDD_11"; 188 regulator-min-microvolt = <1100000>; 189 regulator-max-microvolt = <1100000>; 190 vin-supply = <&vcc_sys>; 191 regulator-always-on; 192 regulator-boot-on; 193 }; 194 195 vdd11_hdmi: vdd11-hdmi-regulator { 196 compatible = "regulator-fixed"; 197 regulator-name = "VDD11_HDMI"; 198 regulator-min-microvolt = <1100000>; 199 regulator-max-microvolt = <1100000>; 200 vin-supply = <&vdd_11>; 201 regulator-always-on; 202 regulator-boot-on; 203 }; 204 205 vdd_arm: vdd-arm-regulator { 206 compatible = "pwm-regulator"; 207 regulator-name = "VDD_ARM"; 208 pwms = <&pwm1 0 25000 1>; 209 pwm-supply = <&vcc_sys>; 210 regulator-min-microvolt = <900000>; 211 regulator-max-microvolt = <1400000>; 212 regulator-always-on; 213 regulator-boot-on; 214 }; 215 216 /* 217 * As per schematics vdd_log is minimum 900 mV, maximum 1400 mV. 218 * Since there are HW blocks in PD_LOGIC (which are all driven by 219 * this supply), that either do not have a driver at all or the 220 * driver does not implement regulator support we have to make 221 * sure here that the voltage never drops below 1050 mV. 222 */ 223 vdd_log: vdd-log-regulator { 224 compatible = "pwm-regulator"; 225 regulator-name = "VDD_LOG"; 226 pwms = <&pwm2 0 25000 1>; 227 pwm-dutycycle-range = <30 100>; 228 pwm-supply = <&vcc_sys>; 229 regulator-min-microvolt = <1050000>; 230 regulator-max-microvolt = <1400000>; 231 regulator-ramp-delay = <4000>; 232 regulator-always-on; 233 regulator-boot-on; 234 }; 235 236}; 237 238&cpu0 { 239 cpu-supply = <&vdd_arm>; 240}; 241 242&emmc { 243 bus-width = <8>; 244 vmmc-supply = <&vcc_io>; 245 pinctrl-names = "default"; 246 pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>; 247 cap-mmc-highspeed; 248 mmc-ddr-3_3v; 249 no-sd; 250 no-sdio; 251 status = "okay"; 252}; 253 254&gmac { 255 clock_in_out = "output"; 256 phy-supply = <&vcc_lan>; 257 phy-mode = "rmii"; 258 phy-handle = <&phy0>; 259 assigned-clocks = <&cru SCLK_MAC_SRC>; 260 assigned-clock-rates= <50000000>; 261 pinctrl-names = "default"; 262 pinctrl-0 = <&rmii_pins>; 263 status = "okay"; 264}; 265 266&gpio0 { 267 gpio-line-names = /* GPIO0 A0-A7 */ 268 "", "", "HEADER_5", "HEADER_3", 269 "", "", "", "", 270 /* GPIO0 B0-B7 */ 271 "HEADER_22", "HEADER_23", "", "HEADER_19", 272 "HEADER_26", "HEADER_21", "HEADER_24", "", 273 /* GPIO0 C0-C7 */ 274 "", "HEADER_18", "", "", 275 "", "", "", "", 276 /* GPIO0 D0-D7 */ 277 "HEADER_36", "", "", "", 278 "", "", "HEADER_13", ""; 279}; 280 281&gpio1 { 282 gpio-line-names = /* GPIO1 A0-A7 */ 283 "HEADER_7", "HEADER_35", "HEADER_33", "HEADER_37", 284 "HEADER_40", "HEADER_38", "", "", 285 /* GPIO1 B0-B7 */ 286 "HEADER_11", "", "", "HEADER_29", 287 "HEADER_31", "", "", "", 288 /* GPIO1 C0-C7 */ 289 "", "", "", "", 290 "", "", "", "", 291 /* GPIO1 D0-D7 */ 292 "", "", "", "", 293 "", "", "", ""; 294}; 295 296&gpio2 { 297 gpio-line-names = /* GPIO2 A0-A7 */ 298 "", "", "", "", 299 "", "", "", "", 300 /* GPIO2 B0-B7 */ 301 "", "", "", "", 302 "", "", "", "", 303 /* GPIO2 C0-C7 */ 304 "", "", "", "", 305 "HEADER_27", "", "", "", 306 /* GPIO2 D0-D7 */ 307 "", "", "HEADER_8", "HEADER_10", 308 "", "", "", ""; 309}; 310 311&gpio3 { 312 gpio-line-names = /* GPIO3 A0-A7 */ 313 "", "", "", "", 314 "", "", "", "", 315 /* GPIO3 B0-B7 */ 316 "", "", "", "", 317 "", "", "", "", 318 /* GPIO3 C0-C7 */ 319 "", "HEADER_32", "", "", 320 "", "", "", "HEADER_12", 321 /* GPIO3 D0-D7 */ 322 "", "", "", "HEADER_15", 323 "", "", "", ""; 324}; 325 326&gpu { 327 mali-supply = <&vdd_log>; 328 status = "okay"; 329}; 330 331&mdio { 332 phy0: ethernet-phy@1 { 333 compatible = "ethernet-phy-ieee802.3-c22"; 334 reg = <1>; 335 max-speed = <100>; 336 /* T2.2.4 min. 1 us */ 337 reset-assert-us = <10>; 338 /* T2.2.1 + T2.2.2 + T2.2.3 min. 6.05 us */ 339 reset-deassert-us = <20>; 340 reset-gpios = <&gpio2 RK_PD0 GPIO_ACTIVE_LOW>; 341 pinctrl-names = "default"; 342 pinctrl-0 = <&dp83848c_rst>; 343 }; 344}; 345 346&pinctrl { 347 dp83848c { 348 dp83848c_rst: dp83848c-rst { 349 rockchip,pins = <2 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>; 350 }; 351 }; 352 353 ir-receiver { 354 ir_int: ir-int { 355 rockchip,pins = <3 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; 356 }; 357 }; 358 359 leds { 360 power_led: power-led { 361 rockchip,pins = <0 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; 362 }; 363 364 spd_led: spd-led { 365 rockchip,pins = <3 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>; 366 }; 367 }; 368 369 usb2 { 370 host_drv: host-drv { 371 rockchip,pins = <3 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>; 372 }; 373 }; 374}; 375 376&pwm1 { 377 status = "okay"; 378}; 379 380&pwm2 { 381 status = "okay"; 382}; 383 384&saradc { 385 vref-supply = <&vcc_io>; 386 status = "okay"; 387}; 388 389&sdmmc { 390 bus-width = <4>; 391 vmmc-supply = <&vcc_sd>; 392 pinctrl-names = "default"; 393 pinctrl-0 = <&sdmmc_bus4 &sdmmc_clk &sdmmc_cmd &sdmmc_det>; 394 disable-wp; 395 cap-sd-highspeed; 396 no-mmc; 397 no-sdio; 398 status = "okay"; 399}; 400 401&uart1 { 402 status = "okay"; 403}; 404 405&usb_host_ehci { 406 status = "okay"; 407}; 408 409&usb_otg { 410 vusb_a-supply = <&vcc_io>; 411 vusb_d-supply = <&vdd_11>; 412 status = "okay"; 413}; 414 415&usb2phy { 416 status = "okay"; 417}; 418 419&usb2phy_host { 420 status = "okay"; 421}; 422 423&usb2phy_otg { 424 status = "okay"; 425}; 426