Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright (C) 2016 Chen-Yu Tsai <wens@csie.org>
0003  *
0004  * This file is dual-licensed: you can use it either under the terms
0005  * of the GPL or the X11 license, at your option. Note that this dual
0006  * licensing only applies to this file, and not this project as a
0007  * whole.
0008  *
0009  *  a) This file is free software; you can redistribute it and/or
0010  *     modify it under the terms of the GNU General Public License as
0011  *     published by the Free Software Foundation; either version 2 of the
0012  *     License, or (at your option) any later version.
0013  *
0014  *     This file is distributed in the hope that it will be useful,
0015  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
0016  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0017  *     GNU General Public License for more details.
0018  *
0019  * Or, alternatively,
0020  *
0021  *  b) Permission is hereby granted, free of charge, to any person
0022  *     obtaining a copy of this software and associated documentation
0023  *     files (the "Software"), to deal in the Software without
0024  *     restriction, including without limitation the rights to use,
0025  *     copy, modify, merge, publish, distribute, sublicense, and/or
0026  *     sell copies of the Software, and to permit persons to whom the
0027  *     Software is furnished to do so, subject to the following
0028  *     conditions:
0029  *
0030  *     The above copyright notice and this permission notice shall be
0031  *     included in all copies or substantial portions of the Software.
0032  *
0033  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0034  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
0035  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0036  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
0037  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
0038  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
0039  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0040  *     OTHER DEALINGS IN THE SOFTWARE.
0041  */
0042 
0043 #include "sunxi-common-regulators.dtsi"
0044 
0045 #include <dt-bindings/gpio/gpio.h>
0046 #include <dt-bindings/input/input.h>
0047 
0048 / {
0049         aliases {
0050                 ethernet0 = &emac;
0051                 serial0 = &uart0;
0052                 serial1 = &uart1;
0053         };
0054 
0055         chosen {
0056                 stdout-path = "serial0:115200n8";
0057         };
0058 
0059         connector {
0060                 compatible = "hdmi-connector";
0061                 type = "a";
0062 
0063                 port {
0064                         hdmi_con_in: endpoint {
0065                                 remote-endpoint = <&hdmi_out_con>;
0066                         };
0067                 };
0068         };
0069 
0070         leds {
0071                 compatible = "gpio-leds";
0072 
0073                 pwr_led {
0074                         label = "bananapi-m2-plus:red:pwr";
0075                         gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */
0076                         default-state = "on";
0077                 };
0078         };
0079 
0080         gpio-keys {
0081                 compatible = "gpio-keys";
0082 
0083                 switch-4 {
0084                         label = "power";
0085                         linux,code = <KEY_POWER>;
0086                         gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
0087                         wakeup-source;
0088                 };
0089         };
0090 
0091         reg_gmac_3v3: gmac-3v3 {
0092                       compatible = "regulator-fixed";
0093                       regulator-name = "gmac-3v3";
0094                       regulator-min-microvolt = <3300000>;
0095                       regulator-max-microvolt = <3300000>;
0096                       startup-delay-us = <100000>;
0097                       enable-active-high;
0098                       gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>;
0099         };
0100 
0101         wifi_pwrseq: wifi_pwrseq {
0102                 compatible = "mmc-pwrseq-simple";
0103                 reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
0104                 clocks = <&rtc CLK_OSC32K_FANOUT>;
0105                 clock-names = "ext_clock";
0106         };
0107 };
0108 
0109 &de {
0110         status = "okay";
0111 };
0112 
0113 &ehci0 {
0114         status = "okay";
0115 };
0116 
0117 &ehci1 {
0118         status = "okay";
0119 };
0120 
0121 &ehci2 {
0122         status = "okay";
0123 };
0124 
0125 &emac {
0126         pinctrl-names = "default";
0127         pinctrl-0 = <&emac_rgmii_pins>;
0128         phy-supply = <&reg_gmac_3v3>;
0129         phy-handle = <&ext_rgmii_phy>;
0130         phy-mode = "rgmii-id";
0131 
0132         status = "okay";
0133 };
0134 
0135 &external_mdio {
0136         ext_rgmii_phy: ethernet-phy@1 {
0137                 compatible = "ethernet-phy-ieee802.3-c22";
0138                 reg = <1>;
0139         };
0140 };
0141 
0142 &hdmi {
0143         status = "okay";
0144 };
0145 
0146 &hdmi_out {
0147         hdmi_out_con: endpoint {
0148                 remote-endpoint = <&hdmi_con_in>;
0149         };
0150 };
0151 
0152 &ir {
0153         pinctrl-names = "default";
0154         pinctrl-0 = <&r_ir_rx_pin>;
0155         status = "okay";
0156 };
0157 
0158 &mmc0 {
0159         vmmc-supply = <&reg_vcc3v3>;
0160         bus-width = <4>;
0161         cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
0162         status = "okay";
0163 };
0164 
0165 &mmc1 {
0166         vmmc-supply = <&reg_vcc3v3>;
0167         vqmmc-supply = <&reg_vcc3v3>;
0168         mmc-pwrseq = <&wifi_pwrseq>;
0169         bus-width = <4>;
0170         non-removable;
0171         status = "okay";
0172 
0173         brcmf: wifi@1 {
0174                 reg = <1>;
0175                 compatible = "brcm,bcm4329-fmac";
0176                 interrupt-parent = <&pio>;
0177                 interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */
0178                 interrupt-names = "host-wake";
0179         };
0180 };
0181 
0182 &mmc2 {
0183         pinctrl-names = "default";
0184         pinctrl-0 = <&mmc2_8bit_pins>;
0185         vmmc-supply = <&reg_vcc3v3>;
0186         vqmmc-supply = <&reg_vcc3v3>;
0187         bus-width = <8>;
0188         non-removable;
0189         status = "okay";
0190 };
0191 
0192 &ohci0 {
0193         status = "okay";
0194 };
0195 
0196 &ohci1 {
0197         status = "okay";
0198 };
0199 
0200 &ohci2 {
0201         status = "okay";
0202 };
0203 
0204 &reg_usb0_vbus {
0205         gpio = <&pio 3 11 GPIO_ACTIVE_HIGH>; /* PD11 */
0206         status = "okay";
0207 };
0208 
0209 &uart0 {
0210         pinctrl-names = "default";
0211         pinctrl-0 = <&uart0_pa_pins>;
0212         status = "okay";
0213 };
0214 
0215 &uart1 {
0216         pinctrl-names = "default";
0217         pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
0218         uart-has-rtscts;
0219         status = "okay";
0220 
0221         bluetooth {
0222                 compatible = "brcm,bcm43438-bt";
0223                 max-speed = <1500000>;
0224                 clocks = <&rtc CLK_OSC32K_FANOUT>;
0225                 clock-names = "lpo";
0226                 vbat-supply = <&reg_vcc3v3>;
0227                 vddio-supply = <&reg_vcc3v3>;
0228                 device-wakeup-gpios = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */
0229                 host-wakeup-gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */
0230                 shutdown-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
0231         };
0232 };
0233 
0234 &usb_otg {
0235         dr_mode = "otg";
0236         status = "okay";
0237 };
0238 
0239 &usbphy {
0240         usb0_id_det-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */
0241         usb0_vbus-supply = <&reg_usb0_vbus>;
0242         /* USB host VBUS is on as long as VCC-IO is on */
0243         status = "okay";
0244 };