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