Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright 2015 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 library 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 library 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 "sun6i-a31s.dtsi"
0045 #include <dt-bindings/gpio/gpio.h>
0046 
0047 / {
0048         model = "Sinovoip BPI-M2";
0049         compatible = "sinovoip,bpi-m2", "allwinner,sun6i-a31s";
0050 
0051         aliases {
0052                 serial0 = &uart0;
0053         };
0054 
0055         chosen {
0056                 stdout-path = "serial0:115200n8";
0057         };
0058 
0059         leds {
0060                 compatible = "gpio-leds";
0061 
0062                 led-0 {
0063                         label = "bpi-m2:blue:usr";
0064                         gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */
0065                 };
0066 
0067                 led-1 {
0068                         label = "bpi-m2:green:usr";
0069                         gpios = <&pio 6 10 GPIO_ACTIVE_HIGH>; /* PG10 */
0070                 };
0071 
0072                 led-2 {
0073                         label = "bpi-m2:red:usr";
0074                         gpios = <&pio 6 5 GPIO_ACTIVE_HIGH>; /* PG5 */
0075                 };
0076         };
0077 
0078         mmc2_pwrseq: mmc2_pwrseq {
0079                 compatible = "mmc-pwrseq-simple";
0080                 reset-gpios = <&r_pio 0 8 GPIO_ACTIVE_LOW>; /* PL8 WIFI_EN */
0081         };
0082 };
0083 
0084 &cpu0 {
0085         cpu-supply = <&reg_dcdc3>;
0086 };
0087 
0088 &ehci0 {
0089         status = "okay";
0090 };
0091 
0092 &gmac {
0093         pinctrl-names = "default";
0094         pinctrl-0 = <&gmac_rgmii_pins>;
0095         phy-handle = <&phy1>;
0096         phy-mode = "rgmii";
0097         phy-supply = <&reg_dldo1>;
0098         status = "okay";
0099 };
0100 
0101 &ir {
0102         pinctrl-names = "default";
0103         pinctrl-0 = <&s_ir_rx_pin>;
0104         status = "okay";
0105 };
0106 
0107 &mdio {
0108         phy1: ethernet-phy@1 {
0109                 reg = <1>;
0110                 reset-gpios = <&pio 0 21 GPIO_ACTIVE_LOW>; /* PA21 */
0111                 reset-assert-us = <10000>;
0112                 reset-deassert-us = <30000>;
0113         };
0114 };
0115 
0116 &mmc0 {
0117         vmmc-supply = <&reg_dcdc1>;
0118         bus-width = <4>;
0119         cd-gpios = <&pio 0 4 GPIO_ACTIVE_LOW>; /* PA4 */
0120         status = "okay";
0121 };
0122 
0123 &mmc2 {
0124         pinctrl-names = "default";
0125         pinctrl-0 = <&mmc2_4bit_pins>;
0126         vmmc-supply = <&reg_aldo1>;
0127         mmc-pwrseq = <&mmc2_pwrseq>;
0128         bus-width = <4>;
0129         non-removable;
0130         status = "okay";
0131 
0132         brcmf: wifi@1 {
0133                 reg = <1>;
0134                 compatible = "brcm,bcm4329-fmac";
0135                 interrupt-parent = <&r_pio>;
0136                 interrupts = <0 5 IRQ_TYPE_LEVEL_LOW>; /* PL5 */
0137                 interrupt-names = "host-wake";
0138         };
0139 };
0140 
0141 &ohci0 {
0142         status = "okay";
0143 };
0144 
0145 &p2wi {
0146         status = "okay";
0147 
0148         axp22x: pmic@68 {
0149                 compatible = "x-powers,axp221";
0150                 reg = <0x68>;
0151                 interrupt-parent = <&r_intc>;
0152                 interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
0153                 eldoin-supply = <&reg_dcdc1>;
0154                 x-powers,drive-vbus-en;
0155         };
0156 };
0157 
0158 #include "axp22x.dtsi"
0159 
0160 &reg_aldo1 {
0161         regulator-min-microvolt = <3300000>;
0162         regulator-max-microvolt = <3300000>;
0163         regulator-name = "vcc-wifi";
0164 };
0165 
0166 &reg_aldo2 {
0167         regulator-always-on;
0168         regulator-min-microvolt = <2500000>;
0169         regulator-max-microvolt = <2500000>;
0170         regulator-name = "vcc-gmac";
0171 };
0172 
0173 &reg_aldo3 {
0174         regulator-always-on;
0175         regulator-min-microvolt = <3000000>;
0176         regulator-max-microvolt = <3000000>;
0177         regulator-name = "avcc";
0178 };
0179 
0180 &reg_dc5ldo {
0181         regulator-always-on;
0182         regulator-min-microvolt = <700000>;
0183         regulator-max-microvolt = <1320000>;
0184         regulator-name = "vdd-cpus";
0185 };
0186 
0187 &reg_dcdc1 {
0188         regulator-always-on;
0189         regulator-min-microvolt = <3000000>;
0190         regulator-max-microvolt = <3000000>;
0191         regulator-name = "vdd-3v0";
0192 };
0193 
0194 &reg_dcdc2 {
0195         regulator-min-microvolt = <700000>;
0196         regulator-max-microvolt = <1320000>;
0197         regulator-name = "vdd-gpu";
0198 };
0199 
0200 &reg_dcdc3 {
0201         regulator-always-on;
0202         regulator-min-microvolt = <700000>;
0203         regulator-max-microvolt = <1320000>;
0204         regulator-name = "vdd-cpu";
0205 };
0206 
0207 &reg_dcdc4 {
0208         regulator-always-on;
0209         regulator-min-microvolt = <700000>;
0210         regulator-max-microvolt = <1320000>;
0211         regulator-name = "vdd-sys-dll";
0212 };
0213 
0214 &reg_dcdc5 {
0215         regulator-always-on;
0216         regulator-min-microvolt = <1500000>;
0217         regulator-max-microvolt = <1500000>;
0218         regulator-name = "vcc-dram";
0219 };
0220 
0221 &reg_dldo1 {
0222         regulator-min-microvolt = <3000000>;
0223         regulator-max-microvolt = <3000000>;
0224         regulator-name = "vcc-mac";
0225 };
0226 
0227 &reg_dldo2 {
0228         regulator-min-microvolt = <2800000>;
0229         regulator-max-microvolt = <2800000>;
0230         regulator-name = "avdd-csi";
0231 };
0232 
0233 &reg_dldo3 {
0234         regulator-always-on;
0235         regulator-min-microvolt = <3300000>;
0236         regulator-max-microvolt = <3300000>;
0237         regulator-name = "vcc-pb";
0238 };
0239 
0240 &reg_eldo1 {
0241         regulator-min-microvolt = <1800000>;
0242         regulator-max-microvolt = <1800000>;
0243         regulator-name = "vdd-csi";
0244         status = "okay";
0245 };
0246 
0247 &reg_ldo_io1 {
0248         regulator-always-on;
0249         regulator-min-microvolt = <1800000>;
0250         regulator-max-microvolt = <1800000>;
0251         regulator-name = "vcc-pm-cpus";
0252         status = "okay";
0253 };
0254 
0255 &uart0 {
0256         pinctrl-names = "default";
0257         pinctrl-0 = <&uart0_ph_pins>;
0258         status = "okay";
0259 };
0260 
0261 &usbphy {
0262         status = "okay";
0263 };
0264 
0265 &pio {
0266         gpio-line-names =
0267                 /* PA */
0268                 "ETXD0", "ETXD1", "ETXD2", "ETXD3", "SDC0-DET", "", "",
0269                 "", "ETXCLK", "ETXEN", "EGTXCLK", "ERXD0", "ERXD1",
0270                 "ERXD2", "ERXD3", "", "", "", "", "ERXDV", "ERXCK",
0271                 "ETXERR", "ERXERR", "ECOL", "ECRS", "ECLKIN", "EMDC",
0272                 "EMDIO", "", "", "", "",
0273 
0274                 /* PB */
0275                 "CN7-P29", "CN7-P31", "CN7-P33", "CN7-P35", "CN7-P37",
0276                 "CN7-P28", "CN7-P27", "CN7-P32", "", "", "", "", "", "",
0277                 "", "", "", "", "", "", "", "", "", "", "", "", "", "",
0278                 "", "", "", "",
0279 
0280                 /* PC */
0281                 "", "", "", "", "", "", "WL-SDIO-CMD", "WL-SDIO-CLK",
0282                 "WL-SDIO-D0", "WL-SDIO-D2", "WL-SDIO-D2", "WL-SDIO-D3",
0283                 "", "", "", "", "", "", "", "", "", "", "", "", "", "",
0284                 "", "USB-DRV", "", "", "", "",
0285 
0286                 /* PD */
0287                 "CN9-P09", "CN9-P11", "CN9-P13", "CN9-P15", "CN9-P17",
0288                 "CN9-P19", "CN9-P21", "CN9-P23", "CN9-P25", "CN9-P27",
0289                 "CN9-P29", "CN9-P31", "CN9-P33", "CN9-P35", "CN9-P37",
0290                 "CN9-P39", "CN9-P40", "CN9-P38", "CN9-P36", "CN9-P34",
0291                 "CN9-P32", "CN9-P30", "CN9-P28", "CN9-P26", "CN9-P22",
0292                 "CN9-P14", "CN9-P18", "CN9-P16", "", "", "", "",
0293 
0294                 /* PE */
0295                 "CN6-P20", "CN6-P24", "CN6-P30", "CN6-P28", "CN7-P08",
0296                 "CN7-P10", "CN7-P36", "CN7-P38", "CN6-P17", "CN6-P19",
0297                 "CN6-P21", "CN6-P23", "CN6-P25", "CN6-P27", "CN6-P29",
0298                 "CN6-P31", "", "", "", "", "", "", "", "", "", "", "",
0299                 "", "", "", "", "",
0300 
0301                 /* PF */
0302                 "SDC0-D1", "SDC0-D0", "SDC0-CLK", "SDC0-CMD", "SDC0-D3",
0303                 "SDC0-D2", "", "", "", "", "", "", "", "", "", "", "",
0304                 "", "", "", "", "", "", "", "", "", "", "", "", "", "",
0305                 "",
0306 
0307                 /* PG */
0308                 "CN9-P06", "CN9-P08", "CN9-P20", "CN9-P12", "CN9-P07",
0309                 "LED-PWR", "CN7-P13", "CN7-P11", "CN7-P22", "CN7-P15",
0310                 "LED-G", "LED-B", "CN7-P26", "CN7-P24", "CN7-P23",
0311                 "CN7-P19", "CN7-P21", "HCEC", "CN6-P22", "", "", "", "",
0312                 "", "", "", "", "", "", "", "", "",
0313 
0314                 /* PH */
0315                 "", "", "", "", "", "", "", "", "", "CN7-P07",
0316                 "CN7-P12", "CN7-P16", "CN7-P18", "CN9-P10", "CN6-P16",
0317                 "CN6-P14", "CN9-P04", "CN9-P02", "CN7-P05", "CN7-P03",
0318                 "CN8-P03", "CN8-P02", "", "", "CN6-P34", "CN6-P32",
0319                 "CN6-P26", "CN6-P18", "", "", "", "";
0320 };
0321 
0322 &r_pio {
0323         gpio-line-names =
0324                 /* PL */
0325                 "PMU-SCK", "PMU-SDA", "VBAT-EN", "", "IR-RX",
0326                 "WL-WAKE-HOST", "BT-WAKE_HOST", "BT-ENABLE",
0327                 "WL-PMU-EN", "", "", "", "", "", "", "", "", "", "", "",
0328                 "", "", "", "", "", "", "", "", "", "", "", "",
0329 
0330                 /* PM */
0331                 "CN6-P12", "CN6-P35", "CN7-P40", "", "", "", "", "", "",
0332                 "", "", "", "", "", "", "", "", "", "", "", "", "", "",
0333                 "", "", "", "", "", "", "", "", "";
0334 };