Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright (C) 2016 Icenowy Zheng <icenowy@aosc.xyz>
0003  *
0004  * Based on sun8i-h3-orangepi-one.dts, which is:
0005  *   Copyright (C) 2016 Hans de Goede <hdegoede@redhat.com>
0006  *
0007  * This file is dual-licensed: you can use it either under the terms
0008  * of the GPL or the X11 license, at your option. Note that this dual
0009  * licensing only applies to this file, and not this project as a
0010  * whole.
0011  *
0012  *  a) This file is free software; you can redistribute it and/or
0013  *     modify it under the terms of the GNU General Public License as
0014  *     published by the Free Software Foundation; either version 2 of the
0015  *     License, or (at your option) any later version.
0016  *
0017  *     This file is distributed in the hope that it will be useful,
0018  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
0019  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0020  *     GNU General Public License for more details.
0021  *
0022  * Or, alternatively,
0023  *
0024  *  b) Permission is hereby granted, free of charge, to any person
0025  *     obtaining a copy of this software and associated documentation
0026  *     files (the "Software"), to deal in the Software without
0027  *     restriction, including without limitation the rights to use,
0028  *     copy, modify, merge, publish, distribute, sublicense, and/or
0029  *     sell copies of the Software, and to permit persons to whom the
0030  *     Software is furnished to do so, subject to the following
0031  *     conditions:
0032  *
0033  *     The above copyright notice and this permission notice shall be
0034  *     included in all copies or substantial portions of the Software.
0035  *
0036  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0037  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
0038  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0039  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
0040  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
0041  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
0042  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0043  *     OTHER DEALINGS IN THE SOFTWARE.
0044  */
0045 
0046 /dts-v1/;
0047 #include "sun8i-h3.dtsi"
0048 #include "sunxi-common-regulators.dtsi"
0049 
0050 #include <dt-bindings/gpio/gpio.h>
0051 #include <dt-bindings/input/input.h>
0052 
0053 / {
0054         model = "Xunlong Orange Pi Zero";
0055         compatible = "xunlong,orangepi-zero", "allwinner,sun8i-h2-plus";
0056 
0057         aliases {
0058                 serial0 = &uart0;
0059                 /* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */
0060                 ethernet0 = &emac;
0061                 ethernet1 = &xr819;
0062         };
0063 
0064         chosen {
0065                 stdout-path = "serial0:115200n8";
0066         };
0067 
0068         leds {
0069                 compatible = "gpio-leds";
0070 
0071                 pwr_led {
0072                         label = "orangepi:green:pwr";
0073                         gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
0074                         default-state = "on";
0075                 };
0076 
0077                 status_led {
0078                         label = "orangepi:red:status";
0079                         gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>;
0080                 };
0081         };
0082 
0083         reg_vcc_wifi: reg_vcc_wifi {
0084                 compatible = "regulator-fixed";
0085                 regulator-min-microvolt = <3300000>;
0086                 regulator-max-microvolt = <3300000>;
0087                 regulator-name = "vcc-wifi";
0088                 enable-active-high;
0089                 gpio = <&pio 0 20 GPIO_ACTIVE_HIGH>;
0090         };
0091 
0092         reg_vdd_cpux: vdd-cpux-regulator {
0093                 compatible = "regulator-gpio";
0094                 regulator-name = "vdd-cpux";
0095                 regulator-type = "voltage";
0096                 regulator-boot-on;
0097                 regulator-always-on;
0098                 regulator-min-microvolt = <1100000>;
0099                 regulator-max-microvolt = <1300000>;
0100                 regulator-ramp-delay = <50>; /* 4ms */
0101 
0102                 gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */
0103                 enable-active-high;
0104                 gpios-states = <1>;
0105                 states = <1100000 0>, <1300000 1>;
0106         };
0107 
0108         wifi_pwrseq: wifi_pwrseq {
0109                 compatible = "mmc-pwrseq-simple";
0110                 reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>;
0111                 post-power-on-delay-ms = <200>;
0112         };
0113 };
0114 
0115 &cpu0 {
0116         cpu-supply = <&reg_vdd_cpux>;
0117 };
0118 
0119 &ehci0 {
0120         status = "okay";
0121 };
0122 
0123 &ehci1 {
0124         status = "okay";
0125 };
0126 
0127 &emac {
0128         phy-handle = <&int_mii_phy>;
0129         phy-mode = "mii";
0130         allwinner,leds-active-low;
0131         status = "okay";
0132 };
0133 
0134 &mmc0 {
0135         vmmc-supply = <&reg_vcc3v3>;
0136         bus-width = <4>;
0137         cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
0138         status = "okay";
0139 };
0140 
0141 &mmc1 {
0142         vmmc-supply = <&reg_vcc_wifi>;
0143         mmc-pwrseq = <&wifi_pwrseq>;
0144         bus-width = <4>;
0145         non-removable;
0146         status = "okay";
0147 
0148         /*
0149          * Explicitly define the sdio device, so that we can add an ethernet
0150          * alias for it (which e.g. makes u-boot set a mac-address).
0151          */
0152         xr819: sdio_wifi@1 {
0153                 reg = <1>;
0154         };
0155 };
0156 
0157 &ohci0 {
0158         status = "okay";
0159 };
0160 
0161 &ohci1 {
0162         status = "okay";
0163 };
0164 
0165 &spi0 {
0166         /* Disable SPI NOR by default: it optional on Orange Pi Zero boards */
0167         status = "disabled";
0168 
0169         flash@0 {
0170                 #address-cells = <1>;
0171                 #size-cells = <1>;
0172                 compatible = "mxicy,mx25l1606e", "jedec,spi-nor";
0173                 reg = <0>;
0174                 spi-max-frequency = <40000000>;
0175         };
0176 };
0177 
0178 &uart0 {
0179         pinctrl-names = "default";
0180         pinctrl-0 = <&uart0_pa_pins>;
0181         status = "okay";
0182 };
0183 
0184 &uart1 {
0185         pinctrl-names = "default";
0186         pinctrl-0 = <&uart1_pins>;
0187         status = "disabled";
0188 };
0189 
0190 &uart2 {
0191         pinctrl-names = "default";
0192         pinctrl-0 = <&uart2_pins>;
0193         status = "disabled";
0194 };
0195 
0196 &usb_otg {
0197         dr_mode = "peripheral";
0198         status = "okay";
0199 };
0200 
0201 &usbphy {
0202         /*
0203          * USB Type-A port VBUS is always on. However, MicroUSB VBUS can only
0204          * power up the board; when it's used as OTG port, this VBUS is
0205          * always off even if the board is powered via GPIO pins.
0206          */
0207         status = "okay";
0208         usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
0209 };