1724ba675SRob Herring/* 2724ba675SRob Herring * Copyright 2017 Chen-Yu Tsai 3724ba675SRob Herring * 4724ba675SRob Herring * Chen-Yu Tsai <wens@csie.org> 5724ba675SRob Herring * 6724ba675SRob Herring * This file is dual-licensed: you can use it either under the terms 7724ba675SRob Herring * of the GPL or the X11 license, at your option. Note that this dual 8724ba675SRob Herring * licensing only applies to this file, and not this project as a 9724ba675SRob Herring * whole. 10724ba675SRob Herring * 11724ba675SRob Herring * a) This file is free software; you can redistribute it and/or 12724ba675SRob Herring * modify it under the terms of the GNU General Public License as 13724ba675SRob Herring * published by the Free Software Foundation; either version 2 of the 14724ba675SRob Herring * License, or (at your option) any later version. 15724ba675SRob Herring * 16724ba675SRob Herring * This file is distributed in the hope that it will be useful, 17724ba675SRob Herring * but WITHOUT ANY WARRANTY; without even the implied warranty of 18724ba675SRob Herring * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19724ba675SRob Herring * GNU General Public License for more details. 20724ba675SRob Herring * 21724ba675SRob Herring * Or, alternatively, 22724ba675SRob Herring * 23724ba675SRob Herring * b) Permission is hereby granted, free of charge, to any person 24724ba675SRob Herring * obtaining a copy of this software and associated documentation 25724ba675SRob Herring * files (the "Software"), to deal in the Software without 26724ba675SRob Herring * restriction, including without limitation the rights to use, 27724ba675SRob Herring * copy, modify, merge, publish, distribute, sublicense, and/or 28724ba675SRob Herring * sell copies of the Software, and to permit persons to whom the 29724ba675SRob Herring * Software is furnished to do so, subject to the following 30724ba675SRob Herring * conditions: 31724ba675SRob Herring * 32724ba675SRob Herring * The above copyright notice and this permission notice shall be 33724ba675SRob Herring * included in all copies or substantial portions of the Software. 34724ba675SRob Herring * 35724ba675SRob Herring * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 36724ba675SRob Herring * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 37724ba675SRob Herring * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 38724ba675SRob Herring * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 39724ba675SRob Herring * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 40724ba675SRob Herring * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 41724ba675SRob Herring * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 42724ba675SRob Herring * OTHER DEALINGS IN THE SOFTWARE. 43724ba675SRob Herring */ 44724ba675SRob Herring 45724ba675SRob Herring/dts-v1/; 46724ba675SRob Herring#include "sun8i-a83t.dtsi" 47724ba675SRob Herring 48724ba675SRob Herring#include <dt-bindings/gpio/gpio.h> 49724ba675SRob Herring 50724ba675SRob Herring/ { 51724ba675SRob Herring model = "Banana Pi BPI-M3"; 52724ba675SRob Herring compatible = "sinovoip,bpi-m3", "allwinner,sun8i-a83t"; 53724ba675SRob Herring 54724ba675SRob Herring aliases { 55724ba675SRob Herring ethernet0 = &emac; 56724ba675SRob Herring serial0 = &uart0; 57724ba675SRob Herring }; 58724ba675SRob Herring 59724ba675SRob Herring chosen { 60724ba675SRob Herring stdout-path = "serial0:115200n8"; 61724ba675SRob Herring }; 62724ba675SRob Herring 63724ba675SRob Herring connector { 64724ba675SRob Herring compatible = "hdmi-connector"; 65724ba675SRob Herring type = "a"; 66724ba675SRob Herring 67724ba675SRob Herring port { 68724ba675SRob Herring hdmi_con_in: endpoint { 69724ba675SRob Herring remote-endpoint = <&hdmi_out_con>; 70724ba675SRob Herring }; 71724ba675SRob Herring }; 72724ba675SRob Herring }; 73724ba675SRob Herring 74724ba675SRob Herring leds { 75724ba675SRob Herring compatible = "gpio-leds"; 76724ba675SRob Herring 77724ba675SRob Herring led-0 { 78724ba675SRob Herring label = "bananapi-m3:blue:usr"; 79724ba675SRob Herring gpios = <&axp_gpio 1 GPIO_ACTIVE_HIGH>; 80724ba675SRob Herring }; 81724ba675SRob Herring 82724ba675SRob Herring led-1 { 83724ba675SRob Herring label = "bananapi-m3:green:usr"; 84724ba675SRob Herring gpios = <&axp_gpio 0 GPIO_ACTIVE_HIGH>; 85724ba675SRob Herring }; 86724ba675SRob Herring }; 87724ba675SRob Herring 88724ba675SRob Herring reg_usb1_vbus: reg-usb1-vbus { 89724ba675SRob Herring compatible = "regulator-fixed"; 90724ba675SRob Herring regulator-name = "usb1-vbus"; 91724ba675SRob Herring regulator-min-microvolt = <5000000>; 92724ba675SRob Herring regulator-max-microvolt = <5000000>; 93724ba675SRob Herring regulator-boot-on; 94724ba675SRob Herring enable-active-high; 95724ba675SRob Herring gpio = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */ 96724ba675SRob Herring }; 97724ba675SRob Herring 98*0f47ef3fSKrzysztof Kozlowski wifi_pwrseq: pwrseq { 99724ba675SRob Herring compatible = "mmc-pwrseq-simple"; 100724ba675SRob Herring clocks = <&ac100_rtc 1>; 101724ba675SRob Herring clock-names = "ext_clock"; 102724ba675SRob Herring /* The WiFi low power clock must be 32768 Hz */ 103724ba675SRob Herring assigned-clocks = <&ac100_rtc 1>; 104724ba675SRob Herring assigned-clock-rates = <32768>; 105724ba675SRob Herring /* enables internal regulator and de-asserts reset */ 106724ba675SRob Herring reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 WL-PMU-EN */ 107724ba675SRob Herring }; 108724ba675SRob Herring 109724ba675SRob Herring /* 110724ba675SRob Herring * Power supply for the SATA disk, behind a USB-SATA bridge. 111724ba675SRob Herring * Since it is a USB device, there is no consumer in the DT, so we 112724ba675SRob Herring * have to keep this always on. 113724ba675SRob Herring */ 114724ba675SRob Herring regulator-sata-disk-pwr { 115724ba675SRob Herring compatible = "regulator-fixed"; 116724ba675SRob Herring regulator-name = "sata-disk-pwr"; 117724ba675SRob Herring regulator-min-microvolt = <5000000>; 118724ba675SRob Herring regulator-max-microvolt = <5000000>; 119724ba675SRob Herring regulator-always-on; 120724ba675SRob Herring enable-active-high; 121724ba675SRob Herring gpio = <&pio 3 25 GPIO_ACTIVE_HIGH>; /* PD25 */ 122724ba675SRob Herring }; 123724ba675SRob Herring}; 124724ba675SRob Herring 125724ba675SRob Herring&cpu0 { 126724ba675SRob Herring cpu-supply = <®_dcdc2>; 127724ba675SRob Herring}; 128724ba675SRob Herring 129724ba675SRob Herring&cpu100 { 130724ba675SRob Herring cpu-supply = <®_dcdc3>; 131724ba675SRob Herring}; 132724ba675SRob Herring 133724ba675SRob Herring&de { 134724ba675SRob Herring status = "okay"; 135724ba675SRob Herring}; 136724ba675SRob Herring 137724ba675SRob Herring&ehci0 { 138724ba675SRob Herring /* Terminus Tech FE 1.1s 4-port USB 2.0 hub here */ 139724ba675SRob Herring status = "okay"; 140724ba675SRob Herring 141724ba675SRob Herring /* TODO GL830 USB-to-SATA bridge downstream w/ GPIO power controls */ 142724ba675SRob Herring}; 143724ba675SRob Herring 144724ba675SRob Herring&emac { 145724ba675SRob Herring pinctrl-names = "default"; 146724ba675SRob Herring pinctrl-0 = <&emac_rgmii_pins>; 147724ba675SRob Herring phy-supply = <®_sw>; 148724ba675SRob Herring phy-handle = <&rgmii_phy>; 149724ba675SRob Herring phy-mode = "rgmii-id"; 150724ba675SRob Herring allwinner,rx-delay-ps = <700>; 151724ba675SRob Herring allwinner,tx-delay-ps = <700>; 152724ba675SRob Herring status = "okay"; 153724ba675SRob Herring}; 154724ba675SRob Herring 155724ba675SRob Herring&hdmi { 156724ba675SRob Herring status = "okay"; 157724ba675SRob Herring}; 158724ba675SRob Herring 159724ba675SRob Herring&hdmi_out { 160724ba675SRob Herring hdmi_out_con: endpoint { 161724ba675SRob Herring remote-endpoint = <&hdmi_con_in>; 162724ba675SRob Herring }; 163724ba675SRob Herring}; 164724ba675SRob Herring 165724ba675SRob Herring&mdio { 166724ba675SRob Herring rgmii_phy: ethernet-phy@1 { 167724ba675SRob Herring compatible = "ethernet-phy-ieee802.3-c22"; 168724ba675SRob Herring reg = <1>; 169724ba675SRob Herring }; 170724ba675SRob Herring}; 171724ba675SRob Herring 172724ba675SRob Herring&mmc0 { 173724ba675SRob Herring pinctrl-names = "default"; 174724ba675SRob Herring pinctrl-0 = <&mmc0_pins>; 175724ba675SRob Herring vmmc-supply = <®_dcdc1>; 176724ba675SRob Herring bus-width = <4>; 177724ba675SRob Herring cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ 178724ba675SRob Herring status = "okay"; 179724ba675SRob Herring}; 180724ba675SRob Herring 181724ba675SRob Herring&mmc1 { 182724ba675SRob Herring vmmc-supply = <®_dldo1>; 183724ba675SRob Herring vqmmc-supply = <®_dldo1>; 184724ba675SRob Herring mmc-pwrseq = <&wifi_pwrseq>; 185724ba675SRob Herring bus-width = <4>; 186724ba675SRob Herring non-removable; 187724ba675SRob Herring status = "okay"; 188724ba675SRob Herring 189724ba675SRob Herring brcmf: wifi@1 { 190724ba675SRob Herring reg = <1>; 191724ba675SRob Herring compatible = "brcm,bcm4329-fmac"; 192724ba675SRob Herring interrupt-parent = <&r_pio>; 193724ba675SRob Herring interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; 194724ba675SRob Herring interrupt-names = "host-wake"; 195724ba675SRob Herring }; 196724ba675SRob Herring}; 197724ba675SRob Herring 198724ba675SRob Herring&mmc2 { 199724ba675SRob Herring pinctrl-names = "default"; 200724ba675SRob Herring pinctrl-0 = <&mmc2_8bit_emmc_pins>; 201724ba675SRob Herring vmmc-supply = <®_dcdc1>; 202724ba675SRob Herring vqmmc-supply = <®_dcdc1>; 203724ba675SRob Herring bus-width = <8>; 204724ba675SRob Herring non-removable; 205724ba675SRob Herring cap-mmc-hw-reset; 206724ba675SRob Herring status = "okay"; 207724ba675SRob Herring}; 208724ba675SRob Herring 209724ba675SRob Herring&r_cir { 210724ba675SRob Herring clock-frequency = <3000000>; 211724ba675SRob Herring status = "okay"; 212724ba675SRob Herring}; 213724ba675SRob Herring 214724ba675SRob Herring&r_rsb { 215724ba675SRob Herring status = "okay"; 216724ba675SRob Herring 217724ba675SRob Herring axp81x: pmic@3a3 { 218724ba675SRob Herring compatible = "x-powers,axp813"; 219724ba675SRob Herring reg = <0x3a3>; 220724ba675SRob Herring interrupt-parent = <&r_intc>; 221724ba675SRob Herring interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>; 222724ba675SRob Herring eldoin-supply = <®_dcdc1>; 223724ba675SRob Herring fldoin-supply = <®_dcdc5>; 224724ba675SRob Herring swin-supply = <®_dcdc1>; 225724ba675SRob Herring x-powers,drive-vbus-en; 226724ba675SRob Herring }; 227724ba675SRob Herring 228724ba675SRob Herring ac100: codec@e89 { 229724ba675SRob Herring compatible = "x-powers,ac100"; 230724ba675SRob Herring reg = <0xe89>; 231724ba675SRob Herring 232724ba675SRob Herring ac100_codec: codec { 233724ba675SRob Herring compatible = "x-powers,ac100-codec"; 234724ba675SRob Herring interrupt-parent = <&r_pio>; 235724ba675SRob Herring interrupts = <0 11 IRQ_TYPE_LEVEL_LOW>; /* PL11 */ 236724ba675SRob Herring #clock-cells = <0>; 237724ba675SRob Herring clock-output-names = "4M_adda"; 238724ba675SRob Herring }; 239724ba675SRob Herring 240724ba675SRob Herring ac100_rtc: rtc { 241724ba675SRob Herring compatible = "x-powers,ac100-rtc"; 242724ba675SRob Herring interrupt-parent = <&r_intc>; 243724ba675SRob Herring interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>; 244724ba675SRob Herring clocks = <&ac100_codec>; 245724ba675SRob Herring #clock-cells = <1>; 246724ba675SRob Herring clock-output-names = "cko1_rtc", 247724ba675SRob Herring "cko2_rtc", 248724ba675SRob Herring "cko3_rtc"; 249724ba675SRob Herring }; 250724ba675SRob Herring }; 251724ba675SRob Herring}; 252724ba675SRob Herring 253724ba675SRob Herring#include "axp81x.dtsi" 254724ba675SRob Herring 255724ba675SRob Herring&ac_power_supply { 256724ba675SRob Herring status = "okay"; 257724ba675SRob Herring}; 258724ba675SRob Herring 259724ba675SRob Herring&battery_power_supply { 260724ba675SRob Herring status = "okay"; 261724ba675SRob Herring}; 262724ba675SRob Herring 263724ba675SRob Herring®_aldo1 { 264724ba675SRob Herring regulator-always-on; 265724ba675SRob Herring regulator-min-microvolt = <1800000>; 266724ba675SRob Herring regulator-max-microvolt = <1800000>; 267724ba675SRob Herring regulator-name = "vcc-1v8"; 268724ba675SRob Herring}; 269724ba675SRob Herring 270724ba675SRob Herring®_aldo2 { 271724ba675SRob Herring regulator-always-on; 272724ba675SRob Herring regulator-min-microvolt = <1800000>; 273724ba675SRob Herring regulator-max-microvolt = <1800000>; 274724ba675SRob Herring regulator-name = "dram-pll"; 275724ba675SRob Herring}; 276724ba675SRob Herring 277724ba675SRob Herring®_aldo3 { 278724ba675SRob Herring regulator-always-on; 279724ba675SRob Herring regulator-min-microvolt = <3000000>; 280724ba675SRob Herring regulator-max-microvolt = <3000000>; 281724ba675SRob Herring regulator-name = "avcc"; 282724ba675SRob Herring}; 283724ba675SRob Herring 284724ba675SRob Herring®_dcdc1 { 285724ba675SRob Herring /* schematics says 3.1V but FEX file says 3.3V */ 286724ba675SRob Herring regulator-always-on; 287724ba675SRob Herring regulator-min-microvolt = <3300000>; 288724ba675SRob Herring regulator-max-microvolt = <3300000>; 289724ba675SRob Herring regulator-name = "vcc-3v3"; 290724ba675SRob Herring}; 291724ba675SRob Herring 292724ba675SRob Herring®_dcdc2 { 293724ba675SRob Herring regulator-always-on; 294724ba675SRob Herring regulator-min-microvolt = <700000>; 295724ba675SRob Herring regulator-max-microvolt = <1100000>; 296724ba675SRob Herring regulator-name = "vdd-cpua"; 297724ba675SRob Herring}; 298724ba675SRob Herring 299724ba675SRob Herring®_dcdc3 { 300724ba675SRob Herring regulator-always-on; 301724ba675SRob Herring regulator-min-microvolt = <700000>; 302724ba675SRob Herring regulator-max-microvolt = <1100000>; 303724ba675SRob Herring regulator-name = "vdd-cpub"; 304724ba675SRob Herring}; 305724ba675SRob Herring 306724ba675SRob Herring®_dcdc4 { 307724ba675SRob Herring regulator-min-microvolt = <700000>; 308724ba675SRob Herring regulator-max-microvolt = <1100000>; 309724ba675SRob Herring regulator-name = "vdd-gpu"; 310724ba675SRob Herring}; 311724ba675SRob Herring 312724ba675SRob Herring®_dcdc5 { 313724ba675SRob Herring regulator-always-on; 314724ba675SRob Herring regulator-min-microvolt = <1200000>; 315724ba675SRob Herring regulator-max-microvolt = <1200000>; 316724ba675SRob Herring regulator-name = "vcc-dram"; 317724ba675SRob Herring}; 318724ba675SRob Herring 319724ba675SRob Herring®_dcdc6 { 320724ba675SRob Herring regulator-always-on; 321724ba675SRob Herring regulator-min-microvolt = <900000>; 322724ba675SRob Herring regulator-max-microvolt = <900000>; 323724ba675SRob Herring regulator-name = "vdd-sys"; 324724ba675SRob Herring}; 325724ba675SRob Herring 326724ba675SRob Herring®_dldo1 { 327724ba675SRob Herring /* 328724ba675SRob Herring * This powers both the WiFi/BT module's main power, I/O supply, 329724ba675SRob Herring * and external pull-ups on all the data lines. It should be set 330724ba675SRob Herring * to the same voltage as the I/O supply (DCDC1 in this case) to 331724ba675SRob Herring * avoid any leakage or mismatch. 332724ba675SRob Herring */ 333724ba675SRob Herring regulator-min-microvolt = <3300000>; 334724ba675SRob Herring regulator-max-microvolt = <3300000>; 335724ba675SRob Herring regulator-name = "vcc-wifi"; 336724ba675SRob Herring}; 337724ba675SRob Herring 338724ba675SRob Herring®_dldo3 { 339724ba675SRob Herring regulator-always-on; 340724ba675SRob Herring regulator-min-microvolt = <3300000>; 341724ba675SRob Herring regulator-max-microvolt = <3300000>; 342724ba675SRob Herring regulator-name = "vcc-pd"; 343724ba675SRob Herring}; 344724ba675SRob Herring 345724ba675SRob Herring®_drivevbus { 346724ba675SRob Herring regulator-name = "usb0-vbus"; 347724ba675SRob Herring status = "okay"; 348724ba675SRob Herring}; 349724ba675SRob Herring 350724ba675SRob Herring®_fldo1 { 351724ba675SRob Herring regulator-min-microvolt = <1080000>; 352724ba675SRob Herring regulator-max-microvolt = <1320000>; 353724ba675SRob Herring regulator-name = "vdd12-hsic"; 354724ba675SRob Herring}; 355724ba675SRob Herring 356724ba675SRob Herring®_fldo2 { 357724ba675SRob Herring /* 358724ba675SRob Herring * Despite the embedded CPUs core not being used in any way, 359724ba675SRob Herring * this must remain on or the system will hang. 360724ba675SRob Herring */ 361724ba675SRob Herring regulator-always-on; 362724ba675SRob Herring regulator-min-microvolt = <700000>; 363724ba675SRob Herring regulator-max-microvolt = <1100000>; 364724ba675SRob Herring regulator-name = "vdd-cpus"; 365724ba675SRob Herring}; 366724ba675SRob Herring 367724ba675SRob Herring®_rtc_ldo { 368724ba675SRob Herring regulator-name = "vcc-rtc"; 369724ba675SRob Herring}; 370724ba675SRob Herring 371724ba675SRob Herring®_sw { 372724ba675SRob Herring /* 373724ba675SRob Herring * The PHY requires 20ms after all voltages 374724ba675SRob Herring * are applied until core logic is ready and 375724ba675SRob Herring * 30ms after the reset pin is de-asserted. 376724ba675SRob Herring * Set a 100ms delay to account for PMIC 377724ba675SRob Herring * ramp time and board traces. 378724ba675SRob Herring */ 379724ba675SRob Herring regulator-enable-ramp-delay = <100000>; 380724ba675SRob Herring regulator-name = "vcc-ephy"; 381724ba675SRob Herring}; 382724ba675SRob Herring 383724ba675SRob Herring&uart0 { 384724ba675SRob Herring pinctrl-names = "default"; 385724ba675SRob Herring pinctrl-0 = <&uart0_pb_pins>; 386724ba675SRob Herring status = "okay"; 387724ba675SRob Herring}; 388724ba675SRob Herring 389724ba675SRob Herring&uart1 { 390724ba675SRob Herring pinctrl-names = "default"; 391724ba675SRob Herring pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>; 392724ba675SRob Herring uart-has-rtscts; 393724ba675SRob Herring status = "okay"; 394724ba675SRob Herring 395724ba675SRob Herring bluetooth { 396724ba675SRob Herring compatible = "brcm,bcm43438-bt"; 397724ba675SRob Herring clocks = <&ac100_rtc 1>; 398724ba675SRob Herring clock-names = "lpo"; 399724ba675SRob Herring vbat-supply = <®_dldo1>; 400724ba675SRob Herring vddio-supply = <®_dldo1>; 401724ba675SRob Herring device-wakeup-gpios = <&pio 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */ 402724ba675SRob Herring host-wakeup-gpios = <&r_pio 0 5 GPIO_ACTIVE_HIGH>; /* PL5 */ 403724ba675SRob Herring shutdown-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */ 404724ba675SRob Herring }; 405724ba675SRob Herring}; 406724ba675SRob Herring 407724ba675SRob Herring&usb_otg { 408724ba675SRob Herring dr_mode = "otg"; 409724ba675SRob Herring status = "okay"; 410724ba675SRob Herring}; 411724ba675SRob Herring 412724ba675SRob Herring&usb_power_supply { 413724ba675SRob Herring status = "okay"; 414724ba675SRob Herring}; 415724ba675SRob Herring 416724ba675SRob Herring&usbphy { 417724ba675SRob Herring usb0_id_det-gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */ 418724ba675SRob Herring usb0_vbus_power-supply = <&usb_power_supply>; 419724ba675SRob Herring usb0_vbus-supply = <®_drivevbus>; 420724ba675SRob Herring usb1_vbus-supply = <®_usb1_vbus>; 421724ba675SRob Herring status = "okay"; 422724ba675SRob Herring}; 423