kernel: update 3.18 to 3.18.14
[openwrt/svn-archive/archive.git] / target / linux / sunxi / patches-3.18 / 301-dt-sun7i-add-bananapro.patch
1 From 3613d535a77270eaf15a5f988a48434c7d1530f2 Mon Sep 17 00:00:00 2001
2 From: Hans de Goede <hdegoede@redhat.com>
3 Date: Wed, 7 Jan 2015 20:44:52 +0100
4 Subject: [PATCH] ARM: dts: sun7i: Add dts file for Bananapro board
5
6 Add support for the new Bananapro A20 development board from lemaker.org.
7 This board features 1G RAM, 2 USB A receptacles, 1 micro USB receptacle for
8 OTG, 1 micro USB receptacle for power, HDMI, sata, Gbit ethernet, ir receiver,
9 3.5 mm jack for a/v out, on board microphone, 40 gpio pins and sdio wifi.
10
11 Signed-off-by: Hans de Goede <hdegoede@redhat.com>
12 ---
13 arch/arm/boot/dts/Makefile | 1 +
14 arch/arm/boot/dts/sun7i-a20-bananapro.dts | 261 ++++++++++++++++++++++++++++++
15 2 files changed, 262 insertions(+)
16 create mode 100644 arch/arm/boot/dts/sun7i-a20-bananapro.dts
17
18 --- a/arch/arm/boot/dts/Makefile
19 +++ b/arch/arm/boot/dts/Makefile
20 @@ -436,6 +436,7 @@ dtb-$(CONFIG_MACH_SUN6I) += \
21 sun6i-a31-m9.dtb
22 dtb-$(CONFIG_MACH_SUN7I) += \
23 sun7i-a20-bananapi.dtb \
24 + sun7i-a20-bananapro.dtb \
25 sun7i-a20-cubieboard2.dtb \
26 sun7i-a20-cubietruck.dtb \
27 sun7i-a20-hummingbird.dtb \
28 --- /dev/null
29 +++ b/arch/arm/boot/dts/sun7i-a20-bananapro.dts
30 @@ -0,0 +1,261 @@
31 +/*
32 + * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
33 + *
34 + * This file is dual-licensed: you can use it either under the terms
35 + * of the GPL or the X11 license, at your option. Note that this dual
36 + * licensing only applies to this file, and not this project as a
37 + * whole.
38 + *
39 + * a) This file is free software; you can redistribute it and/or
40 + * modify it under the terms of the GNU General Public License as
41 + * published by the Free Software Foundation; either version 2 of the
42 + * License, or (at your option) any later version.
43 + *
44 + * This file is distributed in the hope that it will be useful,
45 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
46 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
47 + * GNU General Public License for more details.
48 + *
49 + * You should have received a copy of the GNU General Public
50 + * License along with this file; if not, write to the Free
51 + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
52 + * MA 02110-1301 USA
53 + *
54 + * Or, alternatively,
55 + *
56 + * b) Permission is hereby granted, free of charge, to any person
57 + * obtaining a copy of this software and associated documentation
58 + * files (the "Software"), to deal in the Software without
59 + * restriction, including without limitation the rights to use,
60 + * copy, modify, merge, publish, distribute, sublicense, and/or
61 + * sell copies of the Software, and to permit persons to whom the
62 + * Software is furnished to do so, subject to the following
63 + * conditions:
64 + *
65 + * The above copyright notice and this permission notice shall be
66 + * included in all copies or substantial portions of the Software.
67 + *
68 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
69 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
70 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
71 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
72 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
73 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
74 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
75 + * OTHER DEALINGS IN THE SOFTWARE.
76 + */
77 +
78 +/dts-v1/;
79 +/include/ "sun7i-a20.dtsi"
80 +/include/ "sunxi-common-regulators.dtsi"
81 +
82 +/ {
83 + model = "LeMaker Banana Pro";
84 + compatible = "lemaker,bananapro", "allwinner,sun7i-a20";
85 +
86 + soc@01c00000 {
87 + spi0: spi@01c05000 {
88 + pinctrl-names = "default";
89 + pinctrl-0 = <&spi0_pins_a>;
90 + status = "okay";
91 + };
92 +
93 + mmc0: mmc@01c0f000 {
94 + pinctrl-names = "default";
95 + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bananapi>;
96 + vmmc-supply = <&reg_vcc3v3>;
97 + bus-width = <4>;
98 + cd-gpios = <&pio 7 10 0>; /* PH10 */
99 + cd-inverted;
100 + status = "okay";
101 + };
102 +
103 + mmc3: mmc@01c12000 {
104 + pinctrl-names = "default";
105 + pinctrl-0 = <&mmc3_pins_a>;
106 + vmmc-supply = <&reg_vmmc3>;
107 + bus-width = <4>;
108 + non-removable;
109 + status = "okay";
110 + };
111 +
112 + usbphy: phy@01c13400 {
113 + usb1_vbus-supply = <&reg_usb1_vbus>;
114 + usb2_vbus-supply = <&reg_usb2_vbus>;
115 + status = "okay";
116 + };
117 +
118 + ehci0: usb@01c14000 {
119 + status = "okay";
120 + };
121 +
122 + ohci0: usb@01c14400 {
123 + status = "okay";
124 + };
125 +
126 + ahci: sata@01c18000 {
127 + status = "okay";
128 + };
129 +
130 + ehci1: usb@01c1c000 {
131 + status = "okay";
132 + };
133 +
134 + ohci1: usb@01c1c400 {
135 + status = "okay";
136 + };
137 +
138 + pinctrl@01c20800 {
139 + usb1_vbus_pin_bananapro: usb1_vbus_pin@0 {
140 + allwinner,pins = "PH0";
141 + allwinner,function = "gpio_out";
142 + allwinner,drive = <0>;
143 + allwinner,pull = <0>;
144 + };
145 +
146 + usb2_vbus_pin_bananapro: usb2_vbus_pin@0 {
147 + allwinner,pins = "PH1";
148 + allwinner,function = "gpio_out";
149 + allwinner,drive = <0>;
150 + allwinner,pull = <0>;
151 + };
152 +
153 + mmc0_cd_pin_bananapi: mmc0_cd_pin@0 {
154 + allwinner,pins = "PH10";
155 + allwinner,function = "gpio_in";
156 + allwinner,drive = <0>;
157 + allwinner,pull = <1>;
158 + };
159 +
160 + vmmc3_pin_bananapro: vmmc3_pin@0 {
161 + allwinner,pins = "PH22";
162 + allwinner,function = "gpio_out";
163 + allwinner,drive = <0>;
164 + allwinner,pull = <0>;
165 + };
166 +
167 + gmac_power_pin_bananapi: gmac_power_pin@0 {
168 + allwinner,pins = "PH23";
169 + allwinner,function = "gpio_out";
170 + allwinner,drive = <0>;
171 + allwinner,pull = <0>;
172 + };
173 +
174 + led_pins_bananapi: led_pins@0 {
175 + allwinner,pins = "PH24", "PG2";
176 + allwinner,function = "gpio_out";
177 + allwinner,drive = <0>;
178 + allwinner,pull = <0>;
179 + };
180 + };
181 +
182 + ir0: ir@01c21800 {
183 + pinctrl-names = "default";
184 + pinctrl-0 = <&ir0_pins_a>;
185 + status = "okay";
186 + };
187 +
188 + uart0: serial@01c28000 {
189 + pinctrl-names = "default";
190 + pinctrl-0 = <&uart0_pins_a>;
191 + status = "okay";
192 + };
193 +
194 + uart2: serial@01c28800 {
195 + pinctrl-names = "default";
196 + pinctrl-0 = <&uart2_pins_a>;
197 + status = "okay";
198 + };
199 +
200 + uart7: serial@01c29c00 {
201 + pinctrl-names = "default";
202 + pinctrl-0 = <&uart7_pins_a>;
203 + status = "okay";
204 + };
205 +
206 + i2c0: i2c@01c2ac00 {
207 + pinctrl-names = "default";
208 + pinctrl-0 = <&i2c0_pins_a>;
209 + status = "okay";
210 +
211 + axp209: pmic@34 {
212 + compatible = "x-powers,axp209";
213 + reg = <0x34>;
214 + interrupt-parent = <&nmi_intc>;
215 + interrupts = <0 8>;
216 +
217 + interrupt-controller;
218 + #interrupt-cells = <1>;
219 + };
220 + };
221 +
222 + i2c2: i2c@01c2b400 {
223 + pinctrl-names = "default";
224 + pinctrl-0 = <&i2c2_pins_a>;
225 + status = "okay";
226 + };
227 +
228 + gmac: ethernet@01c50000 {
229 + pinctrl-names = "default";
230 + pinctrl-0 = <&gmac_pins_rgmii_a>;
231 + phy = <&phy1>;
232 + phy-mode = "rgmii";
233 + phy-supply = <&reg_gmac_3v3>;
234 + status = "okay";
235 +
236 + phy1: ethernet-phy@1 {
237 + reg = <1>;
238 + };
239 + };
240 + };
241 +
242 + leds {
243 + compatible = "gpio-leds";
244 + pinctrl-names = "default";
245 + pinctrl-0 = <&led_pins_bananapi>;
246 +
247 + green {
248 + label = "bananapi:green:usr";
249 + gpios = <&pio 7 24 0>;
250 + };
251 + blue {
252 + label = "bananapi:blue:usr";
253 + gpios = <&pio 6 2 0>;
254 + };
255 + };
256 +
257 + reg_usb1_vbus: usb1-vbus {
258 + pinctrl-0 = <&usb1_vbus_pin_bananapro>;
259 + gpio = <&pio 7 0 0>; /* PH0 */
260 + status = "okay";
261 + };
262 +
263 + reg_usb2_vbus: usb2-vbus {
264 + pinctrl-0 = <&usb2_vbus_pin_bananapro>;
265 + gpio = <&pio 7 1 0>; /* PH1 */
266 + status = "okay";
267 + };
268 +
269 + reg_gmac_3v3: gmac-3v3 {
270 + compatible = "regulator-fixed";
271 + pinctrl-names = "default";
272 + pinctrl-0 = <&gmac_power_pin_bananapi>;
273 + regulator-name = "gmac-3v3";
274 + regulator-min-microvolt = <3300000>;
275 + regulator-max-microvolt = <3300000>;
276 + startup-delay-us = <100000>;
277 + enable-active-high;
278 + gpio = <&pio 7 23 0>;
279 + };
280 +
281 + reg_vmmc3: vmmc3 {
282 + compatible = "regulator-fixed";
283 + pinctrl-names = "default";
284 + pinctrl-0 = <&vmmc3_pin_bananapro>;
285 + regulator-name = "vmmc3";
286 + regulator-min-microvolt = <3300000>;
287 + regulator-max-microvolt = <3300000>;
288 + enable-active-high;
289 + gpio = <&pio 7 22 0>;
290 + };
291 +};