package: uboot-sunxi: various changes
[openwrt.git] / package / boot / uboot-sunxi / patches / 003-add-theobroma-a31-pangolin.patch
1 diff -ruN a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
2 --- a/arch/arm/dts/Makefile     2016-01-12 15:06:54.000000000 +0100
3 +++ b/arch/arm/dts/Makefile     2016-01-30 15:31:50.000000000 +0100
4 @@ -142,6 +142,7 @@
5         sun6i-a31-m9.dtb \
6         sun6i-a31-mele-a1000g-quad.dtb \
7         sun6i-a31-mixtile-loftq.dtb \
8 +       sun6i-a31-pangolin.dtb \
9         sun6i-a31s-cs908.dtb \
10         sun6i-a31s-primo81.dtb \
11         sun6i-a31s-sinovoip-bpi-m2.dtb
12 diff -ruN a/arch/arm/dts/sun6i-a31.dtsi b/arch/arm/dts/sun6i-a31.dtsi
13 --- a/arch/arm/dts/sun6i-a31.dtsi       2016-01-12 15:06:54.000000000 +0100
14 +++ b/arch/arm/dts/sun6i-a31.dtsi       2016-01-31 15:06:47.000000000 +0100
15 @@ -643,6 +643,13 @@
16                                 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
17                         };
18  
19 +                       i2c3_pins_a: i2c3@0 {
20 +                               allwinner,pins = "PB5", "PB6";
21 +                               allwinner,function = "i2c3";
22 +                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
23 +                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
24 +                       };
25 +
26                         mmc0_pins_a: mmc0@0 {
27                                 allwinner,pins = "PF0", "PF1", "PF2",
28                                                  "PF3", "PF4", "PF5";
29 diff -ruN a/arch/arm/dts/sun6i-a31-pangolin.dts b/arch/arm/dts/sun6i-a31-pangolin.dts
30 --- a/arch/arm/dts/sun6i-a31-pangolin.dts       1970-01-01 01:00:00.000000000 +0100
31 +++ b/arch/arm/dts/sun6i-a31-pangolin.dts       2016-02-09 01:21:44.965168099 +0100
32 @@ -0,0 +1,292 @@
33 +/*
34 + * Copyright 2015, Theobroma Systems Design und Consulting GmbH
35 + *
36 + * This file is dual-licensed: you can use it either under the terms
37 + * of the GPL or the X11 license, at your option. Note that this dual
38 + * licensing only applies to this file, and not this project as a
39 + * whole.
40 + *
41 + *  a) This file is free software; you can redistribute it and/or
42 + *     modify it under the terms of the GNU General Public License as
43 + *     published by the Free Software Foundation; either version 2 of the
44 + *     License, or (at your option) any later version.
45 + *
46 + *     This file is distributed in the hope that it will be useful,
47 + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
48 + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
49 + *     GNU General Public License for more details.
50 + *
51 + * Or, alternatively,
52 + *
53 + *  b) Permission is hereby granted, free of charge, to any person
54 + *     obtaining a copy of this software and associated documentation
55 + *     files (the "Software"), to deal in the Software without
56 + *     restriction, including without limitation the rights to use,
57 + *     copy, modify, merge, publish, distribute, sublicense, and/or
58 + *     sell copies of the Software, and to permit persons to whom the
59 + *     Software is furnished to do so, subject to the following
60 + *     conditions:
61 + *
62 + *     The above copyright notice and this permission notice shall be
63 + *     included in all copies or substantial portions of the Software.
64 + *
65 + *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
66 + *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
67 + *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
68 + *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
69 + *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
70 + *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
71 + *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
72 + *     OTHER DEALINGS IN THE SOFTWARE.
73 + */
74 +
75 +/dts-v1/;
76 +#include "sun6i-a31.dtsi"
77 +#include "sunxi-common-regulators.dtsi"
78 +
79 +#include <dt-bindings/gpio/gpio.h>
80 +#include <dt-bindings/pinctrl/sun4i-a10.h>
81 +
82 +/ {
83 +       model = "Theobroma Systems A31 Pangolin";
84 +       compatible = "tsd,a31-pangolin", "allwinner,sun6i-a31";
85 +
86 +       aliases {
87 +               serial0 = &uart0;
88 +               serial2 = &uart2;
89 +               spi0 = &spi0;
90 +               spi1 = &spi1;
91 +               spi2 = &spi2;
92 +               spi3 = &spi3;
93 +       };
94 +
95 +       chosen {
96 +               stdout-path = "serial2:115200n8";
97 +       };
98 +};
99 +
100 +&ehci0 {
101 +       status = "okay";
102 +};
103 +
104 +&ohci0 {
105 +       status = "okay";
106 +};
107 +
108 +&ehci1 {
109 +       status = "okay";
110 +};
111 +
112 +&ohci1 {
113 +       status = "okay";
114 +};
115 +
116 +&ohci2 {
117 +       status = "okay";
118 +};
119 +
120 +&gmac {
121 +       pinctrl-names = "default";
122 +       pinctrl-0 = <&gmac_pins_rgmii_a>;
123 +       phy = <&phy1>;
124 +       phy-mode = "rgmii";
125 +       snps,reset-gpio = <&pio 0 7 GPIO_ACTIVE_LOW>;
126 +       snps,reset-active-low;
127 +       snps,reset-delays-us = <0 10000 30000>;
128 +       status = "okay";
129 +
130 +       phy1: ethernet-phy@4 {
131 +               reg = <4>;
132 +       };
133 +};
134 +
135 +&i2c0 {
136 +       pinctrl-names = "default";
137 +       pinctrl-0 = <&i2c0_pins_a>;
138 +       status = "okay";
139 +};
140 +
141 +&i2c1 {
142 +       pinctrl-names = "default";
143 +       pinctrl-0 = <&i2c1_pins_a>;
144 +       status = "okay";
145 +};
146 +
147 +&i2c2 {
148 +       pinctrl-names = "default";
149 +       pinctrl-0 = <&i2c2_pins_a>;
150 +       status = "okay";
151 +};
152 +
153 +&i2c3 {
154 +       pinctrl-names = "default";
155 +       pinctrl-0 = <&i2c3_pins_a>;
156 +       status = "okay";
157 +
158 +       rtc_twi: rtc@6f {
159 +        compatible = "isil,isl1208";
160 +        reg = <0x6f>;
161 +       };
162 +       fan: fan@18 {
163 +               compatible = "ti,amc6821";
164 +               reg = <0x18>;
165 +               cooling-min-state = <0>;
166 +               cooling-max-state = <9>;
167 +               #cooling-cells = <2>;
168 +       };
169 +};
170 +
171 +&spi0 {
172 +       status = "okay";
173 +
174 +       flash: flash@0 {
175 +               compatible = "spansion,m25p40";
176 +               spi-max-frequency = <16000000>;
177 +               spi-cpol;
178 +               spi-cpha;
179 +       };
180 +};
181 +
182 +&spi1 {
183 +       status = "okay";
184 +};
185 +
186 +&ir {
187 +       pinctrl-names = "default";
188 +       pinctrl-0 = <&ir_pins_a>;
189 +       status = "okay";
190 +};
191 +
192 +&mmc0 {
193 +       pinctrl-names = "default";
194 +       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_pangolin>;
195 +       vmmc-supply = <&reg_vcc3v0>;
196 +       bus-width = <4>;
197 +       cd-gpios = <&pio 2 19 GPIO_ACTIVE_LOW>; /* PC19 */
198 +       status = "okay";
199 +};
200 +
201 +&mmc0_pins_a {
202 +       /* external pull-ups missing for some pins */
203 +       allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
204 +};
205 +
206 +&mmc2 {
207 +       pinctrl-names = "default";
208 +       pinctrl-0 = <&mmc2_pins_a>;
209 +       vmmc-supply = <&reg_vcc3v0>;
210 +       bus-width = <8>;
211 +       non-removable;
212 +       status = "okay";
213 +};
214 +
215 +&pio {
216 +       mmc0_cd_pin_pangolin: mmc0_cd_pin@0 {
217 +               allwinner,pins = "PC19";
218 +               allwinner,function = "gpio_in";
219 +               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
220 +               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
221 +       };
222 +
223 +       leds_pins_pangolin: led_pins@0 {
224 +               allwinner,pins = "PH7", "PC16";
225 +               allwinner,function = "gpio_out";
226 +               allwinner,drive = <SUN4I_PINCTRL_20_MA>;
227 +               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
228 +       };
229 +
230 +       mmc2_pins_a: mmc2@0 {
231 +               allwinner,pins = "PC6","PC7","PC8","PC9","PC10","PC11",
232 +                               "PC12","PC13","PC14","PC15";
233 +               allwinner,function = "mmc2";
234 +               allwinner,drive = <SUN4I_PINCTRL_30_MA>;
235 +               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
236 +       };
237 +};
238 +
239 +&p2wi {
240 +       status = "okay";
241 +
242 +       axp221: pmic@68 {
243 +               compatible = "x-powers,axp221";
244 +               reg = <0x68>;
245 +               interrupt-parent = <&nmi_intc>;
246 +               interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
247 +               interrupt-controller;
248 +               #interrupt-cells = <1>;
249 +               dcdc1-supply = <&vcc_3v0>;
250 +               dcdc5-supply = <&vcc_dram>;
251 +
252 +               regulators {
253 +                       x-powers,dcdc-freq = <3000>;
254 +
255 +                       vcc_3v0: dcdc1 {
256 +                               regulator-always-on;
257 +                               regulator-min-microvolt = <3000000>;
258 +                               regulator-max-microvolt = <3000000>;
259 +                               regulator-name = "vcc-3v0";
260 +                       };
261 +
262 +                       vdd_cpu: dcdc2 {
263 +                               regulator-always-on;
264 +                               regulator-min-microvolt = <700000>;
265 +                               regulator-max-microvolt = <1320000>;
266 +                               regulator-name = "vdd-cpu";
267 +                       };
268 +
269 +                       vdd_gpu: dcdc3 {
270 +                               regulator-always-on;
271 +                               regulator-min-microvolt = <700000>;
272 +                               regulator-max-microvolt = <1320000>;
273 +                               regulator-name = "vdd-gpu";
274 +                       };
275 +
276 +                       vdd_sys_dll: dcdc4 {
277 +                               regulator-always-on;
278 +                               regulator-min-microvolt = <1100000>;
279 +                               regulator-max-microvolt = <1100000>;
280 +                               regulator-name = "vdd-sys-dll";
281 +                       };
282 +
283 +                       vcc_dram: dcdc5 {
284 +                               regulator-always-on;
285 +                               regulator-min-microvolt = <1500000>;
286 +                               regulator-max-microvolt = <1500000>;
287 +                               regulator-name = "vcc-dram";
288 +                       };
289 +
290 +                       vcc_wifi: aldo1 {
291 +                               regulator-min-microvolt = <3300000>;
292 +                               regulator-max-microvolt = <3300000>;
293 +                               regulator-name = "vcc_wifi";
294 +                       };
295 +
296 +                       avcc: aldo3 {
297 +                               regulator-always-on;
298 +                               regulator-min-microvolt = <3000000>;
299 +                               regulator-max-microvolt = <3000000>;
300 +                               regulator-name = "avcc";
301 +                       };
302 +               };
303 +       };
304 +};
305 +
306 +&uart0 {
307 +       pinctrl-names = "default";
308 +       pinctrl-0 = <&uart0_pins_a>;
309 +       status = "okay";
310 +};
311 +
312 +&usb1_vbus_pin_a {
313 +       allwinner,pins = "PD23";
314 +};
315 +
316 +&reg_usb1_vbus {
317 +       gpio = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* PD 23 */
318 +       status = "okay";
319 +};
320 +
321 +&usbphy {
322 +       status = "okay";
323 +       usb1_vbus-supply = <&reg_usb1_vbus>;
324 +};
325 diff -ruN a/configs/pangolin_defconfig b/configs/pangolin_defconfig
326 --- a/configs/pangolin_defconfig        1970-01-01 01:00:00.000000000 +0100
327 +++ b/configs/pangolin_defconfig        2016-01-30 14:43:59.000000000 +0100
328 @@ -0,0 +1,36 @@
329 +CONFIG_SUNXI_PANGOLIN=y
330 +CONFIG_SPL=y
331 +CONFIG_SYS_EXTRA_OPTIONS="USB_EHCI,SUNXI_GMAC,RGMII"
332 +CONFIG_DEFAULT_DEVICE_TREE="sun6i-a31-pangolin"
333 +CONFIG_VIDEO_VGA_VIA_LCD=y
334 +CONFIG_VIDEO_VGA_EXTERNAL_DAC_EN="PH25"
335 +CONFIG_ARM=y
336 +CONFIG_ARCH_SUNXI=y
337 +CONFIG_MACH_SUN6I=y
338 +CONFIG_DRAM_CHANNELS=1
339 +CONFIG_DRAM_CLK=360
340 +CONFIG_DRAM_ZQ=70
341 +CONFIG_AXP_DCDC1_VOLT=3300
342 +CONFIG_AXP_ALDO1_VOLT=0
343 +CONFIG_AXP_ALDO2_VOLT=1800
344 +CONFIG_AXP_ALDO3_VOLT=3000
345 +CONFIG_AXP_DLDO4_VOLT=3300
346 +CONFIG_AXP_ELDO1_VOLT=1200
347 +CONFIG_AXP_ELDO2_VOLT=2500
348 +CONFIG_AXP_ELDO3_VOLT=3300
349 +CONFIG_MMC_SUNXI_SLOT_EXTRA=2
350 +CONFIG_CONS_INDEX=3
351 +# Vbus gpio for usb1
352 +CONFIG_USB1_VBUS_PIN=""
353 +# No Vbus gpio for usb2
354 +CONFIG_USB2_VBUS_PIN=""
355 +CONFIG_USB=y
356 +CONFIG_DM_USB=y
357 +CONFIG_USB_EHCI=y
358 +CONFIG_USB_KEYBOARD=y
359 +CONFIG_DM_ETH=y
360 +CONFIG_CMD_IMLS=n
361 +CONFIG_ETH_DESIGNWARE=y
362 +CONFIG_DM_SPI=y
363 +CONFIG_DM_SPI_FLASH=y
364 +CONFIG_SUNXI_SPI=y
365 diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
366 index e155c4c..1b147b2 100644
367 --- a/board/sunxi/Kconfig
368 +++ b/board/sunxi/Kconfig
369 @@ -15,7 +15,6 @@ config SUNXI_GEN_SUN6I
370         separate ahb reset control registers, custom pmic bus, new style
371         watchdog, etc.
372  
373 -
374  choice
375         prompt "Sunxi SoC Variant"
376         optional
377 @@ -80,6 +79,14 @@ config MACH_SUN8I
378         bool
379         default y if MACH_SUN8I_A23 || MACH_SUN8I_A33
380  
381 +choice
382 +       prompt "Sunxi Board Variant"
383 +       optional
384 +
385 +config SUNXI_PANGOLIN
386 +       bool "Theobroma A31 uQ7 Board"
387 +
388 +endchoice
389  
390  config DRAM_CLK
391         int "sunxi dram clock speed"
392 -- 
393 cgit v0.10.2
394