Merge branch 'v1.4' into v1.5
[librecmc/librecmc.git] / target / linux / sunxi / patches-4.4 / 200-dt-sun7i-add-lamobo-r1.patch
1 From 46662c86b453d7098ff22d6112d0481f07d523a1 Mon Sep 17 00:00:00 2001
2 From: Jelle de Jong <jelledejong@powercraft.nl>
3 Date: Sun, 18 Oct 2015 16:34:39 +0200
4 Subject: [PATCH] ARM: dts: sun7i: Add dts file for the lamobo-r1 board
5
6 The lamobo-r1 board, sometimes called the BPI-R1 but not labelled as such
7 on the PCB, is meant as a A20 based router board. As such the board comes
8 with a built-in switch chip giving it 5 gigabit ethernet boards, and it
9 has a large empty area on the pcb with mounting holes which will fit a
10 2.5 inch harddisk. To complete its networking features it has a
11 Realtek RTL8192CU for WiFi 802.11 b/g/n.
12
13 Signed-off-by: Jelle de Jong <jelledejong@powercraft.nl>
14 Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 ---
16  arch/arm/boot/dts/Makefile                |   1 +
17  arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts | 297 ++++++++++++++++++++++++++++++
18  2 files changed, 298 insertions(+)
19  create mode 100644 arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts
20
21 --- a/arch/arm/boot/dts/Makefile
22 +++ b/arch/arm/boot/dts/Makefile
23 @@ -638,6 +638,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
24         sun7i-a20-cubietruck.dtb \
25         sun7i-a20-hummingbird.dtb \
26         sun7i-a20-i12-tvbox.dtb \
27 +       sun7i-a20-lamobo-r1.dtb \
28         sun7i-a20-m3.dtb \
29         sun7i-a20-mk808c.dtb \
30         sun7i-a20-olimex-som-evb.dtb \
31 --- /dev/null
32 +++ b/arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts
33 @@ -0,0 +1,297 @@
34 +/*
35 + * Copyright 2015 Jelle de Jong <jelledejong@powercraft.nl>
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 file 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 file 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 + * Or, alternatively,
53 + *
54 + *  b) Permission is hereby granted, free of charge, to any person
55 + *     obtaining a copy of this software and associated documentation
56 + *     files (the "Software"), to deal in the Software without
57 + *     restriction, including without limitation the rights to use,
58 + *     copy, modify, merge, publish, distribute, sublicense, and/or
59 + *     sell copies of the Software, and to permit persons to whom the
60 + *     Software is furnished to do so, subject to the following
61 + *     conditions:
62 + *
63 + *     The above copyright notice and this permission notice shall be
64 + *     included in all copies or substantial portions of the Software.
65 + *
66 + *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
67 + *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
68 + *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
69 + *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
70 + *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
71 + *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
72 + *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
73 + *     OTHER DEALINGS IN THE SOFTWARE.
74 + */
75 +
76 +/dts-v1/;
77 +#include "sun7i-a20.dtsi"
78 +#include "sunxi-common-regulators.dtsi"
79 +
80 +#include <dt-bindings/gpio/gpio.h>
81 +#include <dt-bindings/interrupt-controller/irq.h>
82 +#include <dt-bindings/pinctrl/sun4i-a10.h>
83 +
84 +/ {
85 +       model = "Lamobo R1";
86 +       compatible = "lamobo,lamobo-r1", "allwinner,sun7i-a20";
87 +
88 +       aliases {
89 +               serial0 = &uart0;
90 +               serial1 = &uart3;
91 +               serial2 = &uart7;
92 +       };
93 +
94 +       chosen {
95 +               stdout-path = "serial0:115200n8";
96 +       };
97 +
98 +       leds {
99 +               compatible = "gpio-leds";
100 +               pinctrl-names = "default";
101 +               pinctrl-0 = <&led_pins_lamobo_r1>;
102 +
103 +               green {
104 +                       label = "lamobo_r1:green:usr";
105 +                       gpios = <&pio 7 24 GPIO_ACTIVE_HIGH>;
106 +               };
107 +       };
108 +
109 +       reg_gmac_3v3: gmac-3v3 {
110 +               compatible = "regulator-fixed";
111 +               pinctrl-names = "default";
112 +               pinctrl-0 = <&gmac_power_pin_lamobo_r1>;
113 +               regulator-name = "gmac-3v3";
114 +               regulator-min-microvolt = <3300000>;
115 +               regulator-max-microvolt = <3300000>;
116 +               startup-delay-us = <100000>;
117 +               enable-active-high;
118 +               gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */
119 +       };
120 +};
121 +
122 +&ahci_pwr_pin_a {
123 +       allwinner,pins = "PB3";
124 +};
125 +
126 +&ahci {
127 +       target-supply = <&reg_ahci_5v>;
128 +       status = "okay";
129 +};
130 +
131 +&cpu0 {
132 +       cpu-supply = <&reg_dcdc2>;
133 +       operating-points = <
134 +               /* kHz    uV */
135 +               960000  1400000
136 +               912000  1400000
137 +               864000  1350000
138 +               720000  1250000
139 +               528000  1150000
140 +               312000  1100000
141 +               144000  1050000
142 +               >;
143 +};
144 +
145 +&ehci0 {
146 +       status = "okay";
147 +};
148 +
149 +&ehci1 {
150 +       status = "okay";
151 +};
152 +
153 +&gmac {
154 +       pinctrl-names = "default";
155 +       pinctrl-0 = <&gmac_pins_rgmii_a>;
156 +       phy = <&phy1>;
157 +       phy-mode = "rgmii";
158 +       phy-supply = <&reg_gmac_3v3>;
159 +       status = "okay";
160 +
161 +       phy1: ethernet-phy@1 {
162 +               reg = <1>;
163 +       };
164 +};
165 +
166 +&i2c0 {
167 +       pinctrl-names = "default";
168 +       pinctrl-0 = <&i2c0_pins_a>;
169 +       status = "okay";
170 +
171 +       axp209: pmic@34 {
172 +               reg = <0x34>;
173 +               interrupt-parent = <&nmi_intc>;
174 +               interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
175 +       };
176 +};
177 +
178 +&i2c2 {
179 +       pinctrl-names = "default";
180 +       pinctrl-0 = <&i2c2_pins_a>;
181 +       status = "okay";
182 +};
183 +
184 +&ir0 {
185 +       pinctrl-names = "default";
186 +       pinctrl-0 = <&ir0_rx_pins_a>;
187 +       status = "okay";
188 +};
189 +
190 +&mmc0 {
191 +       pinctrl-names = "default";
192 +       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_lamobo_r1>;
193 +       vmmc-supply = <&reg_vcc3v3>;
194 +       bus-width = <4>;
195 +       cd-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */
196 +       cd-inverted;
197 +       status = "okay";
198 +};
199 +
200 +&ohci0 {
201 +       status = "okay";
202 +};
203 +
204 +&ohci1 {
205 +       status = "okay";
206 +};
207 +
208 +&otg_sram {
209 +       status = "okay";
210 +};
211 +
212 +&pio {
213 +       usb0_id_detect_pin: usb0_id_detect_pin@0 {
214 +               allwinner,pins = "PH4";
215 +               allwinner,function = "gpio_in";
216 +               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
217 +               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
218 +       };
219 +
220 +       mmc0_cd_pin_lamobo_r1: mmc0_cd_pin@0 {
221 +               allwinner,pins = "PH10";
222 +               allwinner,function = "gpio_in";
223 +               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
224 +               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
225 +       };
226 +
227 +       gmac_power_pin_lamobo_r1: gmac_power_pin@0 {
228 +               allwinner,pins = "PH23";
229 +               allwinner,function = "gpio_out";
230 +               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
231 +               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
232 +       };
233 +
234 +       led_pins_lamobo_r1: led_pins@0 {
235 +               allwinner,pins = "PH24";
236 +               allwinner,function = "gpio_out";
237 +               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
238 +               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
239 +       };
240 +};
241 +
242 +#include "axp209.dtsi"
243 +
244 +&reg_ahci_5v {
245 +       gpio = <&pio 1 3 0>; /* PB3 */
246 +       status = "okay";
247 +};
248 +
249 +&reg_dcdc2 {
250 +       regulator-always-on;
251 +       regulator-min-microvolt = <1000000>;
252 +       regulator-max-microvolt = <1400000>;
253 +       regulator-name = "vdd-cpu";
254 +};
255 +
256 +&reg_dcdc3 {
257 +       regulator-always-on;
258 +       regulator-min-microvolt = <1000000>;
259 +       regulator-max-microvolt = <1400000>;
260 +       regulator-name = "vdd-int-dll";
261 +};
262 +
263 +&reg_ldo1 {
264 +       regulator-name = "vdd-rtc";
265 +};
266 +
267 +&reg_ldo2 {
268 +       regulator-always-on;
269 +       regulator-min-microvolt = <3000000>;
270 +       regulator-max-microvolt = <3000000>;
271 +       regulator-name = "avcc";
272 +};
273 +
274 +&reg_usb0_vbus {
275 +       status = "okay";
276 +};
277 +
278 +&reg_usb1_vbus {
279 +       status = "okay";
280 +};
281 +
282 +&reg_usb2_vbus {
283 +       status = "okay";
284 +};
285 +
286 +&spi0 {
287 +       pinctrl-names = "default";
288 +       pinctrl-0 = <&spi0_pins_a>,
289 +                   <&spi0_cs0_pins_a>,
290 +                   <&spi0_cs1_pins_a>;
291 +       status = "okay";
292 +};
293 +
294 +&uart0 {
295 +       pinctrl-names = "default";
296 +       pinctrl-0 = <&uart0_pins_a>;
297 +       status = "okay";
298 +};
299 +
300 +&uart3 {
301 +       pinctrl-names = "default";
302 +       pinctrl-0 = <&uart3_pins_b>;
303 +       status = "okay";
304 +};
305 +
306 +&uart7 {
307 +       pinctrl-names = "default";
308 +       pinctrl-0 = <&uart7_pins_a>;
309 +       status = "okay";
310 +};
311 +
312 +&usb_otg {
313 +       dr_mode = "otg";
314 +       status = "okay";
315 +};
316 +
317 +&usb_power_supply {
318 +       status = "okay";
319 +};
320 +
321 +&usbphy {
322 +       pinctrl-names = "default";
323 +       pinctrl-0 = <&usb0_id_detect_pin>;
324 +       usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
325 +       usb0_vbus_power-supply = <&usb_power_supply>;
326 +       usb0_vbus-supply = <&reg_usb0_vbus>;
327 +       usb1_vbus-supply = <&reg_usb1_vbus>;
328 +       usb2_vbus-supply = <&reg_usb2_vbus>;
329 +       status = "okay";
330 +};