Merge tag 'batadv-next-for-davem-20190213' of git://git.open-mesh.org/linux-merge
[linux-2.6-microblaze.git] / arch / arm / boot / dts / sun8i-a83t-tbs-a711.dts
1 /*
2  * Copyright (C) 2017 Touchless Biometric Systems AG
3  * Tomas Novotny <tomas@novotny.cz>
4  *
5  * This file is dual-licensed: you can use it either under the terms
6  * of the GPL or the X11 license, at your option. Note that this dual
7  * licensing only applies to this file, and not this project as a
8  * whole.
9  *
10  *  a) This file is free software; you can redistribute it and/or
11  *     modify it under the terms of the GNU General Public License as
12  *     published by the Free Software Foundation; either version 2 of the
13  *     License, or (at your option) any later version.
14  *
15  *     This file is distributed in the hope that it will be useful,
16  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
17  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  *     GNU General Public License for more details.
19  *
20  * Or, alternatively,
21  *
22  *  b) Permission is hereby granted, free of charge, to any person
23  *     obtaining a copy of this software and associated documentation
24  *     files (the "Software"), to deal in the Software without
25  *     restriction, including without limitation the rights to use,
26  *     copy, modify, merge, publish, distribute, sublicense, and/or
27  *     sell copies of the Software, and to permit persons to whom the
28  *     Software is furnished to do so, subject to the following
29  *     conditions:
30  *
31  *     The above copyright notice and this permission notice shall be
32  *     included in all copies or substantial portions of the Software.
33  *
34  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
36  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
37  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
38  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
39  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
40  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
41  *     OTHER DEALINGS IN THE SOFTWARE.
42  */
43
44 /dts-v1/;
45 #include "sun8i-a83t.dtsi"
46
47 #include <dt-bindings/gpio/gpio.h>
48 #include <dt-bindings/pwm/pwm.h>
49
50 / {
51         model = "TBS A711 Tablet";
52         compatible = "tbs-biometrics,a711", "allwinner,sun8i-a83t";
53
54         aliases {
55                 serial0 = &uart0;
56                 serial1 = &uart1;
57         };
58
59         chosen {
60                 stdout-path = "serial0:115200n8";
61         };
62
63         backlight: backlight {
64                 compatible = "pwm-backlight";
65                 pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
66                 enable-gpios = <&pio 3 29 GPIO_ACTIVE_HIGH>;
67
68                 brightness-levels = <0 1 2 4 8 16 32 64 128 255>;
69                 default-brightness-level = <9>;
70         };
71
72         panel {
73                 compatible = "tbs,a711-panel", "panel-lvds";
74                 backlight = <&backlight>;
75                 power-supply = <&reg_sw>;
76
77                 width-mm = <153>;
78                 height-mm = <90>;
79                 data-mapping = "vesa-24";
80
81                 panel-timing {
82                         /* 1024x600 @60Hz */
83                         clock-frequency = <52000000>;
84                         hactive = <1024>;
85                         vactive = <600>;
86                         hsync-len = <20>;
87                         hfront-porch = <180>;
88                         hback-porch = <160>;
89                         vfront-porch = <12>;
90                         vback-porch = <23>;
91                         vsync-len = <5>;
92                 };
93
94                 port {
95                         panel_input: endpoint {
96                                 remote-endpoint = <&tcon0_out_lcd>;
97                         };
98                 };
99         };
100
101         reg_vbat: reg-vbat {
102                 compatible = "regulator-fixed";
103                 regulator-name = "vbat";
104                 regulator-min-microvolt = <3700000>;
105                 regulator-max-microvolt = <3700000>;
106         };
107
108         reg_vmain: reg-vmain {
109                 compatible = "regulator-fixed";
110                 regulator-name = "vmain";
111                 regulator-min-microvolt = <5000000>;
112                 regulator-max-microvolt = <5000000>;
113                 gpio = <&r_pio 0 9 GPIO_ACTIVE_HIGH>;
114                 enable-active-high;
115                 vin-supply = <&reg_vbat>;
116         };
117
118         wifi_pwrseq: wifi_pwrseq {
119                 compatible = "mmc-pwrseq-simple";
120                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 WL-PMU-EN */
121
122                 /*
123                  * This is actually Bluetooth's clock, but we have to
124                  * hook it up somewheere
125                  */
126                 clocks = <&ac100_rtc 1>;
127                 clock-names = "ext_clock";
128         };
129 };
130
131 &cpu0 {
132         cpu-supply = <&reg_dcdc2>;
133 };
134
135 &cpu100 {
136         cpu-supply = <&reg_dcdc3>;
137 };
138
139 &de {
140         status = "okay";
141 };
142
143 /*
144  * An USB-2 hub is connected here, which also means we don't need to
145  * enable the OHCI controller.
146  */
147 &ehci0 {
148         status = "okay";
149 };
150
151 /*
152  * There's a modem connected here that needs to be initialised before
153  * being able to be enumerated.
154  */
155 &ehci1 {
156         status = "okay";
157 };
158
159 &mmc0 {
160         vmmc-supply = <&reg_dcdc1>;
161         pinctrl-names = "default";
162         pinctrl-0 = <&mmc0_pins>;
163         bus-width = <4>;
164         cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
165         status = "okay";
166 };
167
168 &mmc1 {
169         mmc-pwrseq = <&wifi_pwrseq>;
170         bus-width = <4>;
171         vmmc-supply = <&reg_dldo1>;
172         vqmmc-supply = <&reg_dldo1>;
173         non-removable;
174         wakeup-source;
175         status = "okay";
176
177         brcmf: wifi@1 {
178                 reg = <1>;
179                 compatible = "brcm,bcm4329-fmac";
180                 interrupt-parent = <&r_pio>;
181                 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 WL_WAKE_UP */
182                 interrupt-names = "host-wake";
183         };
184 };
185
186 &mmc2 {
187         pinctrl-0 = <&mmc2_8bit_emmc_pins>;
188         pinctrl-names = "default";
189         vmmc-supply = <&reg_dcdc1>;
190         vqmmc-supply = <&reg_dcdc1>;
191         bus-width = <8>;
192         non-removable;
193         cap-mmc-hw-reset;
194         status = "okay";
195 };
196
197 &pwm {
198         pinctrl-names = "default";
199         pinctrl-0 = <&pwm_pin>;
200         status = "okay";
201 };
202
203 &r_rsb {
204         status = "okay";
205
206         axp81x: pmic@3a3 {
207                 compatible = "x-powers,axp813";
208                 reg = <0x3a3>;
209                 interrupt-parent = <&r_intc>;
210                 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
211                 swin-supply = <&reg_dcdc1>;
212                 x-powers,drive-vbus-en;
213         };
214
215         ac100: codec@e89 {
216                 compatible = "x-powers,ac100";
217                 reg = <0xe89>;
218
219                 ac100_codec: codec {
220                         compatible = "x-powers,ac100-codec";
221                         interrupt-parent = <&r_pio>;
222                         interrupts = <0 12 IRQ_TYPE_LEVEL_LOW>; /* PL12 */
223                         #clock-cells = <0>;
224                         clock-output-names = "4M_adda";
225                 };
226
227                 ac100_rtc: rtc {
228                         compatible = "x-powers,ac100-rtc";
229                         interrupt-parent = <&r_intc>;
230                         interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
231                         clocks = <&ac100_codec>;
232                         #clock-cells = <1>;
233                         clock-output-names = "cko1_rtc",
234                                              "cko2_rtc",
235                                              "cko3_rtc";
236                 };
237         };
238
239 };
240
241 #include "axp81x.dtsi"
242
243 &battery_power_supply {
244         status = "okay";
245 };
246
247 &reg_aldo1 {
248         regulator-min-microvolt = <1800000>;
249         regulator-max-microvolt = <1800000>;
250         regulator-name = "vcc-1.8";
251 };
252
253 &reg_aldo2 {
254         regulator-min-microvolt = <1800000>;
255         regulator-max-microvolt = <1800000>;
256         regulator-always-on;
257         regulator-name = "vdd-drampll";
258 };
259
260 &reg_aldo3 {
261         regulator-min-microvolt = <3000000>;
262         regulator-max-microvolt = <3000000>;
263         regulator-always-on;
264         regulator-name = "avcc";
265 };
266
267 &reg_dcdc1 {
268         regulator-min-microvolt = <3100000>;
269         regulator-max-microvolt = <3100000>;
270         regulator-always-on;
271         regulator-name = "vcc-io";
272 };
273
274 &reg_dcdc2 {
275         regulator-min-microvolt = <700000>;
276         regulator-max-microvolt = <1100000>;
277         regulator-always-on;
278         regulator-name = "vdd-cpu-A";
279 };
280
281 &reg_dcdc3 {
282         regulator-min-microvolt = <700000>;
283         regulator-max-microvolt = <1100000>;
284         regulator-always-on;
285         regulator-name = "vdd-cpu-B";
286 };
287
288 &reg_dcdc4 {
289         regulator-min-microvolt = <700000>;
290         regulator-max-microvolt = <1100000>;
291         regulator-name = "vdd-gpu";
292 };
293
294 &reg_dcdc5 {
295         regulator-min-microvolt = <1200000>;
296         regulator-max-microvolt = <1500000>;
297         regulator-always-on;
298         regulator-name = "vcc-dram";
299 };
300
301 &reg_dcdc6 {
302         regulator-min-microvolt = <900000>;
303         regulator-max-microvolt = <900000>;
304         regulator-always-on;
305         regulator-name = "vdd-sys";
306 };
307
308 &reg_dldo1 {
309         regulator-min-microvolt = <3100000>;
310         regulator-max-microvolt = <3100000>;
311         regulator-name = "vcc-wifi-io";
312 };
313
314 &reg_dldo2 {
315         regulator-min-microvolt = <2800000>;
316         regulator-max-microvolt = <4200000>;
317         regulator-name = "vcc-mipi";
318 };
319
320 &reg_dldo3 {
321         regulator-min-microvolt = <2800000>;
322         regulator-max-microvolt = <2800000>;
323         regulator-name = "vdd-csi";
324 };
325
326 &reg_dldo4 {
327         regulator-min-microvolt = <2800000>;
328         regulator-max-microvolt = <2800000>;
329         regulator-name = "avdd-csi";
330 };
331
332 &reg_drivevbus {
333         regulator-name = "usb0-vbus";
334         status = "okay";
335 };
336
337 &reg_eldo1 {
338         regulator-min-microvolt = <1200000>;
339         regulator-max-microvolt = <1800000>;
340         regulator-name = "dvdd-csi-r";
341 };
342
343 &reg_eldo2 {
344         regulator-min-microvolt = <1800000>;
345         regulator-max-microvolt = <1800000>;
346         regulator-name = "vcc-dsi";
347 };
348
349 &reg_eldo3 {
350         regulator-min-microvolt = <1200000>;
351         regulator-max-microvolt = <1800000>;
352         regulator-name = "dvdd-csi-f";
353 };
354
355 &reg_fldo1 {
356         regulator-min-microvolt = <1200000>;
357         regulator-max-microvolt = <1200000>;
358         regulator-name = "vcc-hsic";
359 };
360
361 &reg_fldo2 {
362         regulator-min-microvolt = <700000>;
363         regulator-max-microvolt = <1100000>;
364         regulator-always-on;
365         regulator-name = "vdd-cpus";
366 };
367
368 &reg_ldo_io0 {
369         regulator-min-microvolt = <3100000>;
370         regulator-max-microvolt = <3100000>;
371         regulator-name = "vcc-ctp";
372         status = "okay";
373 };
374
375 &reg_ldo_io1 {
376         regulator-min-microvolt = <3100000>;
377         regulator-max-microvolt = <3100000>;
378         regulator-name = "vcc-vb";
379         status = "okay";
380 };
381
382 &reg_sw {
383         regulator-min-microvolt = <3100000>;
384         regulator-max-microvolt = <3100000>;
385         regulator-name = "vcc-lcd";
386 };
387
388 &tcon0 {
389         pinctrl-names = "default";
390         pinctrl-0 = <&lcd_lvds_pins>;
391 };
392
393 &tcon0_out {
394         tcon0_out_lcd: endpoint@0 {
395                 reg = <0>;
396                 remote-endpoint = <&panel_input>;
397         };
398 };
399
400 &uart0 {
401         pinctrl-names = "default";
402         pinctrl-0 = <&uart0_pb_pins>;
403         status = "okay";
404 };
405
406 /* There's the BT part of the AP6210 connected to that UART */
407 &uart1 {
408         pinctrl-names = "default";
409         pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
410         status = "okay";
411 };
412
413 &usb_otg {
414         dr_mode = "otg";
415         status = "okay";
416 };
417
418 &usbphy {
419         usb0_id_det-gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */
420         usb0_vbus-supply = <&reg_drivevbus>;
421         usb1_vbus_supply = <&reg_vmain>;
422         usb2_vbus_supply = <&reg_vmain>;
423         status = "okay";
424 };