Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
[sfrench/cifs-2.6.git] / arch / arm / boot / dts / sun5i-a13-licheepi-one.dts
1 /*
2  * Copyright 2016 Icenowy Zheng <icenowy@aosc.xyz>
3  *
4  * Based on sun5i-a13-olinuxino.dts, which is
5  *   Copyright 2012 Maxime Ripard <maxime.ripard@free-electrons.com>
6  *   Copyright 2013 Hans de Goede <hdegoede@redhat.com>
7  *
8  * This file is dual-licensed: you can use it either under the terms
9  * of the GPL or the X11 license, at your option. Note that this dual
10  * licensing only applies to this file, and not this project as a
11  * whole.
12  *
13  *  a) This file is free software; you can redistribute it and/or
14  *     modify it under the terms of the GNU General Public License as
15  *     published by the Free Software Foundation; either version 2 of the
16  *     License, or (at your option) any later version.
17  *
18  *     This file is distributed in the hope that it will be useful,
19  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
20  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  *     GNU General Public License for more details.
22  *
23  * Or, alternatively,
24  *
25  *  b) Permission is hereby granted, free of charge, to any person
26  *     obtaining a copy of this software and associated documentation
27  *     files (the "Software"), to deal in the Software without
28  *     restriction, including without limitation the rights to use,
29  *     copy, modify, merge, publish, distribute, sublicense, and/or
30  *     sell copies of the Software, and to permit persons to whom the
31  *     Software is furnished to do so, subject to the following
32  *     conditions:
33  *
34  *     The above copyright notice and this permission notice shall be
35  *     included in all copies or substantial portions of the Software.
36  *
37  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
38  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
39  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
40  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
41  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
42  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
43  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
44  *     OTHER DEALINGS IN THE SOFTWARE.
45  */
46
47 /dts-v1/;
48 #include "sun5i-a13.dtsi"
49 #include "sunxi-common-regulators.dtsi"
50
51 #include <dt-bindings/gpio/gpio.h>
52 #include <dt-bindings/input/input.h>
53
54 / {
55         model = "Lichee Pi One";
56         compatible = "licheepi,licheepi-one", "allwinner,sun5i-a13";
57
58         aliases {
59                 serial0 = &uart1;
60         };
61
62         chosen {
63                 stdout-path = "serial0:115200n8";
64         };
65
66         leds {
67                 compatible = "gpio-leds";
68
69                 red {
70                         label ="licheepi:red:usr";
71                         gpios = <&pio 2 5 GPIO_ACTIVE_LOW>;
72                 };
73
74                 green {
75                         label ="licheepi:green:usr";
76                         gpios = <&pio 2 19 GPIO_ACTIVE_LOW>;
77                         default-state = "on";
78                 };
79
80                 blue {
81                         label ="licheepi:blue:usr";
82                         gpios = <&pio 2 4 GPIO_ACTIVE_LOW>;
83                 };
84
85         };
86 };
87
88 &cpu0 {
89         cpu-supply = <&reg_dcdc2>;
90 };
91
92 &ehci0 {
93         status = "okay";
94 };
95
96 &i2c0 {
97         pinctrl-names = "default";
98         pinctrl-0 = <&i2c0_pins_a>;
99         status = "okay";
100
101         axp209: pmic@34 {
102                 compatible = "x-powers,axp209";
103                 reg = <0x34>;
104                 interrupts = <0>;
105
106                 interrupt-controller;
107                 #interrupt-cells = <1>;
108         };
109 };
110
111 &i2c1 {
112         pinctrl-names = "default";
113         pinctrl-0 = <&i2c1_pins_a>;
114         status = "disabled";
115 };
116
117 &i2c2 {
118         pinctrl-names = "default";
119         pinctrl-0 = <&i2c2_pins_a>;
120         status = "disabled";
121 };
122
123 &lradc {
124         vref-supply = <&reg_ldo2>;
125         status = "okay";
126
127         button@984 {
128                 label = "Home";
129                 linux,code = <KEY_HOMEPAGE>;
130                 channel = <0>;
131                 voltage = <984126>;
132         };
133 };
134
135 &mmc0 {
136         pinctrl-names = "default";
137         pinctrl-0 = <&mmc0_pins_a>;
138         vmmc-supply = <&reg_vcc3v3>;
139         bus-width = <4>;
140         broken-cd;
141         status = "okay";
142 };
143
144 &mmc2 {
145         pinctrl-names = "default";
146         pinctrl-0 = <&mmc2_4bit_pins_a>;
147         vmmc-supply = <&reg_vcc3v3>;
148         bus-width = <4>;
149         broken-cd;
150         status = "okay";
151 };
152
153 &ohci0 {
154         status = "okay";
155 };
156
157 &otg_sram {
158         status = "okay";
159 };
160
161 #include "axp209.dtsi"
162
163 &reg_dcdc2 {
164         regulator-always-on;
165         regulator-min-microvolt = <1000000>;
166         regulator-max-microvolt = <1500000>;
167         regulator-name = "vdd-cpu";
168 };
169
170 &reg_dcdc3 {
171         regulator-always-on;
172         regulator-min-microvolt = <1000000>;
173         regulator-max-microvolt = <1400000>;
174         regulator-name = "vdd-int-dll";
175 };
176
177 &reg_ldo1 {
178         regulator-name = "vdd-rtc";
179 };
180
181 &reg_ldo2 {
182         regulator-always-on;
183         regulator-min-microvolt = <3000000>;
184         regulator-max-microvolt = <3000000>;
185         regulator-name = "avcc";
186 };
187
188 &reg_ldo3 {
189         regulator-min-microvolt = <1800000>;
190         regulator-max-microvolt = <1800000>;
191         regulator-name = "csi-1.8v";
192 };
193
194 &reg_ldo4 {
195         regulator-min-microvolt = <2800000>;
196         regulator-max-microvolt = <2800000>;
197         regulator-name = "csi-2.8v";
198 };
199
200 &reg_usb0_vbus {
201         gpio = <&pio 2 12 GPIO_ACTIVE_HIGH>; /* PC12 */
202         status = "okay";
203 };
204
205 &uart1 {
206         pinctrl-names = "default";
207         pinctrl-0 = <&uart1_pins_b>;
208         status = "okay";
209 };
210
211 &usb_otg {
212         dr_mode = "otg";
213         status = "okay";
214 };
215
216 &usbphy {
217         pinctrl-names = "default";
218         usb0_id_det-gpio = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
219         usb0_vbus_det-gpio = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */
220         usb0_vbus-supply = <&reg_usb0_vbus>;
221         usb1_vbus-supply = <&reg_vcc5v0>;
222         status = "okay";
223 };