Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright (C) 2016 Hans de Goede <hdegoede@redhat.com>
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 /dts-v1/;
0044 #include "sun8i-h3.dtsi"
0045 #include "sunxi-common-regulators.dtsi"
0046 
0047 #include <dt-bindings/gpio/gpio.h>
0048 #include <dt-bindings/input/input.h>
0049 
0050 / {
0051         model = "Xunlong Orange Pi 2";
0052         compatible = "xunlong,orangepi-2", "allwinner,sun8i-h3";
0053 
0054         aliases {
0055                 serial0 = &uart0;
0056                 /* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */
0057                 ethernet0 = &emac;
0058                 ethernet1 = &rtl8189;
0059         };
0060 
0061         chosen {
0062                 stdout-path = "serial0:115200n8";
0063         };
0064 
0065         connector {
0066                 compatible = "hdmi-connector";
0067                 type = "a";
0068 
0069                 port {
0070                         hdmi_con_in: endpoint {
0071                                 remote-endpoint = <&hdmi_out_con>;
0072                         };
0073                 };
0074         };
0075 
0076         leds {
0077                 compatible = "gpio-leds";
0078 
0079                 status_led {
0080                         label = "orangepi:red:status";
0081                         gpios = <&pio 0 15 GPIO_ACTIVE_HIGH>;
0082                 };
0083 
0084                 pwr_led {
0085                         label = "orangepi:green:pwr";
0086                         gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
0087                         default-state = "on";
0088                 };
0089         };
0090 
0091         gpio-keys {
0092                 compatible = "gpio-keys";
0093 
0094                 switch-2 {
0095                         label = "sw2";
0096                         linux,code = <BTN_1>;
0097                         gpios = <&r_pio 0 4 GPIO_ACTIVE_LOW>;
0098                 };
0099 
0100                 switch-4 {
0101                         label = "sw4";
0102                         linux,code = <KEY_POWER>;
0103                         gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
0104                         wakeup-source;
0105                 };
0106         };
0107 
0108         wifi_pwrseq: wifi_pwrseq {
0109                 compatible = "mmc-pwrseq-simple";
0110                 reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 WIFI_EN */
0111         };
0112 };
0113 
0114 &codec {
0115         allwinner,pa-gpios = <&pio 0 16 GPIO_ACTIVE_HIGH>; /* PA16 */
0116         allwinner,audio-routing =
0117                 "Speaker", "LINEOUT",
0118                 "MIC1", "Mic",
0119                 "Mic",  "MBIAS";
0120         status = "okay";
0121 };
0122 
0123 &de {
0124         status = "okay";
0125 };
0126 
0127 &ehci1 {
0128         status = "okay";
0129 };
0130 
0131 &emac {
0132         phy-handle = <&int_mii_phy>;
0133         phy-mode = "mii";
0134         allwinner,leds-active-low;
0135         status = "okay";
0136 };
0137 
0138 &hdmi {
0139         status = "okay";
0140 };
0141 
0142 &hdmi_out {
0143         hdmi_out_con: endpoint {
0144                 remote-endpoint = <&hdmi_con_in>;
0145         };
0146 };
0147 
0148 &ir {
0149         pinctrl-names = "default";
0150         pinctrl-0 = <&r_ir_rx_pin>;
0151         status = "okay";
0152 };
0153 
0154 &mmc0 {
0155         vmmc-supply = <&reg_vcc3v3>;
0156         bus-width = <4>;
0157         cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
0158         status = "okay";
0159 };
0160 
0161 &mmc1 {
0162         vmmc-supply = <&reg_vcc3v3>;
0163         mmc-pwrseq = <&wifi_pwrseq>;
0164         bus-width = <4>;
0165         non-removable;
0166         status = "okay";
0167 
0168         /*
0169          * Explicitly define the sdio device, so that we can add an ethernet
0170          * alias for it (which e.g. makes u-boot set a mac-address).
0171          */
0172         rtl8189: sdio_wifi@1 {
0173                 reg = <1>;
0174         };
0175 };
0176 
0177 &reg_usb1_vbus {
0178         gpio = <&pio 6 13 GPIO_ACTIVE_HIGH>;
0179         status = "okay";
0180 };
0181 
0182 &uart0 {
0183         pinctrl-names = "default";
0184         pinctrl-0 = <&uart0_pa_pins>;
0185         status = "okay";
0186 };
0187 
0188 &uart1 {
0189         pinctrl-names = "default";
0190         pinctrl-0 = <&uart1_pins>;
0191         status = "disabled";
0192 };
0193 
0194 &uart2 {
0195         pinctrl-names = "default";
0196         pinctrl-0 = <&uart2_pins>;
0197         status = "disabled";
0198 };
0199 
0200 &uart3 {
0201         pinctrl-names = "default";
0202         pinctrl-0 = <&uart3_pins>;
0203         status = "disabled";
0204 };
0205 
0206 &usbphy {
0207         usb1_vbus-supply = <&reg_usb1_vbus>;
0208         status = "okay";
0209 };