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