1/* 2 * Copyright (C) 2017 Jagan Teki <jteki@openedev.com> 3 * Copyright (C) 2017-2018 Samuel Holland <samuel@sholland.org> 4 * 5 * This file is dual-licensed: you can use it either under the terms 6 * of the GPL or the X11 license, at your option. Note that this dual 7 * licensing only applies to this file, and not this project as a 8 * whole. 9 * 10 * a) This library is free software; you can redistribute it and/or 11 * modify it under the terms of the GNU General Public License as 12 * published by the Free Software Foundation; either version 2 of the 13 * License, or (at your option) any later version. 14 * 15 * This library is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU General Public License for more details. 19 * 20 * Or, alternatively, 21 * 22 * b) Permission is hereby granted, free of charge, to any person 23 * obtaining a copy of this software and associated documentation 24 * files (the "Software"), to deal in the Software without 25 * restriction, including without limitation the rights to use, 26 * copy, modify, merge, publish, distribute, sublicense, and/or 27 * sell copies of the Software, and to permit persons to whom the 28 * Software is furnished to do so, subject to the following 29 * conditions: 30 * 31 * The above copyright notice and this permission notice shall be 32 * included in all copies or substantial portions of the Software. 33 * 34 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 35 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 36 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 37 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 38 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 39 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 40 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 41 * OTHER DEALINGS IN THE SOFTWARE. 42 */ 43 44/dts-v1/; 45 46#include "sun50i-a64.dtsi" 47 48#include <dt-bindings/gpio/gpio.h> 49 50/ { 51 model = "OrangePi Win/Win Plus"; 52 compatible = "xunlong,orangepi-win", "allwinner,sun50i-a64"; 53 54 aliases { 55 ethernet0 = &emac; 56 serial0 = &uart0; 57 serial1 = &uart1; 58 serial2 = &uart2; 59 serial3 = &uart3; 60 serial4 = &uart4; 61 }; 62 63 chosen { 64 stdout-path = "serial0:115200n8"; 65 }; 66 67 leds { 68 compatible = "gpio-leds"; 69 70 status { 71 label = "orangepi:green:status"; 72 gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */ 73 }; 74 }; 75 76 reg_gmac_3v3: gmac-3v3 { 77 compatible = "regulator-fixed"; 78 regulator-name = "gmac-3v3"; 79 regulator-min-microvolt = <3300000>; 80 regulator-max-microvolt = <3300000>; 81 regulator-boot-on; 82 enable-active-high; 83 gpio = <&pio 3 14 GPIO_ACTIVE_HIGH>; /* PD14 */ 84 status = "okay"; 85 }; 86 87 reg_usb1_vbus: usb1-vbus { 88 compatible = "regulator-fixed"; 89 regulator-name = "usb1-vbus"; 90 regulator-min-microvolt = <5000000>; 91 regulator-max-microvolt = <5000000>; 92 regulator-boot-on; 93 enable-active-high; 94 gpio = <&pio 3 7 GPIO_ACTIVE_HIGH>; /* PD7 */ 95 status = "okay"; 96 }; 97 98 wifi_pwrseq: wifi_pwrseq { 99 compatible = "mmc-pwrseq-simple"; 100 reset-gpios = <&r_pio 0 8 GPIO_ACTIVE_LOW>; /* PL8 */ 101 }; 102}; 103 104&ehci0 { 105 status = "okay"; 106}; 107 108&ehci1 { 109 status = "okay"; 110}; 111 112&emac { 113 pinctrl-names = "default"; 114 pinctrl-0 = <&rgmii_pins>; 115 phy-mode = "rgmii"; 116 phy-handle = <&ext_rgmii_phy>; 117 phy-supply = <®_gmac_3v3>; 118 status = "okay"; 119}; 120 121&mdio { 122 ext_rgmii_phy: ethernet-phy@1 { 123 compatible = "ethernet-phy-ieee802.3-c22"; 124 reg = <1>; 125 }; 126}; 127 128&mmc0 { 129 pinctrl-names = "default"; 130 pinctrl-0 = <&mmc0_pins>; 131 vmmc-supply = <®_dcdc1>; 132 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ 133 disable-wp; 134 bus-width = <4>; 135 status = "okay"; 136}; 137 138&mmc1 { 139 pinctrl-names = "default"; 140 pinctrl-0 = <&mmc1_pins>; 141 vmmc-supply = <®_dldo2>; 142 vqmmc-supply = <®_dldo4>; 143 mmc-pwrseq = <&wifi_pwrseq>; 144 bus-width = <4>; 145 non-removable; 146 status = "okay"; 147}; 148 149&ohci0 { 150 status = "okay"; 151}; 152 153&ohci1 { 154 status = "okay"; 155}; 156 157&r_rsb { 158 status = "okay"; 159 160 axp803: pmic@3a3 { 161 compatible = "x-powers,axp803"; 162 reg = <0x3a3>; 163 interrupt-parent = <&r_intc>; 164 interrupts = <0 IRQ_TYPE_LEVEL_LOW>; 165 }; 166}; 167 168#include "axp803.dtsi" 169 170®_aldo1 { 171 regulator-always-on; 172 regulator-min-microvolt = <1800000>; 173 regulator-max-microvolt = <3300000>; 174 regulator-name = "afvcc-csi"; 175}; 176 177®_aldo2 { 178 regulator-always-on; 179 regulator-min-microvolt = <1800000>; 180 regulator-max-microvolt = <3300000>; 181 regulator-name = "vcc-pl"; 182}; 183 184®_aldo3 { 185 regulator-always-on; 186 regulator-min-microvolt = <3000000>; 187 regulator-max-microvolt = <3000000>; 188 regulator-name = "vcc-pll-avcc"; 189}; 190 191®_dcdc1 { 192 regulator-always-on; 193 regulator-min-microvolt = <3300000>; 194 regulator-max-microvolt = <3300000>; 195 regulator-name = "vcc-3v3"; 196}; 197 198®_dcdc2 { 199 regulator-always-on; 200 regulator-min-microvolt = <1040000>; 201 regulator-max-microvolt = <1300000>; 202 regulator-name = "vdd-cpux"; 203}; 204 205/* DCDC3 is polyphased with DCDC2 */ 206 207®_dcdc5 { 208 regulator-always-on; 209 regulator-min-microvolt = <1500000>; 210 regulator-max-microvolt = <1500000>; 211 regulator-name = "vcc-dram"; 212}; 213 214®_dcdc6 { 215 regulator-always-on; 216 regulator-min-microvolt = <1100000>; 217 regulator-max-microvolt = <1100000>; 218 regulator-name = "vdd-sys"; 219}; 220 221®_dldo1 { 222 regulator-min-microvolt = <3300000>; 223 regulator-max-microvolt = <3300000>; 224 regulator-name = "vcc-hdmi-dsi"; 225}; 226 227®_dldo2 { 228 regulator-min-microvolt = <3300000>; 229 regulator-max-microvolt = <3300000>; 230 regulator-name = "vcc-wifi"; 231}; 232 233®_dldo3 { 234 regulator-min-microvolt = <3300000>; 235 regulator-max-microvolt = <3300000>; 236 regulator-name = "avdd-csi"; 237}; 238 239®_dldo4 { 240 regulator-min-microvolt = <3300000>; 241 regulator-max-microvolt = <3300000>; 242 regulator-name = "vcc-wifi-io"; 243}; 244 245®_drivevbus { 246 regulator-name = "usb0-vbus"; 247 status = "okay"; 248}; 249 250®_eldo1 { 251 regulator-min-microvolt = <1800000>; 252 regulator-max-microvolt = <1800000>; 253 regulator-name = "cpvdd"; 254}; 255 256®_fldo1 { 257 regulator-min-microvolt = <1200000>; 258 regulator-max-microvolt = <1200000>; 259 regulator-name = "vcc-1v2-hsic"; 260}; 261 262/* 263 * The A64 chip cannot work without this regulator off, although 264 * it seems to be only driving the AR100 core. 265 * Maybe we don't still know well about CPUs domain. 266 */ 267®_fldo2 { 268 regulator-always-on; 269 regulator-min-microvolt = <1100000>; 270 regulator-max-microvolt = <1100000>; 271 regulator-name = "vdd-cpus"; 272}; 273 274®_rtc_ldo { 275 regulator-name = "vcc-rtc"; 276}; 277 278&simplefb_hdmi { 279 vcc-hdmi-supply = <®_dldo1>; 280}; 281 282/* On debug connector */ 283&uart0 { 284 pinctrl-names = "default"; 285 pinctrl-0 = <&uart0_pins_a>; 286 status = "okay"; 287}; 288 289/* Bluetooth */ 290&uart1 { 291 pinctrl-names = "default"; 292 pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>; 293 status = "okay"; 294}; 295 296/* On Pi-2 connector, RTS/CTS optional */ 297&uart2 { 298 pinctrl-names = "default"; 299 pinctrl-0 = <&uart2_pins>; 300 status = "disabled"; 301}; 302 303/* On Pi-2 connector, RTS/CTS optional */ 304&uart3 { 305 pinctrl-names = "default"; 306 pinctrl-0 = <&uart3_pins>; 307 status = "disabled"; 308}; 309 310/* On Pi-2 connector (labeled for SPI1), RTS/CTS optional */ 311&uart4 { 312 pinctrl-names = "default"; 313 pinctrl-0 = <&uart4_pins>; 314 status = "disabled"; 315}; 316 317&usb_otg { 318 dr_mode = "otg"; 319 status = "okay"; 320}; 321 322&usbphy { 323 usb0_id_det-gpios = <&pio 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */ 324 usb0_vbus-supply = <®_drivevbus>; 325 usb1_vbus-supply = <®_usb1_vbus>; 326 status = "okay"; 327}; 328