Chen-Yu Tsai | 10d8bc5 | 2016-12-02 16:12:32 +0800 | [diff] [blame] | 1 | /* |
Jagan Teki | 25b3d90 | 2018-08-05 00:40:13 +0530 | [diff] [blame] | 2 | * Copyright (C) 2017 Chen-Yu Tsai <wens@csie.org> |
| 3 | * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.io> |
Chen-Yu Tsai | 10d8bc5 | 2016-12-02 16:12:32 +0800 | [diff] [blame] | 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 file 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 file 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 | #include "sun8i-r40.dtsi" |
Andre Przywara | ceda40a | 2022-09-13 00:52:52 +0100 | [diff] [blame] | 46 | #include "sun8i-r40-cpu-opp.dtsi" |
Chen-Yu Tsai | 10d8bc5 | 2016-12-02 16:12:32 +0800 | [diff] [blame] | 47 | |
Jagan Teki | 25b3d90 | 2018-08-05 00:40:13 +0530 | [diff] [blame] | 48 | #include <dt-bindings/gpio/gpio.h> |
| 49 | |
Chen-Yu Tsai | 10d8bc5 | 2016-12-02 16:12:32 +0800 | [diff] [blame] | 50 | / { |
| 51 | model = "Banana Pi BPI-M2-Ultra"; |
| 52 | compatible = "sinovoip,bpi-m2-ultra", "allwinner,sun8i-r40"; |
| 53 | |
| 54 | aliases { |
Lothar Felten | a8b36f2 | 2018-07-13 10:45:30 +0200 | [diff] [blame] | 55 | ethernet0 = &gmac; |
Chen-Yu Tsai | 10d8bc5 | 2016-12-02 16:12:32 +0800 | [diff] [blame] | 56 | serial0 = &uart0; |
| 57 | }; |
| 58 | |
| 59 | chosen { |
| 60 | stdout-path = "serial0:115200n8"; |
| 61 | }; |
Jagan Teki | 25b3d90 | 2018-08-05 00:40:13 +0530 | [diff] [blame] | 62 | |
Jagan Teki | 3705d49 | 2019-04-09 15:08:51 +0530 | [diff] [blame] | 63 | connector { |
| 64 | compatible = "hdmi-connector"; |
| 65 | type = "a"; |
| 66 | |
| 67 | port { |
| 68 | hdmi_con_in: endpoint { |
| 69 | remote-endpoint = <&hdmi_out_con>; |
| 70 | }; |
| 71 | }; |
| 72 | }; |
| 73 | |
Jagan Teki | 25b3d90 | 2018-08-05 00:40:13 +0530 | [diff] [blame] | 74 | leds { |
| 75 | compatible = "gpio-leds"; |
| 76 | |
| 77 | pwr-led { |
| 78 | label = "bananapi:red:pwr"; |
| 79 | gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>; |
| 80 | default-state = "on"; |
| 81 | }; |
| 82 | |
| 83 | user-led-green { |
| 84 | label = "bananapi:green:user"; |
| 85 | gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>; |
| 86 | }; |
| 87 | |
| 88 | user-led-blue { |
| 89 | label = "bananapi:blue:user"; |
| 90 | gpios = <&pio 7 22 GPIO_ACTIVE_HIGH>; |
| 91 | }; |
| 92 | }; |
| 93 | |
| 94 | reg_vcc5v0: vcc5v0 { |
| 95 | compatible = "regulator-fixed"; |
| 96 | regulator-name = "vcc5v0"; |
| 97 | regulator-min-microvolt = <5000000>; |
| 98 | regulator-max-microvolt = <5000000>; |
| 99 | gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */ |
| 100 | enable-active-high; |
| 101 | }; |
| 102 | |
| 103 | wifi_pwrseq: wifi_pwrseq { |
| 104 | compatible = "mmc-pwrseq-simple"; |
| 105 | reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 WIFI_EN */ |
Jagan Teki | 3705d49 | 2019-04-09 15:08:51 +0530 | [diff] [blame] | 106 | clocks = <&ccu CLK_OUTA>; |
| 107 | clock-names = "ext_clock"; |
Jagan Teki | 25b3d90 | 2018-08-05 00:40:13 +0530 | [diff] [blame] | 108 | }; |
Chen-Yu Tsai | 10d8bc5 | 2016-12-02 16:12:32 +0800 | [diff] [blame] | 109 | }; |
| 110 | |
Jagan Teki | 3705d49 | 2019-04-09 15:08:51 +0530 | [diff] [blame] | 111 | &ahci { |
| 112 | ahci-supply = <®_dldo4>; |
| 113 | phy-supply = <®_eldo3>; |
| 114 | status = "okay"; |
| 115 | }; |
| 116 | |
Andre Przywara | ceda40a | 2022-09-13 00:52:52 +0100 | [diff] [blame] | 117 | &cpu0 { |
| 118 | cpu-supply = <®_dcdc2>; |
| 119 | }; |
| 120 | |
Jagan Teki | 3705d49 | 2019-04-09 15:08:51 +0530 | [diff] [blame] | 121 | &de { |
| 122 | status = "okay"; |
| 123 | }; |
| 124 | |
Jagan Teki | 25b3d90 | 2018-08-05 00:40:13 +0530 | [diff] [blame] | 125 | &ehci1 { |
Chen-Yu Tsai | 10d8bc5 | 2016-12-02 16:12:32 +0800 | [diff] [blame] | 126 | status = "okay"; |
| 127 | }; |
| 128 | |
Jagan Teki | 25b3d90 | 2018-08-05 00:40:13 +0530 | [diff] [blame] | 129 | &ehci2 { |
Chen-Yu Tsai | 10d8bc5 | 2016-12-02 16:12:32 +0800 | [diff] [blame] | 130 | status = "okay"; |
| 131 | }; |
Lothar Felten | a8b36f2 | 2018-07-13 10:45:30 +0200 | [diff] [blame] | 132 | |
| 133 | &gmac { |
| 134 | pinctrl-names = "default"; |
| 135 | pinctrl-0 = <&gmac_rgmii_pins>; |
| 136 | phy-handle = <&phy1>; |
Ivan Uvarov | 9e18024 | 2021-04-19 12:30:57 +0300 | [diff] [blame] | 137 | phy-mode = "rgmii-id"; |
Jagan Teki | 25b3d90 | 2018-08-05 00:40:13 +0530 | [diff] [blame] | 138 | phy-supply = <®_dc1sw>; |
Lothar Felten | a8b36f2 | 2018-07-13 10:45:30 +0200 | [diff] [blame] | 139 | status = "okay"; |
| 140 | }; |
| 141 | |
| 142 | &gmac_mdio { |
| 143 | phy1: ethernet-phy@1 { |
| 144 | compatible = "ethernet-phy-ieee802.3-c22"; |
| 145 | reg = <1>; |
| 146 | }; |
| 147 | }; |
Jagan Teki | 25b3d90 | 2018-08-05 00:40:13 +0530 | [diff] [blame] | 148 | |
Jagan Teki | 3705d49 | 2019-04-09 15:08:51 +0530 | [diff] [blame] | 149 | &hdmi { |
| 150 | status = "okay"; |
| 151 | }; |
| 152 | |
| 153 | &hdmi_out { |
| 154 | hdmi_out_con: endpoint { |
| 155 | remote-endpoint = <&hdmi_con_in>; |
| 156 | }; |
| 157 | }; |
| 158 | |
Jagan Teki | 25b3d90 | 2018-08-05 00:40:13 +0530 | [diff] [blame] | 159 | &i2c0 { |
| 160 | status = "okay"; |
| 161 | |
| 162 | axp22x: pmic@34 { |
| 163 | compatible = "x-powers,axp221"; |
| 164 | reg = <0x34>; |
| 165 | interrupt-parent = <&nmi_intc>; |
| 166 | interrupts = <0 IRQ_TYPE_LEVEL_LOW>; |
| 167 | }; |
| 168 | }; |
| 169 | |
| 170 | #include "axp22x.dtsi" |
| 171 | |
Ivan Uvarov | 9e18024 | 2021-04-19 12:30:57 +0300 | [diff] [blame] | 172 | &ir0 { |
| 173 | status = "okay"; |
| 174 | }; |
| 175 | |
Jagan Teki | 25b3d90 | 2018-08-05 00:40:13 +0530 | [diff] [blame] | 176 | &mmc0 { |
| 177 | vmmc-supply = <®_dcdc1>; |
| 178 | bus-width = <4>; |
Jagan Teki | 3705d49 | 2019-04-09 15:08:51 +0530 | [diff] [blame] | 179 | cd-gpios = <&pio 7 13 GPIO_ACTIVE_LOW>; /* PH13 */ |
Jagan Teki | 25b3d90 | 2018-08-05 00:40:13 +0530 | [diff] [blame] | 180 | status = "okay"; |
| 181 | }; |
| 182 | |
| 183 | &mmc1 { |
| 184 | pinctrl-names = "default"; |
| 185 | pinctrl-0 = <&mmc1_pg_pins>; |
| 186 | vmmc-supply = <®_dldo2>; |
| 187 | vqmmc-supply = <®_dldo1>; |
| 188 | mmc-pwrseq = <&wifi_pwrseq>; |
| 189 | bus-width = <4>; |
| 190 | non-removable; |
| 191 | status = "okay"; |
| 192 | }; |
| 193 | |
| 194 | &mmc2 { |
| 195 | vmmc-supply = <®_dcdc1>; |
| 196 | vqmmc-supply = <®_dcdc1>; |
| 197 | bus-width = <8>; |
| 198 | non-removable; |
| 199 | status = "okay"; |
| 200 | }; |
| 201 | |
| 202 | &ohci1 { |
| 203 | status = "okay"; |
| 204 | }; |
| 205 | |
| 206 | &ohci2 { |
| 207 | status = "okay"; |
| 208 | }; |
| 209 | |
Jagan Teki | 3705d49 | 2019-04-09 15:08:51 +0530 | [diff] [blame] | 210 | &pio { |
| 211 | pinctrl-names = "default"; |
| 212 | pinctrl-0 = <&clk_out_a_pin>; |
Ivan Uvarov | 9e18024 | 2021-04-19 12:30:57 +0300 | [diff] [blame] | 213 | vcc-pa-supply = <®_aldo2>; |
| 214 | vcc-pc-supply = <®_dcdc1>; |
| 215 | vcc-pd-supply = <®_dcdc1>; |
| 216 | vcc-pe-supply = <®_eldo1>; |
| 217 | vcc-pf-supply = <®_dcdc1>; |
| 218 | vcc-pg-supply = <®_dldo1>; |
Jagan Teki | 3705d49 | 2019-04-09 15:08:51 +0530 | [diff] [blame] | 219 | }; |
| 220 | |
Jagan Teki | 25b3d90 | 2018-08-05 00:40:13 +0530 | [diff] [blame] | 221 | ®_aldo2 { |
Jagan Teki | 25b3d90 | 2018-08-05 00:40:13 +0530 | [diff] [blame] | 222 | regulator-min-microvolt = <2500000>; |
| 223 | regulator-max-microvolt = <2500000>; |
| 224 | regulator-name = "vcc-pa"; |
| 225 | }; |
| 226 | |
| 227 | ®_aldo3 { |
| 228 | regulator-always-on; |
| 229 | regulator-min-microvolt = <2700000>; |
| 230 | regulator-max-microvolt = <3300000>; |
| 231 | regulator-name = "avcc"; |
| 232 | }; |
| 233 | |
| 234 | ®_dc1sw { |
Ivan Uvarov | 9e18024 | 2021-04-19 12:30:57 +0300 | [diff] [blame] | 235 | regulator-min-microvolt = <3300000>; |
| 236 | regulator-max-microvolt = <3300000>; |
Jagan Teki | 25b3d90 | 2018-08-05 00:40:13 +0530 | [diff] [blame] | 237 | regulator-name = "vcc-gmac-phy"; |
| 238 | }; |
| 239 | |
| 240 | ®_dcdc1 { |
| 241 | regulator-always-on; |
Ivan Uvarov | 9e18024 | 2021-04-19 12:30:57 +0300 | [diff] [blame] | 242 | regulator-min-microvolt = <3300000>; |
| 243 | regulator-max-microvolt = <3300000>; |
| 244 | regulator-name = "vcc-3v3"; |
Jagan Teki | 25b3d90 | 2018-08-05 00:40:13 +0530 | [diff] [blame] | 245 | }; |
| 246 | |
| 247 | ®_dcdc2 { |
| 248 | regulator-always-on; |
| 249 | regulator-min-microvolt = <1000000>; |
| 250 | regulator-max-microvolt = <1300000>; |
| 251 | regulator-name = "vdd-cpu"; |
| 252 | }; |
| 253 | |
| 254 | ®_dcdc3 { |
| 255 | regulator-always-on; |
| 256 | regulator-min-microvolt = <1000000>; |
| 257 | regulator-max-microvolt = <1300000>; |
| 258 | regulator-name = "vdd-sys"; |
| 259 | }; |
| 260 | |
| 261 | ®_dcdc5 { |
| 262 | regulator-always-on; |
| 263 | regulator-min-microvolt = <1500000>; |
| 264 | regulator-max-microvolt = <1500000>; |
| 265 | regulator-name = "vcc-dram"; |
| 266 | }; |
| 267 | |
| 268 | ®_dldo1 { |
| 269 | regulator-min-microvolt = <1800000>; |
| 270 | regulator-max-microvolt = <3300000>; |
| 271 | regulator-name = "vcc-wifi-io"; |
| 272 | }; |
| 273 | |
Jagan Teki | 3705d49 | 2019-04-09 15:08:51 +0530 | [diff] [blame] | 274 | /* |
| 275 | * Our WiFi chip needs both DLDO2 and DLDO3 to be powered at the same |
| 276 | * time, with the two being in sync, to be able to meet maximum power |
| 277 | * consumption during transmits. Since this is not really supported |
| 278 | * right now, just use the two as always on, and we will fix it later. |
| 279 | */ |
| 280 | |
Jagan Teki | 25b3d90 | 2018-08-05 00:40:13 +0530 | [diff] [blame] | 281 | ®_dldo2 { |
Jagan Teki | 3705d49 | 2019-04-09 15:08:51 +0530 | [diff] [blame] | 282 | regulator-always-on; |
Jagan Teki | 25b3d90 | 2018-08-05 00:40:13 +0530 | [diff] [blame] | 283 | regulator-min-microvolt = <3300000>; |
| 284 | regulator-max-microvolt = <3300000>; |
| 285 | regulator-name = "vcc-wifi"; |
| 286 | }; |
| 287 | |
Jagan Teki | 3705d49 | 2019-04-09 15:08:51 +0530 | [diff] [blame] | 288 | ®_dldo3 { |
| 289 | regulator-always-on; |
| 290 | regulator-min-microvolt = <3300000>; |
| 291 | regulator-max-microvolt = <3300000>; |
| 292 | regulator-name = "vcc-wifi-2"; |
| 293 | }; |
| 294 | |
| 295 | ®_dldo4 { |
| 296 | regulator-min-microvolt = <2500000>; |
| 297 | regulator-max-microvolt = <2500000>; |
| 298 | regulator-name = "vdd2v5-sata"; |
| 299 | }; |
| 300 | |
| 301 | ®_eldo3 { |
| 302 | regulator-min-microvolt = <1200000>; |
| 303 | regulator-max-microvolt = <1200000>; |
| 304 | regulator-name = "vdd1v2-sata"; |
| 305 | }; |
| 306 | |
| 307 | &tcon_tv0 { |
| 308 | status = "okay"; |
| 309 | }; |
| 310 | |
Jagan Teki | 25b3d90 | 2018-08-05 00:40:13 +0530 | [diff] [blame] | 311 | &uart0 { |
| 312 | pinctrl-names = "default"; |
| 313 | pinctrl-0 = <&uart0_pb_pins>; |
| 314 | status = "okay"; |
| 315 | }; |
| 316 | |
Jagan Teki | 3705d49 | 2019-04-09 15:08:51 +0530 | [diff] [blame] | 317 | &uart3 { |
| 318 | pinctrl-names = "default"; |
| 319 | pinctrl-0 = <&uart3_pg_pins>, <&uart3_rts_cts_pg_pins>; |
| 320 | uart-has-rtscts; |
| 321 | status = "okay"; |
| 322 | |
| 323 | bluetooth { |
| 324 | compatible = "brcm,bcm43438-bt"; |
| 325 | clocks = <&ccu CLK_OUTA>; |
| 326 | clock-names = "lpo"; |
| 327 | vbat-supply = <®_dldo2>; |
| 328 | vddio-supply = <®_dldo1>; |
| 329 | device-wakeup-gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */ |
| 330 | /* TODO host wake line connected to PMIC GPIO pins */ |
| 331 | shutdown-gpios = <&pio 7 12 GPIO_ACTIVE_HIGH>; /* PH12 */ |
| 332 | max-speed = <1500000>; |
| 333 | }; |
| 334 | }; |
| 335 | |
Jagan Teki | 25b3d90 | 2018-08-05 00:40:13 +0530 | [diff] [blame] | 336 | &usbphy { |
| 337 | usb1_vbus-supply = <®_vcc5v0>; |
| 338 | usb2_vbus-supply = <®_vcc5v0>; |
| 339 | status = "okay"; |
| 340 | }; |