1724ba675SRob Herring/* 2724ba675SRob Herring * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.io> 3724ba675SRob Herring * 4724ba675SRob Herring * This file is dual-licensed: you can use it either under the terms 5724ba675SRob Herring * of the GPL or the X11 license, at your option. Note that this dual 6724ba675SRob Herring * licensing only applies to this file, and not this project as a 7724ba675SRob Herring * whole. 8724ba675SRob Herring * 9724ba675SRob Herring * a) This file is free software; you can redistribute it and/or 10724ba675SRob Herring * modify it under the terms of the GNU General Public License as 11724ba675SRob Herring * published by the Free Software Foundation; either version 2 of the 12724ba675SRob Herring * License, or (at your option) any later version. 13724ba675SRob Herring * 14724ba675SRob Herring * This file is distributed in the hope that it will be useful, 15724ba675SRob Herring * but WITHOUT ANY WARRANTY; without even the implied warranty of 16724ba675SRob Herring * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17724ba675SRob Herring * GNU General Public License for more details. 18724ba675SRob Herring * 19724ba675SRob Herring * Or, alternatively, 20724ba675SRob Herring * 21724ba675SRob Herring * b) Permission is hereby granted, free of charge, to any person 22724ba675SRob Herring * obtaining a copy of this software and associated documentation 23724ba675SRob Herring * files (the "Software"), to deal in the Software without 24724ba675SRob Herring * restriction, including without limitation the rights to use, 25724ba675SRob Herring * copy, modify, merge, publish, distribute, sublicense, and/or 26724ba675SRob Herring * sell copies of the Software, and to permit persons to whom the 27724ba675SRob Herring * Software is furnished to do so, subject to the following 28724ba675SRob Herring * conditions: 29724ba675SRob Herring * 30724ba675SRob Herring * The above copyright notice and this permission notice shall be 31724ba675SRob Herring * included in all copies or substantial portions of the Software. 32724ba675SRob Herring * 33724ba675SRob Herring * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 34724ba675SRob Herring * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 35724ba675SRob Herring * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 36724ba675SRob Herring * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 37724ba675SRob Herring * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 38724ba675SRob Herring * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 39724ba675SRob Herring * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 40724ba675SRob Herring * OTHER DEALINGS IN THE SOFTWARE. 41724ba675SRob Herring */ 42724ba675SRob Herring 43724ba675SRob Herring/dts-v1/; 44724ba675SRob Herring#include "sun8i-r40.dtsi" 45724ba675SRob Herring#include "sun8i-r40-cpu-opp.dtsi" 46724ba675SRob Herring 47724ba675SRob Herring#include <dt-bindings/gpio/gpio.h> 48724ba675SRob Herring 49724ba675SRob Herring/ { 50724ba675SRob Herring model = "Banana Pi M2 Berry"; 51724ba675SRob Herring compatible = "sinovoip,bpi-m2-berry", "allwinner,sun8i-r40"; 52724ba675SRob Herring 53724ba675SRob Herring aliases { 54724ba675SRob Herring ethernet0 = &gmac; 55724ba675SRob Herring serial0 = &uart0; 56724ba675SRob Herring }; 57724ba675SRob Herring 58724ba675SRob Herring chosen { 59724ba675SRob Herring stdout-path = "serial0:115200n8"; 60724ba675SRob Herring }; 61724ba675SRob Herring 62724ba675SRob Herring connector { 63724ba675SRob Herring compatible = "hdmi-connector"; 64724ba675SRob Herring type = "a"; 65724ba675SRob Herring 66724ba675SRob Herring port { 67724ba675SRob Herring hdmi_con_in: endpoint { 68724ba675SRob Herring remote-endpoint = <&hdmi_out_con>; 69724ba675SRob Herring }; 70724ba675SRob Herring }; 71724ba675SRob Herring }; 72724ba675SRob Herring 73724ba675SRob Herring leds { 74724ba675SRob Herring compatible = "gpio-leds"; 75724ba675SRob Herring 76724ba675SRob Herring pwr-led { 77724ba675SRob Herring label = "bananapi:red:pwr"; 78724ba675SRob Herring gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>; 79724ba675SRob Herring default-state = "on"; 80724ba675SRob Herring }; 81724ba675SRob Herring 82724ba675SRob Herring user-led { 83724ba675SRob Herring label = "bananapi:green:user"; 84724ba675SRob Herring gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>; 85724ba675SRob Herring }; 86724ba675SRob Herring }; 87724ba675SRob Herring 88724ba675SRob Herring reg_vcc5v0: vcc5v0 { 89724ba675SRob Herring compatible = "regulator-fixed"; 90724ba675SRob Herring regulator-name = "vcc5v0"; 91724ba675SRob Herring regulator-min-microvolt = <5000000>; 92724ba675SRob Herring regulator-max-microvolt = <5000000>; 93724ba675SRob Herring gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */ 94724ba675SRob Herring enable-active-high; 95724ba675SRob Herring }; 96724ba675SRob Herring 97*0f47ef3fSKrzysztof Kozlowski wifi_pwrseq: pwrseq { 98724ba675SRob Herring compatible = "mmc-pwrseq-simple"; 99724ba675SRob Herring reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 WIFI_EN */ 100724ba675SRob Herring clocks = <&ccu CLK_OUTA>; 101724ba675SRob Herring clock-names = "ext_clock"; 102724ba675SRob Herring }; 103724ba675SRob Herring}; 104724ba675SRob Herring 105724ba675SRob Herring&ahci { 106724ba675SRob Herring ahci-supply = <®_dldo4>; 107724ba675SRob Herring phy-supply = <®_eldo3>; 108724ba675SRob Herring status = "okay"; 109724ba675SRob Herring}; 110724ba675SRob Herring 111724ba675SRob Herring&cpu0 { 112724ba675SRob Herring cpu-supply = <®_dcdc2>; 113724ba675SRob Herring}; 114724ba675SRob Herring 115724ba675SRob Herring&de { 116724ba675SRob Herring status = "okay"; 117724ba675SRob Herring}; 118724ba675SRob Herring 119724ba675SRob Herring&ehci1 { 120724ba675SRob Herring /* Terminus Tech FE 1.1s 4-port USB 2.0 hub here */ 121724ba675SRob Herring status = "okay"; 122724ba675SRob Herring}; 123724ba675SRob Herring 124724ba675SRob Herring&gmac { 125724ba675SRob Herring pinctrl-names = "default"; 126724ba675SRob Herring pinctrl-0 = <&gmac_rgmii_pins>; 127724ba675SRob Herring phy-handle = <&phy1>; 128724ba675SRob Herring phy-mode = "rgmii-id"; 129724ba675SRob Herring phy-supply = <®_dc1sw>; 130724ba675SRob Herring status = "okay"; 131724ba675SRob Herring}; 132724ba675SRob Herring 133724ba675SRob Herring&gmac_mdio { 134724ba675SRob Herring phy1: ethernet-phy@1 { 135724ba675SRob Herring compatible = "ethernet-phy-ieee802.3-c22"; 136724ba675SRob Herring reg = <1>; 137724ba675SRob Herring }; 138724ba675SRob Herring}; 139724ba675SRob Herring 140724ba675SRob Herring&hdmi { 141724ba675SRob Herring status = "okay"; 142724ba675SRob Herring}; 143724ba675SRob Herring 144724ba675SRob Herring&hdmi_out { 145724ba675SRob Herring hdmi_out_con: endpoint { 146724ba675SRob Herring remote-endpoint = <&hdmi_con_in>; 147724ba675SRob Herring }; 148724ba675SRob Herring}; 149724ba675SRob Herring 150724ba675SRob Herring&i2c0 { 151724ba675SRob Herring status = "okay"; 152724ba675SRob Herring 153724ba675SRob Herring axp22x: pmic@34 { 154724ba675SRob Herring compatible = "x-powers,axp221"; 155724ba675SRob Herring reg = <0x34>; 156724ba675SRob Herring interrupt-parent = <&nmi_intc>; 157724ba675SRob Herring interrupts = <0 IRQ_TYPE_LEVEL_LOW>; 158724ba675SRob Herring }; 159724ba675SRob Herring}; 160724ba675SRob Herring 161724ba675SRob Herring#include "axp22x.dtsi" 162724ba675SRob Herring 163724ba675SRob Herring&mmc0 { 164724ba675SRob Herring vmmc-supply = <®_dcdc1>; 165724ba675SRob Herring bus-width = <4>; 166724ba675SRob Herring cd-gpios = <&pio 7 13 GPIO_ACTIVE_LOW>; /* PH13 */ 167724ba675SRob Herring status = "okay"; 168724ba675SRob Herring}; 169724ba675SRob Herring 170724ba675SRob Herring&mmc1 { 171724ba675SRob Herring pinctrl-names = "default"; 172724ba675SRob Herring pinctrl-0 = <&mmc1_pg_pins>; 173724ba675SRob Herring vmmc-supply = <®_dldo2>; 174724ba675SRob Herring vqmmc-supply = <®_dldo1>; 175724ba675SRob Herring mmc-pwrseq = <&wifi_pwrseq>; 176724ba675SRob Herring bus-width = <4>; 177724ba675SRob Herring non-removable; 178724ba675SRob Herring status = "okay"; 179724ba675SRob Herring}; 180724ba675SRob Herring 181724ba675SRob Herring&pio { 182724ba675SRob Herring pinctrl-names = "default"; 183724ba675SRob Herring pinctrl-0 = <&clk_out_a_pin>; 184724ba675SRob Herring vcc-pa-supply = <®_aldo2>; 185724ba675SRob Herring vcc-pc-supply = <®_dcdc1>; 186724ba675SRob Herring vcc-pd-supply = <®_dcdc1>; 187724ba675SRob Herring vcc-pe-supply = <®_eldo1>; 188724ba675SRob Herring vcc-pf-supply = <®_dcdc1>; 189724ba675SRob Herring vcc-pg-supply = <®_dldo1>; 190724ba675SRob Herring}; 191724ba675SRob Herring 192724ba675SRob Herring®_aldo2 { 193724ba675SRob Herring regulator-min-microvolt = <2500000>; 194724ba675SRob Herring regulator-max-microvolt = <2500000>; 195724ba675SRob Herring regulator-name = "vcc-pa"; 196724ba675SRob Herring}; 197724ba675SRob Herring 198724ba675SRob Herring®_aldo3 { 199724ba675SRob Herring regulator-always-on; 200724ba675SRob Herring regulator-min-microvolt = <2700000>; 201724ba675SRob Herring regulator-max-microvolt = <3300000>; 202724ba675SRob Herring regulator-name = "avcc"; 203724ba675SRob Herring}; 204724ba675SRob Herring 205724ba675SRob Herring®_dc1sw { 206724ba675SRob Herring regulator-min-microvolt = <3300000>; 207724ba675SRob Herring regulator-max-microvolt = <3300000>; 208724ba675SRob Herring regulator-name = "vcc-gmac-phy"; 209724ba675SRob Herring}; 210724ba675SRob Herring 211724ba675SRob Herring®_dcdc1 { 212724ba675SRob Herring regulator-always-on; 213724ba675SRob Herring regulator-min-microvolt = <3300000>; 214724ba675SRob Herring regulator-max-microvolt = <3300000>; 215724ba675SRob Herring regulator-name = "vcc-3v3"; 216724ba675SRob Herring}; 217724ba675SRob Herring 218724ba675SRob Herring®_dcdc2 { 219724ba675SRob Herring regulator-always-on; 220724ba675SRob Herring regulator-min-microvolt = <1000000>; 221724ba675SRob Herring regulator-max-microvolt = <1300000>; 222724ba675SRob Herring regulator-name = "vdd-cpu"; 223724ba675SRob Herring}; 224724ba675SRob Herring 225724ba675SRob Herring®_dcdc3 { 226724ba675SRob Herring regulator-always-on; 227724ba675SRob Herring regulator-min-microvolt = <1000000>; 228724ba675SRob Herring regulator-max-microvolt = <1300000>; 229724ba675SRob Herring regulator-name = "vdd-sys"; 230724ba675SRob Herring}; 231724ba675SRob Herring 232724ba675SRob Herring®_dcdc5 { 233724ba675SRob Herring regulator-always-on; 234724ba675SRob Herring regulator-min-microvolt = <1500000>; 235724ba675SRob Herring regulator-max-microvolt = <1500000>; 236724ba675SRob Herring regulator-name = "vcc-dram"; 237724ba675SRob Herring}; 238724ba675SRob Herring 239724ba675SRob Herring®_dldo1 { 240724ba675SRob Herring regulator-min-microvolt = <1800000>; 241724ba675SRob Herring regulator-max-microvolt = <3300000>; 242724ba675SRob Herring regulator-name = "vcc-wifi-io"; 243724ba675SRob Herring}; 244724ba675SRob Herring 245724ba675SRob Herring/* 246724ba675SRob Herring * Our WiFi chip needs both DLDO2 and DLDO3 to be powered at the same 247724ba675SRob Herring * time, with the two being in sync, to be able to meet maximum power 248724ba675SRob Herring * consumption during transmits. Since this is not really supported 249724ba675SRob Herring * right now, just use the two as always on, and we will fix it later. 250724ba675SRob Herring */ 251724ba675SRob Herring 252724ba675SRob Herring®_dldo2 { 253724ba675SRob Herring regulator-always-on; 254724ba675SRob Herring regulator-min-microvolt = <3300000>; 255724ba675SRob Herring regulator-max-microvolt = <3300000>; 256724ba675SRob Herring regulator-name = "vcc-wifi"; 257724ba675SRob Herring}; 258724ba675SRob Herring 259724ba675SRob Herring®_dldo3 { 260724ba675SRob Herring regulator-always-on; 261724ba675SRob Herring regulator-min-microvolt = <3300000>; 262724ba675SRob Herring regulator-max-microvolt = <3300000>; 263724ba675SRob Herring regulator-name = "vcc-wifi-2"; 264724ba675SRob Herring}; 265724ba675SRob Herring 266724ba675SRob Herring®_dldo4 { 267724ba675SRob Herring regulator-min-microvolt = <2500000>; 268724ba675SRob Herring regulator-max-microvolt = <2500000>; 269724ba675SRob Herring regulator-name = "vdd2v5-sata"; 270724ba675SRob Herring}; 271724ba675SRob Herring 272724ba675SRob Herring®_eldo3 { 273724ba675SRob Herring regulator-min-microvolt = <1200000>; 274724ba675SRob Herring regulator-max-microvolt = <1200000>; 275724ba675SRob Herring regulator-name = "vdd1v2-sata"; 276724ba675SRob Herring}; 277724ba675SRob Herring 278724ba675SRob Herring&tcon_tv0 { 279724ba675SRob Herring status = "okay"; 280724ba675SRob Herring}; 281724ba675SRob Herring 282724ba675SRob Herring&uart0 { 283724ba675SRob Herring pinctrl-names = "default"; 284724ba675SRob Herring pinctrl-0 = <&uart0_pb_pins>; 285724ba675SRob Herring status = "okay"; 286724ba675SRob Herring}; 287724ba675SRob Herring 288724ba675SRob Herring&uart3 { 289724ba675SRob Herring pinctrl-names = "default"; 290724ba675SRob Herring pinctrl-0 = <&uart3_pg_pins>, <&uart3_rts_cts_pg_pins>; 291724ba675SRob Herring uart-has-rtscts; 292724ba675SRob Herring status = "okay"; 293724ba675SRob Herring 294724ba675SRob Herring bluetooth { 295724ba675SRob Herring compatible = "brcm,bcm43438-bt"; 296724ba675SRob Herring clocks = <&ccu CLK_OUTA>; 297724ba675SRob Herring clock-names = "lpo"; 298724ba675SRob Herring vbat-supply = <®_dldo2>; 299724ba675SRob Herring vddio-supply = <®_dldo1>; 300724ba675SRob Herring device-wakeup-gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */ 301724ba675SRob Herring /* TODO host wake line connected to PMIC GPIO pins */ 302724ba675SRob Herring shutdown-gpios = <&pio 7 12 GPIO_ACTIVE_HIGH>; /* PH12 */ 303724ba675SRob Herring max-speed = <1500000>; 304724ba675SRob Herring }; 305724ba675SRob Herring}; 306724ba675SRob Herring 307724ba675SRob Herring&usbphy { 308724ba675SRob Herring usb1_vbus-supply = <®_vcc5v0>; 309724ba675SRob Herring status = "okay"; 310724ba675SRob Herring}; 311