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