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