Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
0003  *
0004  * Hans de Goede <hdegoede@redhat.com>
0005  *
0006  * This file is dual-licensed: you can use it either under the terms
0007  * of the GPL or the X11 license, at your option. Note that this dual
0008  * licensing only applies to this file, and not this project as a
0009  * whole.
0010  *
0011  *  a) This file is free software; you can redistribute it and/or
0012  *     modify it under the terms of the GNU General Public License as
0013  *     published by the Free Software Foundation; either version 2 of the
0014  *     License, or (at your option) any later version.
0015  *
0016  *     This file is distributed in the hope that it will be useful,
0017  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
0018  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0019  *     GNU General Public License for more details.
0020  *
0021  * Or, alternatively,
0022  *
0023  *  b) Permission is hereby granted, free of charge, to any person
0024  *     obtaining a copy of this software and associated documentation
0025  *     files (the "Software"), to deal in the Software without
0026  *     restriction, including without limitation the rights to use,
0027  *     copy, modify, merge, publish, distribute, sublicense, and/or
0028  *     sell copies of the Software, and to permit persons to whom the
0029  *     Software is furnished to do so, subject to the following
0030  *     conditions:
0031  *
0032  *     The above copyright notice and this permission notice shall be
0033  *     included in all copies or substantial portions of the Software.
0034  *
0035  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0036  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
0037  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0038  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
0039  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
0040  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
0041  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0042  *     OTHER DEALINGS IN THE SOFTWARE.
0043  */
0044 
0045 /dts-v1/;
0046 #include "sun7i-a20.dtsi"
0047 #include "sunxi-common-regulators.dtsi"
0048 
0049 #include <dt-bindings/gpio/gpio.h>
0050 #include <dt-bindings/interrupt-controller/irq.h>
0051 
0052 / {
0053         model = "Orange Pi";
0054         compatible = "xunlong,orangepi", "allwinner,sun7i-a20";
0055 
0056         aliases {
0057                 serial0 = &uart0;
0058         };
0059 
0060         chosen {
0061                 stdout-path = "serial0:115200n8";
0062         };
0063 
0064         leds {
0065                 compatible = "gpio-leds";
0066 
0067                 led {
0068                         label = "orangepi:green:usr";
0069                         gpios = <&pio 7 24 GPIO_ACTIVE_HIGH>; /* PH24 */
0070                 };
0071         };
0072 
0073         reg_gmac_3v3: gmac-3v3 {
0074                 compatible = "regulator-fixed";
0075                 regulator-name = "gmac-3v3";
0076                 regulator-min-microvolt = <3300000>;
0077                 regulator-max-microvolt = <3300000>;
0078                 startup-delay-us = <100000>;
0079                 enable-active-high;
0080                 gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */
0081         };
0082 };
0083 
0084 &ahci {
0085         status = "okay";
0086 };
0087 
0088 &ehci0 {
0089         status = "okay";
0090 };
0091 
0092 &ehci1 {
0093         status = "okay";
0094 };
0095 
0096 &gmac {
0097         pinctrl-names = "default";
0098         pinctrl-0 = <&gmac_rgmii_pins>;
0099         phy-handle = <&phy1>;
0100         phy-mode = "rgmii";
0101         phy-supply = <&reg_gmac_3v3>;
0102         status = "okay";
0103 };
0104 
0105 &i2c0 {
0106         status = "okay";
0107 
0108         axp209: pmic@34 {
0109                 reg = <0x34>;
0110                 interrupt-parent = <&nmi_intc>;
0111                 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
0112         };
0113 };
0114 
0115 #include "axp209.dtsi"
0116 
0117 &ir0 {
0118         pinctrl-names = "default";
0119         pinctrl-0 = <&ir0_rx_pin>;
0120         status = "okay";
0121 };
0122 
0123 &gmac_mdio {
0124         phy1: ethernet-phy@1 {
0125                 reg = <1>;
0126         };
0127 };
0128 
0129 &mmc0 {
0130         vmmc-supply = <&reg_vcc3v3>;
0131         bus-width = <4>;
0132         cd-gpios = <&pio 7 10 GPIO_ACTIVE_LOW>; /* PH10 */
0133         status = "okay";
0134 };
0135 
0136 &otg_sram {
0137         status = "okay";
0138 };
0139 
0140 &reg_dcdc2 {
0141         regulator-always-on;
0142         regulator-min-microvolt = <1000000>;
0143         regulator-max-microvolt = <1500000>;
0144         regulator-name = "vdd-cpu";
0145 };
0146 
0147 &reg_dcdc3 {
0148         regulator-always-on;
0149         regulator-min-microvolt = <1000000>;
0150         regulator-max-microvolt = <1400000>;
0151         regulator-name = "vdd-int-pll";
0152 };
0153 
0154 &reg_ldo1 {
0155         regulator-name = "vdd-rtc";
0156 };
0157 
0158 &reg_ldo2 {
0159         regulator-always-on;
0160         regulator-min-microvolt = <3000000>;
0161         regulator-max-microvolt = <3000000>;
0162         regulator-name = "avcc";
0163 };
0164 
0165 &reg_usb0_vbus {
0166         status = "okay";
0167 };
0168 
0169 &reg_usb1_vbus {
0170         gpio = <&pio 7 26 GPIO_ACTIVE_HIGH>; /* PH26 */
0171         status = "okay";
0172 };
0173 
0174 &reg_usb2_vbus {
0175         gpio = <&pio 7 22 GPIO_ACTIVE_HIGH>; /* PH22 */
0176         status = "okay";
0177 };
0178 
0179 &uart0 {
0180         pinctrl-names = "default";
0181         pinctrl-0 = <&uart0_pb_pins>;
0182         status = "okay";
0183 };
0184 
0185 &usb_otg {
0186         dr_mode = "otg";
0187         status = "okay";
0188 };
0189 
0190 &usb_power_supply {
0191         status = "okay";
0192 };
0193 
0194 &usbphy {
0195         usb0_id_det-gpios = <&pio 7 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PH4 */
0196         usb0_vbus_power-supply = <&usb_power_supply>;
0197         usb0_vbus-supply = <&reg_usb0_vbus>;
0198         usb1_vbus-supply = <&reg_usb1_vbus>;
0199         usb2_vbus-supply = <&reg_usb2_vbus>;
0200         status = "okay";
0201 };