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