1 1.1 jmcneill /* 2 1.1 jmcneill * Copyright (C) 2017 Chen-Yu Tsai <wens (at) csie.org> 3 1.1 jmcneill * Copyright (C) 2017 Icenowy Zheng <icenowy (at) aosc.io> 4 1.1 jmcneill * 5 1.1 jmcneill * This file is dual-licensed: you can use it either under the terms 6 1.1 jmcneill * of the GPL or the X11 license, at your option. Note that this dual 7 1.1 jmcneill * licensing only applies to this file, and not this project as a 8 1.1 jmcneill * whole. 9 1.1 jmcneill * 10 1.1 jmcneill * a) This file is free software; you can redistribute it and/or 11 1.1 jmcneill * modify it under the terms of the GNU General Public License as 12 1.1 jmcneill * published by the Free Software Foundation; either version 2 of the 13 1.1 jmcneill * License, or (at your option) any later version. 14 1.1 jmcneill * 15 1.1 jmcneill * This file is distributed in the hope that it will be useful, 16 1.1 jmcneill * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 1.1 jmcneill * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 1.1 jmcneill * GNU General Public License for more details. 19 1.1 jmcneill * 20 1.1 jmcneill * Or, alternatively, 21 1.1 jmcneill * 22 1.1 jmcneill * b) Permission is hereby granted, free of charge, to any person 23 1.1 jmcneill * obtaining a copy of this software and associated documentation 24 1.1 jmcneill * files (the "Software"), to deal in the Software without 25 1.1 jmcneill * restriction, including without limitation the rights to use, 26 1.1 jmcneill * copy, modify, merge, publish, distribute, sublicense, and/or 27 1.1 jmcneill * sell copies of the Software, and to permit persons to whom the 28 1.1 jmcneill * Software is furnished to do so, subject to the following 29 1.1 jmcneill * conditions: 30 1.1 jmcneill * 31 1.1 jmcneill * The above copyright notice and this permission notice shall be 32 1.1 jmcneill * included in all copies or substantial portions of the Software. 33 1.1 jmcneill * 34 1.1 jmcneill * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 35 1.1 jmcneill * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 36 1.1 jmcneill * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 37 1.1 jmcneill * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 38 1.1 jmcneill * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 39 1.1 jmcneill * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 40 1.1 jmcneill * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 41 1.1 jmcneill * OTHER DEALINGS IN THE SOFTWARE. 42 1.1 jmcneill */ 43 1.1 jmcneill 44 1.1 jmcneill /dts-v1/; 45 1.1 jmcneill #include "sun8i-r40.dtsi" 46 1.1 jmcneill 47 1.1 jmcneill #include <dt-bindings/gpio/gpio.h> 48 1.1 jmcneill 49 1.1 jmcneill / { 50 1.1 jmcneill model = "Banana Pi BPI-M2-Ultra"; 51 1.1 jmcneill compatible = "sinovoip,bpi-m2-ultra", "allwinner,sun8i-r40"; 52 1.1 jmcneill 53 1.1 jmcneill aliases { 54 1.1.1.3 jmcneill ethernet0 = &gmac; 55 1.1 jmcneill serial0 = &uart0; 56 1.1 jmcneill }; 57 1.1 jmcneill 58 1.1 jmcneill chosen { 59 1.1 jmcneill stdout-path = "serial0:115200n8"; 60 1.1 jmcneill }; 61 1.1 jmcneill 62 1.1.1.4 jmcneill connector { 63 1.1.1.4 jmcneill compatible = "hdmi-connector"; 64 1.1.1.4 jmcneill type = "a"; 65 1.1.1.4 jmcneill 66 1.1.1.4 jmcneill port { 67 1.1.1.4 jmcneill hdmi_con_in: endpoint { 68 1.1.1.4 jmcneill remote-endpoint = <&hdmi_out_con>; 69 1.1.1.4 jmcneill }; 70 1.1.1.4 jmcneill }; 71 1.1.1.4 jmcneill }; 72 1.1.1.4 jmcneill 73 1.1 jmcneill leds { 74 1.1 jmcneill compatible = "gpio-leds"; 75 1.1 jmcneill 76 1.1 jmcneill pwr-led { 77 1.1 jmcneill label = "bananapi:red:pwr"; 78 1.1 jmcneill gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>; 79 1.1 jmcneill default-state = "on"; 80 1.1 jmcneill }; 81 1.1 jmcneill 82 1.1 jmcneill user-led-green { 83 1.1 jmcneill label = "bananapi:green:user"; 84 1.1 jmcneill gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>; 85 1.1 jmcneill }; 86 1.1 jmcneill 87 1.1 jmcneill user-led-blue { 88 1.1 jmcneill label = "bananapi:blue:user"; 89 1.1 jmcneill gpios = <&pio 7 22 GPIO_ACTIVE_HIGH>; 90 1.1 jmcneill }; 91 1.1 jmcneill }; 92 1.1 jmcneill 93 1.1 jmcneill reg_vcc5v0: vcc5v0 { 94 1.1 jmcneill compatible = "regulator-fixed"; 95 1.1 jmcneill regulator-name = "vcc5v0"; 96 1.1 jmcneill regulator-min-microvolt = <5000000>; 97 1.1 jmcneill regulator-max-microvolt = <5000000>; 98 1.1 jmcneill gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */ 99 1.1 jmcneill enable-active-high; 100 1.1 jmcneill }; 101 1.1 jmcneill 102 1.1 jmcneill wifi_pwrseq: wifi_pwrseq { 103 1.1 jmcneill compatible = "mmc-pwrseq-simple"; 104 1.1 jmcneill reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 WIFI_EN */ 105 1.1.1.5 jmcneill clocks = <&ccu CLK_OUTA>; 106 1.1.1.5 jmcneill clock-names = "ext_clock"; 107 1.1 jmcneill }; 108 1.1 jmcneill }; 109 1.1 jmcneill 110 1.1.1.4 jmcneill &ahci { 111 1.1.1.4 jmcneill ahci-supply = <®_dldo4>; 112 1.1.1.4 jmcneill phy-supply = <®_eldo3>; 113 1.1.1.4 jmcneill status = "okay"; 114 1.1.1.4 jmcneill }; 115 1.1.1.4 jmcneill 116 1.1.1.4 jmcneill &de { 117 1.1.1.4 jmcneill status = "okay"; 118 1.1.1.4 jmcneill }; 119 1.1.1.4 jmcneill 120 1.1 jmcneill &ehci1 { 121 1.1 jmcneill status = "okay"; 122 1.1 jmcneill }; 123 1.1 jmcneill 124 1.1 jmcneill &ehci2 { 125 1.1 jmcneill status = "okay"; 126 1.1 jmcneill }; 127 1.1 jmcneill 128 1.1.1.3 jmcneill &gmac { 129 1.1.1.3 jmcneill pinctrl-names = "default"; 130 1.1.1.3 jmcneill pinctrl-0 = <&gmac_rgmii_pins>; 131 1.1.1.3 jmcneill phy-handle = <&phy1>; 132 1.1.1.7 jmcneill phy-mode = "rgmii-id"; 133 1.1.1.3 jmcneill phy-supply = <®_dc1sw>; 134 1.1.1.3 jmcneill status = "okay"; 135 1.1.1.3 jmcneill }; 136 1.1.1.3 jmcneill 137 1.1.1.3 jmcneill &gmac_mdio { 138 1.1.1.3 jmcneill phy1: ethernet-phy@1 { 139 1.1.1.3 jmcneill compatible = "ethernet-phy-ieee802.3-c22"; 140 1.1.1.3 jmcneill reg = <1>; 141 1.1.1.3 jmcneill }; 142 1.1.1.3 jmcneill }; 143 1.1.1.3 jmcneill 144 1.1.1.4 jmcneill &hdmi { 145 1.1.1.4 jmcneill status = "okay"; 146 1.1.1.4 jmcneill }; 147 1.1.1.4 jmcneill 148 1.1.1.4 jmcneill &hdmi_out { 149 1.1.1.4 jmcneill hdmi_out_con: endpoint { 150 1.1.1.4 jmcneill remote-endpoint = <&hdmi_con_in>; 151 1.1.1.4 jmcneill }; 152 1.1.1.4 jmcneill }; 153 1.1.1.4 jmcneill 154 1.1 jmcneill &i2c0 { 155 1.1 jmcneill status = "okay"; 156 1.1 jmcneill 157 1.1 jmcneill axp22x: pmic@34 { 158 1.1 jmcneill compatible = "x-powers,axp221"; 159 1.1 jmcneill reg = <0x34>; 160 1.1 jmcneill interrupt-parent = <&nmi_intc>; 161 1.1 jmcneill interrupts = <0 IRQ_TYPE_LEVEL_LOW>; 162 1.1 jmcneill }; 163 1.1 jmcneill }; 164 1.1 jmcneill 165 1.1 jmcneill #include "axp22x.dtsi" 166 1.1 jmcneill 167 1.1.1.7 jmcneill &ir0 { 168 1.1.1.7 jmcneill status = "okay"; 169 1.1.1.7 jmcneill }; 170 1.1.1.7 jmcneill 171 1.1.1.3 jmcneill &mmc0 { 172 1.1.1.3 jmcneill vmmc-supply = <®_dcdc1>; 173 1.1.1.3 jmcneill bus-width = <4>; 174 1.1.1.4 jmcneill cd-gpios = <&pio 7 13 GPIO_ACTIVE_LOW>; /* PH13 */ 175 1.1.1.3 jmcneill status = "okay"; 176 1.1.1.3 jmcneill }; 177 1.1.1.3 jmcneill 178 1.1.1.3 jmcneill &mmc1 { 179 1.1.1.3 jmcneill pinctrl-names = "default"; 180 1.1.1.3 jmcneill pinctrl-0 = <&mmc1_pg_pins>; 181 1.1.1.3 jmcneill vmmc-supply = <®_dldo2>; 182 1.1.1.3 jmcneill vqmmc-supply = <®_dldo1>; 183 1.1.1.3 jmcneill mmc-pwrseq = <&wifi_pwrseq>; 184 1.1.1.3 jmcneill bus-width = <4>; 185 1.1.1.3 jmcneill non-removable; 186 1.1.1.3 jmcneill status = "okay"; 187 1.1.1.3 jmcneill }; 188 1.1.1.3 jmcneill 189 1.1.1.3 jmcneill &mmc2 { 190 1.1.1.3 jmcneill vmmc-supply = <®_dcdc1>; 191 1.1.1.3 jmcneill vqmmc-supply = <®_dcdc1>; 192 1.1.1.3 jmcneill bus-width = <8>; 193 1.1.1.3 jmcneill non-removable; 194 1.1.1.3 jmcneill status = "okay"; 195 1.1.1.3 jmcneill }; 196 1.1.1.3 jmcneill 197 1.1.1.3 jmcneill &ohci1 { 198 1.1.1.3 jmcneill status = "okay"; 199 1.1.1.3 jmcneill }; 200 1.1.1.3 jmcneill 201 1.1.1.3 jmcneill &ohci2 { 202 1.1.1.3 jmcneill status = "okay"; 203 1.1.1.3 jmcneill }; 204 1.1.1.3 jmcneill 205 1.1.1.5 jmcneill &pio { 206 1.1.1.5 jmcneill pinctrl-names = "default"; 207 1.1.1.5 jmcneill pinctrl-0 = <&clk_out_a_pin>; 208 1.1.1.6 skrll vcc-pa-supply = <®_aldo2>; 209 1.1.1.6 skrll vcc-pc-supply = <®_dcdc1>; 210 1.1.1.6 skrll vcc-pd-supply = <®_dcdc1>; 211 1.1.1.6 skrll vcc-pe-supply = <®_eldo1>; 212 1.1.1.6 skrll vcc-pf-supply = <®_dcdc1>; 213 1.1.1.6 skrll vcc-pg-supply = <®_dldo1>; 214 1.1.1.5 jmcneill }; 215 1.1.1.5 jmcneill 216 1.1.1.3 jmcneill ®_aldo2 { 217 1.1.1.3 jmcneill regulator-min-microvolt = <2500000>; 218 1.1.1.3 jmcneill regulator-max-microvolt = <2500000>; 219 1.1.1.3 jmcneill regulator-name = "vcc-pa"; 220 1.1.1.3 jmcneill }; 221 1.1.1.3 jmcneill 222 1.1 jmcneill ®_aldo3 { 223 1.1 jmcneill regulator-always-on; 224 1.1 jmcneill regulator-min-microvolt = <2700000>; 225 1.1 jmcneill regulator-max-microvolt = <3300000>; 226 1.1 jmcneill regulator-name = "avcc"; 227 1.1 jmcneill }; 228 1.1 jmcneill 229 1.1.1.3 jmcneill ®_dc1sw { 230 1.1.1.7 jmcneill regulator-min-microvolt = <3300000>; 231 1.1.1.7 jmcneill regulator-max-microvolt = <3300000>; 232 1.1.1.3 jmcneill regulator-name = "vcc-gmac-phy"; 233 1.1.1.3 jmcneill }; 234 1.1.1.3 jmcneill 235 1.1 jmcneill ®_dcdc1 { 236 1.1 jmcneill regulator-always-on; 237 1.1.1.7 jmcneill regulator-min-microvolt = <3300000>; 238 1.1.1.7 jmcneill regulator-max-microvolt = <3300000>; 239 1.1.1.7 jmcneill regulator-name = "vcc-3v3"; 240 1.1 jmcneill }; 241 1.1 jmcneill 242 1.1 jmcneill ®_dcdc2 { 243 1.1 jmcneill regulator-always-on; 244 1.1 jmcneill regulator-min-microvolt = <1000000>; 245 1.1 jmcneill regulator-max-microvolt = <1300000>; 246 1.1 jmcneill regulator-name = "vdd-cpu"; 247 1.1 jmcneill }; 248 1.1 jmcneill 249 1.1 jmcneill ®_dcdc3 { 250 1.1 jmcneill regulator-always-on; 251 1.1 jmcneill regulator-min-microvolt = <1000000>; 252 1.1 jmcneill regulator-max-microvolt = <1300000>; 253 1.1 jmcneill regulator-name = "vdd-sys"; 254 1.1 jmcneill }; 255 1.1 jmcneill 256 1.1 jmcneill ®_dcdc5 { 257 1.1 jmcneill regulator-always-on; 258 1.1 jmcneill regulator-min-microvolt = <1500000>; 259 1.1 jmcneill regulator-max-microvolt = <1500000>; 260 1.1 jmcneill regulator-name = "vcc-dram"; 261 1.1 jmcneill }; 262 1.1 jmcneill 263 1.1 jmcneill ®_dldo1 { 264 1.1 jmcneill regulator-min-microvolt = <1800000>; 265 1.1 jmcneill regulator-max-microvolt = <3300000>; 266 1.1 jmcneill regulator-name = "vcc-wifi-io"; 267 1.1 jmcneill }; 268 1.1 jmcneill 269 1.1.1.5 jmcneill /* 270 1.1.1.5 jmcneill * Our WiFi chip needs both DLDO2 and DLDO3 to be powered at the same 271 1.1.1.5 jmcneill * time, with the two being in sync, to be able to meet maximum power 272 1.1.1.5 jmcneill * consumption during transmits. Since this is not really supported 273 1.1.1.5 jmcneill * right now, just use the two as always on, and we will fix it later. 274 1.1.1.5 jmcneill */ 275 1.1.1.5 jmcneill 276 1.1 jmcneill ®_dldo2 { 277 1.1.1.5 jmcneill regulator-always-on; 278 1.1 jmcneill regulator-min-microvolt = <3300000>; 279 1.1 jmcneill regulator-max-microvolt = <3300000>; 280 1.1 jmcneill regulator-name = "vcc-wifi"; 281 1.1 jmcneill }; 282 1.1 jmcneill 283 1.1.1.5 jmcneill ®_dldo3 { 284 1.1.1.5 jmcneill regulator-always-on; 285 1.1.1.5 jmcneill regulator-min-microvolt = <3300000>; 286 1.1.1.5 jmcneill regulator-max-microvolt = <3300000>; 287 1.1.1.5 jmcneill regulator-name = "vcc-wifi-2"; 288 1.1.1.5 jmcneill }; 289 1.1.1.5 jmcneill 290 1.1.1.4 jmcneill ®_dldo4 { 291 1.1.1.4 jmcneill regulator-min-microvolt = <2500000>; 292 1.1.1.4 jmcneill regulator-max-microvolt = <2500000>; 293 1.1.1.4 jmcneill regulator-name = "vdd2v5-sata"; 294 1.1.1.4 jmcneill }; 295 1.1.1.4 jmcneill 296 1.1.1.4 jmcneill ®_eldo3 { 297 1.1.1.4 jmcneill regulator-min-microvolt = <1200000>; 298 1.1.1.4 jmcneill regulator-max-microvolt = <1200000>; 299 1.1.1.4 jmcneill regulator-name = "vdd1v2-sata"; 300 1.1.1.4 jmcneill }; 301 1.1.1.4 jmcneill 302 1.1.1.4 jmcneill &tcon_tv0 { 303 1.1.1.4 jmcneill status = "okay"; 304 1.1.1.4 jmcneill }; 305 1.1.1.4 jmcneill 306 1.1 jmcneill &uart0 { 307 1.1 jmcneill pinctrl-names = "default"; 308 1.1 jmcneill pinctrl-0 = <&uart0_pb_pins>; 309 1.1 jmcneill status = "okay"; 310 1.1 jmcneill }; 311 1.1 jmcneill 312 1.1.1.5 jmcneill &uart3 { 313 1.1.1.5 jmcneill pinctrl-names = "default"; 314 1.1.1.5 jmcneill pinctrl-0 = <&uart3_pg_pins>, <&uart3_rts_cts_pg_pins>; 315 1.1.1.5 jmcneill uart-has-rtscts; 316 1.1.1.5 jmcneill status = "okay"; 317 1.1.1.5 jmcneill 318 1.1.1.5 jmcneill bluetooth { 319 1.1.1.5 jmcneill compatible = "brcm,bcm43438-bt"; 320 1.1.1.5 jmcneill clocks = <&ccu CLK_OUTA>; 321 1.1.1.5 jmcneill clock-names = "lpo"; 322 1.1.1.5 jmcneill vbat-supply = <®_dldo2>; 323 1.1.1.5 jmcneill vddio-supply = <®_dldo1>; 324 1.1.1.5 jmcneill device-wakeup-gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */ 325 1.1.1.5 jmcneill /* TODO host wake line connected to PMIC GPIO pins */ 326 1.1.1.5 jmcneill shutdown-gpios = <&pio 7 12 GPIO_ACTIVE_HIGH>; /* PH12 */ 327 1.1.1.5 jmcneill max-speed = <1500000>; 328 1.1.1.5 jmcneill }; 329 1.1.1.5 jmcneill }; 330 1.1.1.5 jmcneill 331 1.1 jmcneill &usbphy { 332 1.1 jmcneill usb1_vbus-supply = <®_vcc5v0>; 333 1.1 jmcneill usb2_vbus-supply = <®_vcc5v0>; 334 1.1 jmcneill status = "okay"; 335 1.1 jmcneill }; 336