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