0f7196fc11db93c203d1938c975698a20abe3823
[openwrt.git] / package / boot / uboot-sunxi / patches / 002-add-lamobo-r1.diff
1 diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
2 index 9c735c6..a32d772 100644
3 --- a/arch/arm/dts/Makefile
4 +++ b/arch/arm/dts/Makefile
5 @@ -103,6 +103,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
6         sun7i-a20-ainol-aw1.dtb \
7         sun7i-a20-bananapi.dtb \
8         sun7i-a20-bananapro.dtb \
9 +       sun7i-a20-lamobo-r1.dtb \
10         sun7i-a20-cubieboard2.dtb \
11         sun7i-a20-cubietruck.dtb \
12         sun7i-a20-hummingbird.dtb \
13 diff --git a/arch/arm/dts/sun7i-a20-lamobo-r1.dts
14 b/arch/arm/dts/sun7i-a20-lamobo-r1.dts
15 new file mode 100644
16 index 0000000..a77fb5c
17 --- /dev/null
18 +++ b/arch/arm/dts/sun7i-a20-lamobo-r1.dts
19 @@ -0,0 +1,231 @@
20 +/*
21 + * Copyright 2014 Hans de Goede <hdegoede@redhat.com>
22 + *
23 + * Hans de Goede <hdegoede@redhat.com>
24 + *
25 + * This file is dual-licensed: you can use it either under the terms
26 + * of the GPL or the X11 license, at your option. Note that this dual
27 + * licensing only applies to this file, and not this project as a
28 + * whole.
29 + *
30 + *  a) This file is free software; you can redistribute it and/or
31 + *     modify it under the terms of the GNU General Public License as
32 + *     published by the Free Software Foundation; either version 2 of the
33 + *     License, or (at your option) any later version.
34 + *
35 + *     This file is distributed in the hope that it will be useful,
36 + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
37 + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
38 + *     GNU General Public License for more details.
39 + *
40 + * Or, alternatively,
41 + *
42 + *  b) Permission is hereby granted, free of charge, to any person
43 + *     obtaining a copy of this software and associated documentation
44 + *     files (the "Software"), to deal in the Software without
45 + *     restriction, including without limitation the rights to use,
46 + *     copy, modify, merge, publish, distribute, sublicense, and/or
47 + *     sell copies of the Software, and to permit persons to whom the
48 + *     Software is furnished to do so, subject to the following
49 + *     conditions:
50 + *
51 + *     The above copyright notice and this permission notice shall be
52 + *     included in all copies or substantial portions of the Software.
53 + *
54 + *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
55 + *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
56 + *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
57 + *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
58 + *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
59 + *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
60 + *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
61 + *     OTHER DEALINGS IN THE SOFTWARE.
62 + */
63 +
64 +/dts-v1/;
65 +#include "sun7i-a20.dtsi"
66 +#include "sunxi-common-regulators.dtsi"
67 +
68 +#include <dt-bindings/gpio/gpio.h>
69 +#include <dt-bindings/interrupt-controller/irq.h>
70 +#include <dt-bindings/pinctrl/sun4i-a10.h>
71 +
72 +/ {
73 +       model = "Lamobo Banana Pi R1";
74 +       compatible = "lemaker,bananapi", "allwinner,sun7i-a20";
75 +
76 +       aliases {
77 +               serial0 = &uart0;
78 +               serial1 = &uart3;
79 +               serial2 = &uart7;
80 +       };
81 +
82 +       chosen {
83 +               stdout-path = "serial0:115200n8";
84 +       };
85 +
86 +       leds {
87 +               compatible = "gpio-leds";
88 +               pinctrl-names = "default";
89 +               pinctrl-0 = <&led_pins_bananapi>;
90 +
91 +               green {
92 +                       label = "bananapi:green:usr";
93 +                       gpios = <&pio 7 24 GPIO_ACTIVE_HIGH>;
94 +               };
95 +       };
96 +
97 +       reg_gmac_3v3: gmac-3v3 {
98 +               compatible = "regulator-fixed";
99 +               pinctrl-names = "default";
100 +               pinctrl-0 = <&gmac_power_pin_bananapi>;
101 +               regulator-name = "gmac-3v3";
102 +               regulator-min-microvolt = <3300000>;
103 +               regulator-max-microvolt = <3300000>;
104 +               startup-delay-us = <100000>;
105 +               enable-active-high;
106 +               gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>;
107 +       };
108 +};
109 +
110 +&ahci {
111 +       status = "okay";
112 +};
113 +
114 +&ehci0 {
115 +       status = "okay";
116 +};
117 +
118 +&ehci1 {
119 +       status = "okay";
120 +};
121 +
122 +&gmac {
123 +       pinctrl-names = "default";
124 +       pinctrl-0 = <&gmac_pins_rgmii_a>;
125 +       phy = <&phy1>;
126 +       phy-mode = "rgmii";
127 +       phy-supply = <&reg_gmac_3v3>;
128 +       status = "okay";
129 +
130 +       phy1: ethernet-phy@1 {
131 +               reg = <1>;
132 +       };
133 +};
134 +
135 +&i2c0 {
136 +       pinctrl-names = "default";
137 +       pinctrl-0 = <&i2c0_pins_a>;
138 +       status = "okay";
139 +
140 +       axp209: pmic@34 {
141 +               compatible = "x-powers,axp209";
142 +               reg = <0x34>;
143 +               interrupt-parent = <&nmi_intc>;
144 +               interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
145 +
146 +               interrupt-controller;
147 +               #interrupt-cells = <1>;
148 +       };
149 +};
150 +
151 +&i2c2 {
152 +       pinctrl-names = "default";
153 +       pinctrl-0 = <&i2c2_pins_a>;
154 +       status = "okay";
155 +};
156 +
157 +&ir0 {
158 +       pinctrl-names = "default";
159 +       pinctrl-0 = <&ir0_rx_pins_a>;
160 +       status = "okay";
161 +};
162 +
163 +&mmc0 {
164 +       pinctrl-names = "default";
165 +       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bananapi>;
166 +       vmmc-supply = <&reg_vcc3v3>;
167 +       bus-width = <4>;
168 +       cd-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */
169 +       cd-inverted;
170 +       status = "okay";
171 +};
172 +
173 +&ohci0 {
174 +       status = "okay";
175 +};
176 +
177 +&ohci1 {
178 +       status = "okay";
179 +};
180 +
181 +&pio {
182 +       mmc0_cd_pin_bananapi: mmc0_cd_pin@0 {
183 +               allwinner,pins = "PH10";
184 +               allwinner,function = "gpio_in";
185 +               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
186 +               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
187 +       };
188 +
189 +       gmac_power_pin_bananapi: gmac_power_pin@0 {
190 +               allwinner,pins = "PH23";
191 +               allwinner,function = "gpio_out";
192 +               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
193 +               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
194 +       };
195 +
196 +       led_pins_bananapi: led_pins@0 {
197 +               allwinner,pins = "PH24";
198 +               allwinner,function = "gpio_out";
199 +               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
200 +               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
201 +       };
202 +
203 +       ir0_tx_pins_a: ir0@1 {
204 +               allwinner,pins = "PB3";
205 +               allwinner,function = "ir0";
206 +               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
207 +               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
208 +               };
209 +
210 +};
211 +
212 +&reg_usb1_vbus {
213 +       status = "okay";
214 +};
215 +
216 +&reg_usb2_vbus {
217 +       status = "okay";
218 +};
219 +
220 +&spi0 {
221 +       pinctrl-names = "default";
222 +       pinctrl-0 = <&spi0_pins_a>,
223 +                   <&spi0_cs0_pins_a>,
224 +                   <&spi0_cs1_pins_a>;
225 +       status = "okay";
226 +};
227 +
228 +&uart0 {
229 +       pinctrl-names = "default";
230 +       pinctrl-0 = <&uart0_pins_a>;
231 +       status = "okay";
232 +};
233 +
234 +&uart3 {
235 +       pinctrl-names = "default";
236 +       pinctrl-0 = <&uart3_pins_b>;
237 +       status = "okay";
238 +};
239 +
240 +&uart7 {
241 +       pinctrl-names = "default";
242 +       pinctrl-0 = <&uart7_pins_a>;
243 +       status = "okay";
244 +};
245 +
246 +&usbphy {
247 +       usb1_vbus-supply = <&reg_usb1_vbus>;
248 +       usb2_vbus-supply = <&reg_usb2_vbus>;
249 +       status = "okay";
250 +};
251 diff --git a/board/sunxi/MAINTAINERS b/board/sunxi/MAINTAINERS
252 index 7a42055..abf2c1c 100644
253 --- a/board/sunxi/MAINTAINERS
254 +++ b/board/sunxi/MAINTAINERS
255 @@ -30,6 +30,7 @@ F:    include/configs/sun7i.h
256  F:     configs/A20-OLinuXino_MICRO_defconfig
257  F:     configs/Bananapi_defconfig
258  F:     configs/Bananapro_defconfig
259 +F:     configs/Lamobo_R1_defconfig
260  F:     configs/i12-tvbox_defconfig
261  F:     configs/Linksprite_pcDuino3_defconfig
262  F:     configs/Linksprite_pcDuino3_fdt_defconfig
263 diff --git a/configs/Lamobo_R1_defconfig b/configs/Lamobo_R1_defconfig
264 new file mode 100644
265 index 0000000..bf665e7
266 --- /dev/null
267 +++ b/configs/Lamobo_R1_defconfig
268 @@ -0,0 +1,17 @@
269 +CONFIG_ARM=y
270 +CONFIG_ARCH_SUNXI=y
271 +CONFIG_MACH_SUN7I=y
272 +CONFIG_DRAM_CLK=432
273 +CONFIG_GMAC_TX_DELAY=4
274 +CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-lamobo-r1"
275 +CONFIG_SPL=y
276 +CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER,SUNXI_GMAC,RGMII,MACPWR=SUNXI_GPH(23),AHCI,USB_EHCI"
277 +CONFIG_ETH_DESIGNWARE=y
278 +# CONFIG_CMD_IMLS is not set
279 +# CONFIG_CMD_FLASH is not set
280 +# CONFIG_CMD_FPGA is not set
281 +CONFIG_DM_SERIAL=y
282 +CONFIG_USB=y
283 +CONFIG_DM_USB=y
284 +CONFIG_NETDEVICES=y
285 +CONFIG_NET=y