0001 /*
0002 * Copyright (C) 2017 Chen-Yu Tsai <wens@csie.org>
0003 * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.io>
0004 *
0005 * This file is dual-licensed: you can use it either under the terms
0006 * of the GPL or the X11 license, at your option. Note that this dual
0007 * licensing only applies to this file, and not this project as a
0008 * whole.
0009 *
0010 * a) This file is free software; you can redistribute it and/or
0011 * modify it under the terms of the GNU General Public License as
0012 * published by the Free Software Foundation; either version 2 of the
0013 * License, or (at your option) any later version.
0014 *
0015 * This file is distributed in the hope that it will be useful,
0016 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0018 * GNU General Public License for more details.
0019 *
0020 * Or, alternatively,
0021 *
0022 * b) Permission is hereby granted, free of charge, to any person
0023 * obtaining a copy of this software and associated documentation
0024 * files (the "Software"), to deal in the Software without
0025 * restriction, including without limitation the rights to use,
0026 * copy, modify, merge, publish, distribute, sublicense, and/or
0027 * sell copies of the Software, and to permit persons to whom the
0028 * Software is furnished to do so, subject to the following
0029 * conditions:
0030 *
0031 * The above copyright notice and this permission notice shall be
0032 * included in all copies or substantial portions of the Software.
0033 *
0034 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0035 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
0036 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0037 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
0038 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
0039 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
0040 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0041 * OTHER DEALINGS IN THE SOFTWARE.
0042 */
0043
0044 /dts-v1/;
0045 #include "sun8i-r40.dtsi"
0046 #include "sun8i-r40-cpu-opp.dtsi"
0047
0048 #include <dt-bindings/gpio/gpio.h>
0049
0050 / {
0051 model = "Banana Pi BPI-M2-Ultra";
0052 compatible = "sinovoip,bpi-m2-ultra", "allwinner,sun8i-r40";
0053
0054 aliases {
0055 ethernet0 = &gmac;
0056 serial0 = &uart0;
0057 };
0058
0059 chosen {
0060 stdout-path = "serial0:115200n8";
0061 };
0062
0063 connector {
0064 compatible = "hdmi-connector";
0065 type = "a";
0066
0067 port {
0068 hdmi_con_in: endpoint {
0069 remote-endpoint = <&hdmi_out_con>;
0070 };
0071 };
0072 };
0073
0074 leds {
0075 compatible = "gpio-leds";
0076
0077 pwr-led {
0078 label = "bananapi:red:pwr";
0079 gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>;
0080 default-state = "on";
0081 };
0082
0083 user-led-green {
0084 label = "bananapi:green:user";
0085 gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>;
0086 };
0087
0088 user-led-blue {
0089 label = "bananapi:blue:user";
0090 gpios = <&pio 7 22 GPIO_ACTIVE_HIGH>;
0091 };
0092 };
0093
0094 reg_vcc5v0: vcc5v0 {
0095 compatible = "regulator-fixed";
0096 regulator-name = "vcc5v0";
0097 regulator-min-microvolt = <5000000>;
0098 regulator-max-microvolt = <5000000>;
0099 gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */
0100 enable-active-high;
0101 };
0102
0103 wifi_pwrseq: wifi_pwrseq {
0104 compatible = "mmc-pwrseq-simple";
0105 reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 WIFI_EN */
0106 clocks = <&ccu CLK_OUTA>;
0107 clock-names = "ext_clock";
0108 };
0109 };
0110
0111 &ahci {
0112 ahci-supply = <®_dldo4>;
0113 phy-supply = <®_eldo3>;
0114 status = "okay";
0115 };
0116
0117 &cpu0 {
0118 cpu-supply = <®_dcdc2>;
0119 };
0120
0121 &de {
0122 status = "okay";
0123 };
0124
0125 &ehci1 {
0126 status = "okay";
0127 };
0128
0129 &ehci2 {
0130 status = "okay";
0131 };
0132
0133 &gmac {
0134 pinctrl-names = "default";
0135 pinctrl-0 = <&gmac_rgmii_pins>;
0136 phy-handle = <&phy1>;
0137 phy-mode = "rgmii-id";
0138 phy-supply = <®_dc1sw>;
0139 status = "okay";
0140 };
0141
0142 &gmac_mdio {
0143 phy1: ethernet-phy@1 {
0144 compatible = "ethernet-phy-ieee802.3-c22";
0145 reg = <1>;
0146 };
0147 };
0148
0149 &hdmi {
0150 status = "okay";
0151 };
0152
0153 &hdmi_out {
0154 hdmi_out_con: endpoint {
0155 remote-endpoint = <&hdmi_con_in>;
0156 };
0157 };
0158
0159 &i2c0 {
0160 status = "okay";
0161
0162 axp22x: pmic@34 {
0163 compatible = "x-powers,axp221";
0164 reg = <0x34>;
0165 interrupt-parent = <&nmi_intc>;
0166 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
0167 };
0168 };
0169
0170 #include "axp22x.dtsi"
0171
0172 &ir0 {
0173 status = "okay";
0174 };
0175
0176 &mmc0 {
0177 vmmc-supply = <®_dcdc1>;
0178 bus-width = <4>;
0179 cd-gpios = <&pio 7 13 GPIO_ACTIVE_LOW>; /* PH13 */
0180 status = "okay";
0181 };
0182
0183 &mmc1 {
0184 pinctrl-names = "default";
0185 pinctrl-0 = <&mmc1_pg_pins>;
0186 vmmc-supply = <®_dldo2>;
0187 vqmmc-supply = <®_dldo1>;
0188 mmc-pwrseq = <&wifi_pwrseq>;
0189 bus-width = <4>;
0190 non-removable;
0191 status = "okay";
0192 };
0193
0194 &mmc2 {
0195 vmmc-supply = <®_dcdc1>;
0196 vqmmc-supply = <®_dcdc1>;
0197 bus-width = <8>;
0198 non-removable;
0199 status = "okay";
0200 };
0201
0202 &ohci1 {
0203 status = "okay";
0204 };
0205
0206 &ohci2 {
0207 status = "okay";
0208 };
0209
0210 &pio {
0211 pinctrl-names = "default";
0212 pinctrl-0 = <&clk_out_a_pin>;
0213 vcc-pa-supply = <®_aldo2>;
0214 vcc-pc-supply = <®_dcdc1>;
0215 vcc-pd-supply = <®_dcdc1>;
0216 vcc-pe-supply = <®_eldo1>;
0217 vcc-pf-supply = <®_dcdc1>;
0218 vcc-pg-supply = <®_dldo1>;
0219 };
0220
0221 ®_aldo2 {
0222 regulator-min-microvolt = <2500000>;
0223 regulator-max-microvolt = <2500000>;
0224 regulator-name = "vcc-pa";
0225 };
0226
0227 ®_aldo3 {
0228 regulator-always-on;
0229 regulator-min-microvolt = <2700000>;
0230 regulator-max-microvolt = <3300000>;
0231 regulator-name = "avcc";
0232 };
0233
0234 ®_dc1sw {
0235 regulator-min-microvolt = <3300000>;
0236 regulator-max-microvolt = <3300000>;
0237 regulator-name = "vcc-gmac-phy";
0238 };
0239
0240 ®_dcdc1 {
0241 regulator-always-on;
0242 regulator-min-microvolt = <3300000>;
0243 regulator-max-microvolt = <3300000>;
0244 regulator-name = "vcc-3v3";
0245 };
0246
0247 ®_dcdc2 {
0248 regulator-always-on;
0249 regulator-min-microvolt = <1000000>;
0250 regulator-max-microvolt = <1300000>;
0251 regulator-name = "vdd-cpu";
0252 };
0253
0254 ®_dcdc3 {
0255 regulator-always-on;
0256 regulator-min-microvolt = <1000000>;
0257 regulator-max-microvolt = <1300000>;
0258 regulator-name = "vdd-sys";
0259 };
0260
0261 ®_dcdc5 {
0262 regulator-always-on;
0263 regulator-min-microvolt = <1500000>;
0264 regulator-max-microvolt = <1500000>;
0265 regulator-name = "vcc-dram";
0266 };
0267
0268 ®_dldo1 {
0269 regulator-min-microvolt = <1800000>;
0270 regulator-max-microvolt = <3300000>;
0271 regulator-name = "vcc-wifi-io";
0272 };
0273
0274 /*
0275 * Our WiFi chip needs both DLDO2 and DLDO3 to be powered at the same
0276 * time, with the two being in sync, to be able to meet maximum power
0277 * consumption during transmits. Since this is not really supported
0278 * right now, just use the two as always on, and we will fix it later.
0279 */
0280
0281 ®_dldo2 {
0282 regulator-always-on;
0283 regulator-min-microvolt = <3300000>;
0284 regulator-max-microvolt = <3300000>;
0285 regulator-name = "vcc-wifi";
0286 };
0287
0288 ®_dldo3 {
0289 regulator-always-on;
0290 regulator-min-microvolt = <3300000>;
0291 regulator-max-microvolt = <3300000>;
0292 regulator-name = "vcc-wifi-2";
0293 };
0294
0295 ®_dldo4 {
0296 regulator-min-microvolt = <2500000>;
0297 regulator-max-microvolt = <2500000>;
0298 regulator-name = "vdd2v5-sata";
0299 };
0300
0301 ®_eldo3 {
0302 regulator-min-microvolt = <1200000>;
0303 regulator-max-microvolt = <1200000>;
0304 regulator-name = "vdd1v2-sata";
0305 };
0306
0307 &tcon_tv0 {
0308 status = "okay";
0309 };
0310
0311 &uart0 {
0312 pinctrl-names = "default";
0313 pinctrl-0 = <&uart0_pb_pins>;
0314 status = "okay";
0315 };
0316
0317 &uart3 {
0318 pinctrl-names = "default";
0319 pinctrl-0 = <&uart3_pg_pins>, <&uart3_rts_cts_pg_pins>;
0320 uart-has-rtscts;
0321 status = "okay";
0322
0323 bluetooth {
0324 compatible = "brcm,bcm43438-bt";
0325 clocks = <&ccu CLK_OUTA>;
0326 clock-names = "lpo";
0327 vbat-supply = <®_dldo2>;
0328 vddio-supply = <®_dldo1>;
0329 device-wakeup-gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */
0330 /* TODO host wake line connected to PMIC GPIO pins */
0331 shutdown-gpios = <&pio 7 12 GPIO_ACTIVE_HIGH>; /* PH12 */
0332 max-speed = <1500000>;
0333 };
0334 };
0335
0336 &usbphy {
0337 usb1_vbus-supply = <®_vcc5v0>;
0338 usb2_vbus-supply = <®_vcc5v0>;
0339 status = "okay";
0340 };