Merge tag 'microblaze-4.16-rc1' of git://git.monstr.eu/linux-2.6-microblaze
[sfrench/cifs-2.6.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 &de {
132         status = "okay";
133 };
134
135 /*
136  * An USB-2 hub is connected here, which also means we don't need to
137  * enable the OHCI controller.
138  */
139 &ehci0 {
140         status = "okay";
141 };
142
143 /*
144  * There's a modem connected here that needs to be initialised before
145  * being able to be enumerated.
146  */
147 &ehci1 {
148         status = "okay";
149 };
150
151 &mmc0 {
152         vmmc-supply = <&reg_dcdc1>;
153         pinctrl-names = "default";
154         pinctrl-0 = <&mmc0_pins>;
155         cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
156         status = "okay";
157 };
158
159 &mmc1 {
160         mmc-pwrseq = <&wifi_pwrseq>;
161         bus-width = <4>;
162         vmmc-supply = <&reg_dldo1>;
163         vqmmc-supply = <&reg_dldo1>;
164         non-removable;
165         wakeup-source;
166         status = "okay";
167
168         brcmf: wifi@1 {
169                 reg = <1>;
170                 compatible = "brcm,bcm4329-fmac";
171                 interrupt-parent = <&r_pio>;
172                 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 WL_WAKE_UP */
173                 interrupt-names = "host-wake";
174         };
175 };
176
177 &mmc2 {
178         pinctrl-0 = <&mmc2_8bit_emmc_pins>;
179         pinctrl-names = "default";
180         vmmc-supply = <&reg_dcdc1>;
181         vqmmc-supply = <&reg_dcdc1>;
182         bus-width = <8>;
183         non-removable;
184         cap-mmc-hw-reset;
185         status = "okay";
186 };
187
188 &pwm {
189         pinctrl-names = "default";
190         pinctrl-0 = <&pwm_pin>;
191         status = "okay";
192 };
193
194 &r_rsb {
195         status = "okay";
196
197         axp81x: pmic@3a3 {
198                 compatible = "x-powers,axp813";
199                 reg = <0x3a3>;
200                 interrupt-parent = <&r_intc>;
201                 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
202                 swin-supply = <&reg_dcdc1>;
203                 x-powers,drive-vbus-en;
204         };
205
206         ac100: codec@e89 {
207                 compatible = "x-powers,ac100";
208                 reg = <0xe89>;
209
210                 ac100_codec: codec {
211                         compatible = "x-powers,ac100-codec";
212                         interrupt-parent = <&r_pio>;
213                         interrupts = <0 12 IRQ_TYPE_LEVEL_LOW>; /* PL12 */
214                         #clock-cells = <0>;
215                         clock-output-names = "4M_adda";
216                 };
217
218                 ac100_rtc: rtc {
219                         compatible = "x-powers,ac100-rtc";
220                         interrupt-parent = <&r_intc>;
221                         interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
222                         clocks = <&ac100_codec>;
223                         #clock-cells = <1>;
224                         clock-output-names = "cko1_rtc",
225                                              "cko2_rtc",
226                                              "cko3_rtc";
227                 };
228         };
229
230 };
231
232 #include "axp81x.dtsi"
233
234 &reg_aldo1 {
235         regulator-min-microvolt = <1800000>;
236         regulator-max-microvolt = <1800000>;
237         regulator-name = "vcc-1.8";
238 };
239
240 &reg_aldo2 {
241         regulator-min-microvolt = <1800000>;
242         regulator-max-microvolt = <1800000>;
243         regulator-always-on;
244         regulator-name = "vdd-drampll";
245 };
246
247 &reg_aldo3 {
248         regulator-min-microvolt = <3000000>;
249         regulator-max-microvolt = <3000000>;
250         regulator-always-on;
251         regulator-name = "avcc";
252 };
253
254 &reg_dcdc1 {
255         regulator-min-microvolt = <3100000>;
256         regulator-max-microvolt = <3100000>;
257         regulator-always-on;
258         regulator-name = "vcc-io";
259 };
260
261 &reg_dcdc2 {
262         regulator-min-microvolt = <700000>;
263         regulator-max-microvolt = <1100000>;
264         regulator-always-on;
265         regulator-name = "vdd-cpu-A";
266 };
267
268 &reg_dcdc3 {
269         regulator-min-microvolt = <700000>;
270         regulator-max-microvolt = <1100000>;
271         regulator-always-on;
272         regulator-name = "vdd-cpu-B";
273 };
274
275 &reg_dcdc4 {
276         regulator-min-microvolt = <700000>;
277         regulator-max-microvolt = <1100000>;
278         regulator-name = "vdd-gpu";
279 };
280
281 &reg_dcdc5 {
282         regulator-min-microvolt = <1200000>;
283         regulator-max-microvolt = <1500000>;
284         regulator-always-on;
285         regulator-name = "vcc-dram";
286 };
287
288 &reg_dcdc6 {
289         regulator-min-microvolt = <900000>;
290         regulator-max-microvolt = <900000>;
291         regulator-always-on;
292         regulator-name = "vdd-sys";
293 };
294
295 &reg_dldo1 {
296         regulator-min-microvolt = <3100000>;
297         regulator-max-microvolt = <3100000>;
298         regulator-name = "vcc-wifi-io";
299 };
300
301 &reg_dldo2 {
302         regulator-min-microvolt = <2800000>;
303         regulator-max-microvolt = <4200000>;
304         regulator-name = "vcc-mipi";
305 };
306
307 &reg_dldo3 {
308         regulator-min-microvolt = <2800000>;
309         regulator-max-microvolt = <2800000>;
310         regulator-name = "vdd-csi";
311 };
312
313 &reg_dldo4 {
314         regulator-min-microvolt = <2800000>;
315         regulator-max-microvolt = <2800000>;
316         regulator-name = "avdd-csi";
317 };
318
319 &reg_drivevbus {
320         regulator-name = "usb0-vbus";
321         status = "okay";
322 };
323
324 &reg_eldo1 {
325         regulator-min-microvolt = <1200000>;
326         regulator-max-microvolt = <1800000>;
327         regulator-name = "dvdd-csi-r";
328 };
329
330 &reg_eldo2 {
331         regulator-min-microvolt = <1800000>;
332         regulator-max-microvolt = <1800000>;
333         regulator-name = "vcc-dsi";
334 };
335
336 &reg_eldo3 {
337         regulator-min-microvolt = <1200000>;
338         regulator-max-microvolt = <1800000>;
339         regulator-name = "dvdd-csi-f";
340 };
341
342 &reg_fldo1 {
343         regulator-min-microvolt = <1200000>;
344         regulator-max-microvolt = <1200000>;
345         regulator-name = "vcc-hsic";
346 };
347
348 &reg_fldo2 {
349         regulator-min-microvolt = <700000>;
350         regulator-max-microvolt = <1100000>;
351         regulator-always-on;
352         regulator-name = "vdd-cpus";
353 };
354
355 &reg_ldo_io0 {
356         regulator-min-microvolt = <3100000>;
357         regulator-max-microvolt = <3100000>;
358         regulator-name = "vcc-ctp";
359         status = "okay";
360 };
361
362 &reg_ldo_io1 {
363         regulator-min-microvolt = <3100000>;
364         regulator-max-microvolt = <3100000>;
365         regulator-name = "vcc-vb";
366         status = "okay";
367 };
368
369 &reg_sw {
370         regulator-min-microvolt = <3100000>;
371         regulator-max-microvolt = <3100000>;
372         regulator-name = "vcc-lcd";
373 };
374
375 &tcon0 {
376         pinctrl-names = "default";
377         pinctrl-0 = <&lcd_lvds_pins>;
378 };
379
380 &tcon0_out {
381         tcon0_out_lcd: endpoint@0 {
382                 reg = <0>;
383                 remote-endpoint = <&panel_input>;
384         };
385 };
386
387 &uart0 {
388         pinctrl-names = "default";
389         pinctrl-0 = <&uart0_pb_pins>;
390         status = "okay";
391 };
392
393 /* There's the BT part of the AP6210 connected to that UART */
394 &uart1 {
395         pinctrl-names = "default";
396         pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
397         status = "okay";
398 };
399
400 &usb_otg {
401         dr_mode = "otg";
402         status = "okay";
403 };
404
405 &usbphy {
406         usb0_id_det-gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */
407         usb0_vbus-supply = <&reg_drivevbus>;
408         usb1_vbus_supply = <&reg_vmain>;
409         usb2_vbus_supply = <&reg_vmain>;
410         status = "okay";
411 };