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