Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright 2014 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 = "LeMaker Banana Pi";
0054         compatible = "lemaker,bananapi", "allwinner,sun7i-a20";
0055 
0056         aliases {
0057                 serial0 = &uart0;
0058                 serial1 = &uart3;
0059                 serial2 = &uart7;
0060         };
0061 
0062         chosen {
0063                 stdout-path = "serial0:115200n8";
0064         };
0065 
0066         hdmi-connector {
0067                 compatible = "hdmi-connector";
0068                 type = "a";
0069 
0070                 port {
0071                         hdmi_con_in: endpoint {
0072                                 remote-endpoint = <&hdmi_out_con>;
0073                         };
0074                 };
0075         };
0076 
0077         leds {
0078                 compatible = "gpio-leds";
0079 
0080                 led {
0081                         label = "bananapi:green:usr";
0082                         gpios = <&pio 7 24 GPIO_ACTIVE_HIGH>;
0083                 };
0084         };
0085 
0086         reg_gmac_3v3: gmac-3v3 {
0087                 compatible = "regulator-fixed";
0088                 regulator-name = "gmac-3v3";
0089                 regulator-min-microvolt = <3300000>;
0090                 regulator-max-microvolt = <3300000>;
0091                 startup-delay-us = <100000>;
0092                 enable-active-high;
0093                 gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>;
0094         };
0095 };
0096 
0097 &ahci {
0098         status = "okay";
0099 };
0100 
0101 &codec {
0102         status = "okay";
0103 };
0104 
0105 &cpu0 {
0106         cpu-supply = <&reg_dcdc2>;
0107         operating-points =
0108                 /* kHz    uV */
0109                 <960000 1400000>,
0110                 <912000 1400000>,
0111                 <864000 1350000>,
0112                 <720000 1250000>,
0113                 <528000 1150000>,
0114                 <312000 1100000>,
0115                 <144000 1050000>;
0116 };
0117 
0118 &de {
0119         status = "okay";
0120 };
0121 
0122 &ehci0 {
0123         status = "okay";
0124 };
0125 
0126 &ehci1 {
0127         status = "okay";
0128 };
0129 
0130 &gmac {
0131         pinctrl-names = "default";
0132         pinctrl-0 = <&gmac_rgmii_pins>;
0133         phy-handle = <&phy1>;
0134         phy-mode = "rgmii-id";
0135         phy-supply = <&reg_gmac_3v3>;
0136         status = "okay";
0137 };
0138 
0139 &hdmi {
0140         status = "okay";
0141 };
0142 
0143 &hdmi_out {
0144         hdmi_out_con: endpoint {
0145                 remote-endpoint = <&hdmi_con_in>;
0146         };
0147 };
0148 
0149 &i2c0 {
0150         status = "okay";
0151 
0152         axp209: pmic@34 {
0153                 reg = <0x34>;
0154                 interrupt-parent = <&nmi_intc>;
0155                 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
0156         };
0157 };
0158 
0159 &i2c2 {
0160         status = "okay";
0161 };
0162 
0163 &ir0 {
0164         pinctrl-names = "default";
0165         pinctrl-0 = <&ir0_rx_pin>;
0166         status = "okay";
0167 };
0168 
0169 &gmac_mdio {
0170         phy1: ethernet-phy@1 {
0171                 reg = <1>;
0172         };
0173 };
0174 
0175 &mmc0 {
0176         vmmc-supply = <&reg_vcc3v3>;
0177         bus-width = <4>;
0178         cd-gpios = <&pio 7 10 GPIO_ACTIVE_LOW>; /* PH10 */
0179         status = "okay";
0180 };
0181 
0182 &ohci0 {
0183         status = "okay";
0184 };
0185 
0186 &ohci1 {
0187         status = "okay";
0188 };
0189 
0190 &otg_sram {
0191         status = "okay";
0192 };
0193 
0194 &pio {
0195         vcc-pa-supply = <&reg_vcc3v3>;
0196         vcc-pc-supply = <&reg_vcc3v3>;
0197         vcc-pe-supply = <&reg_vcc3v3>;
0198         vcc-pf-supply = <&reg_vcc3v3>;
0199         vcc-pg-supply = <&reg_vcc3v3>;
0200         gpio-line-names =
0201                 /* PA */
0202                 "ERXD3", "ERXD2", "ERXD1", "ERXD0", "ETXD3",
0203                         "ETXD2", "ETXD1", "ETXD0",
0204                 "ERXCK", "ERXERR", "ERXDV", "EMDC", "EMDIO",
0205                         "ETXEN", "ETXCK", "ECRS",
0206                 "ECOL", "ETXERR", "", "", "", "", "", "",
0207                 "", "", "", "", "", "", "", "",
0208                 /* PB */
0209                 "PMU-SCK", "PMU-SDA", "", "", "", "", "", "",
0210                 "", "USB0-DRV", "", "", "", "", "", "",
0211                 "", "", "", "", "SCL", "SDA", "", "",
0212                 "", "", "", "", "", "", "", "",
0213                 /* PC */
0214                 "", "", "", "", "", "", "", "",
0215                 "", "", "", "", "", "", "", "",
0216                 "", "", "", "", "", "", "", "",
0217                 "", "", "", "", "", "", "", "",
0218                 /* PD */
0219                 "", "", "", "", "", "", "", "",
0220                 "", "", "", "", "", "", "", "",
0221                 "", "", "", "", "", "", "", "",
0222                 "", "", "", "", "", "", "", "",
0223                 /* PE */
0224                 "", "", "", "", "", "", "", "",
0225                 "", "", "", "", "", "", "", "",
0226                 "", "", "", "", "", "", "", "",
0227                 "", "", "", "", "", "", "", "",
0228                 /* PF */
0229                 "SD0-D1", "SD0-D0", "SD0-CLK", "SD0-CMD", "SD0-D3",
0230                         "SD0-D2", "", "",
0231                 "", "", "", "", "", "", "", "",
0232                 "", "", "", "", "", "", "", "",
0233                 "", "", "", "", "", "", "", "",
0234                 /* PG */
0235                 "", "", "", "", "", "", "", "",
0236                 "", "", "", "", "", "", "", "",
0237                 "", "", "", "", "", "", "", "",
0238                 "", "", "", "", "", "", "", "",
0239                 /* PH */
0240                 "TXD0", "RXD0", "IO-1", "PH3", "USB0-IDDET", "PH5", "", "",
0241                 "", "", "SD0-DET", "", "", "", "", "",
0242                 "", "", "", "", "IO-4", "IO-5", "", "EMAC-PWR-EN",
0243                 "LED1", "", "", "", "", "", "", "",
0244                 /* PI */
0245                 "", "", "", "IO-GCLK", "", "", "", "",
0246                 "", "", "SPI-CE0", "SPI-CLK", "SPI-MOSI",
0247                         "SPI-MISO", "SPI-CE1", "",
0248                 "IO-6", "IO-3", "IO-2", "IO-0", "", "", "", "",
0249                 "", "", "", "", "", "", "", "";
0250 };
0251 
0252 #include "axp209.dtsi"
0253 
0254 &reg_dcdc2 {
0255         regulator-always-on;
0256         regulator-min-microvolt = <1000000>;
0257         regulator-max-microvolt = <1400000>;
0258         regulator-name = "vdd-cpu";
0259 };
0260 
0261 &reg_dcdc3 {
0262         regulator-always-on;
0263         regulator-min-microvolt = <1000000>;
0264         regulator-max-microvolt = <1400000>;
0265         regulator-name = "vdd-int-dll";
0266 };
0267 
0268 &reg_ldo1 {
0269         regulator-name = "vdd-rtc";
0270 };
0271 
0272 &reg_ldo2 {
0273         regulator-always-on;
0274         regulator-min-microvolt = <3000000>;
0275         regulator-max-microvolt = <3000000>;
0276         regulator-name = "avcc";
0277 };
0278 
0279 &reg_usb0_vbus {
0280         status = "okay";
0281 };
0282 
0283 &reg_usb1_vbus {
0284         status = "okay";
0285 };
0286 
0287 &reg_usb2_vbus {
0288         status = "okay";
0289 };
0290 
0291 &spi0 {
0292         pinctrl-names = "default";
0293         pinctrl-0 = <&spi0_pi_pins>,
0294                     <&spi0_cs0_pi_pin>,
0295                     <&spi0_cs1_pi_pin>;
0296         status = "okay";
0297 };
0298 
0299 &uart0 {
0300         pinctrl-names = "default";
0301         pinctrl-0 = <&uart0_pb_pins>;
0302         status = "okay";
0303 };
0304 
0305 &uart3 {
0306         pinctrl-names = "default";
0307         pinctrl-0 = <&uart3_ph_pins>;
0308         status = "okay";
0309 };
0310 
0311 &uart7 {
0312         pinctrl-names = "default";
0313         pinctrl-0 = <&uart7_pi_pins>;
0314         status = "okay";
0315 };
0316 
0317 &usb_otg {
0318         dr_mode = "otg";
0319         status = "okay";
0320 };
0321 
0322 &usb_power_supply {
0323         status = "okay";
0324 };
0325 
0326 &usbphy {
0327         usb0_id_det-gpios = <&pio 7 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PH4 */
0328         usb0_vbus_power-supply = <&usb_power_supply>;
0329         usb0_vbus-supply = <&reg_usb0_vbus>;
0330         usb1_vbus-supply = <&reg_usb1_vbus>;
0331         usb2_vbus-supply = <&reg_usb2_vbus>;
0332         status = "okay";
0333 };