blob: d6f6ac04a48a73b27bd4d10209ad571a4ca29f45 [file] [log] [blame]
Linus Walleij2118c8f2020-03-07 20:36:27 +01001// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Devicetree for the Samsung XCover 2 GT-S7710 also known as Skomer.
4 */
5
6/dts-v1/;
7#include "ste-db8500.dtsi"
8#include "ste-ab8505.dtsi"
9#include "ste-dbx5x0-pinctrl.dtsi"
10#include <dt-bindings/gpio/gpio.h>
11#include <dt-bindings/input/input.h>
12#include <dt-bindings/interrupt-controller/irq.h>
13
14/ {
15 model = "Samsung XCover 2 (GT-S7710)";
16 compatible = "samsung,skomer", "st-ericsson,u8500";
17
18 chosen {
19 stdout-path = &serial2;
20 };
21
22 /* TI TXS0206 level translator for 2.9 V */
23 sd_level_translator: regulator-gpio {
24 compatible = "regulator-fixed";
25
26 /* GPIO87 EN */
27 gpios = <&gpio2 23 GPIO_ACTIVE_HIGH>;
28 enable-active-high;
29
30 regulator-name = "sd-level-translator";
31 regulator-min-microvolt = <2900000>;
32 regulator-max-microvolt = <2900000>;
33 regulator-type = "voltage";
34
35 startup-delay-us = <200>;
36
37 pinctrl-names = "default";
38 pinctrl-0 = <&sd_level_translator_default>;
39 };
40
41 /* External LDO MIC5366-3.3YMT for eMMC */
42 ldo_3v3_reg: regulator-gpio-ldo-3v3 {
43 compatible = "regulator-fixed";
44 regulator-name = "en-3v3-fixed-supply";
45 regulator-min-microvolt = <3300000>;
46 regulator-max-microvolt = <3300000>;
47 gpio = <&gpio6 31 GPIO_ACTIVE_HIGH>;
48 startup-delay-us = <5000>;
49 enable-active-high;
50 pinctrl-names = "default";
51 pinctrl-0 = <&emmc_ldo_en_default_mode>;
52 };
53
54 wlan_en: regulator-gpio-wlan-en {
55 compatible = "regulator-fixed";
56 regulator-name = "wl-reg-on";
57 regulator-min-microvolt = <3000000>;
58 regulator-max-microvolt = <3000000>;
59 startup-delay-us = <200000>;
60 /* GPIO215 WLAN_EN */
61 gpio = <&gpio6 23 GPIO_ACTIVE_HIGH>;
62 enable-active-high;
63 pinctrl-names = "default";
64 pinctrl-0 = <&wlan_en_default_mode>;
65 };
66
67 vibrator {
68 compatible = "gpio-vibrator";
69 enable-gpios = <&gpio6 3 GPIO_ACTIVE_HIGH>;
70 pinctrl-names = "default";
71 pinctrl-0 = <&vibrator_default>;
72 };
73
74 gpio-keys {
75 compatible = "gpio-keys";
76 pinctrl-names = "default";
77 pinctrl-0 = <&gpio_keys_default_mode>;
78
79 button-home {
80 linux,code = <KEY_HOME>;
81 label = "HOME";
82 /* GPIO91 */
83 gpios = <&gpio2 27 GPIO_ACTIVE_LOW>;
84 };
85 button-volup {
86 linux,code = <KEY_VOLUMEUP>;
87 label = "VOL+";
88 /* GPIO67 */
89 gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
90 };
91 button-voldown {
92 linux,code = <KEY_VOLUMEDOWN>;
93 label = "VOL-";
94 /* GPIO92 */
95 gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
96 };
97 button-menu {
98 linux,code = <KEY_MENU>;
99 label = "MENU";
100 /* GPIO204 */
101 gpios = <&gpio6 12 GPIO_ACTIVE_LOW>;
102 };
103 button-back {
104 linux,code = <KEY_BACK>;
105 label = "BACK";
106 /* GPIO205 */
107 gpios = <&gpio6 13 GPIO_ACTIVE_LOW>;
108 };
109 };
110
111 /*
112 * FIXME: this is not quite GPIO backlight. This is a
113 * KTD253 one-wire GPIO-controlled backlight. It can
114 * work as a GPIO backlight.
115 */
116 gpio_bl: backlight {
117 compatible = "gpio-backlight";
118 /* GPIO 69 */
119 gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>;
120 pinctrl-names = "default";
121 pinctrl-0 = <&gpio_backlight_default_mode>;
122 };
123
124 i2c-gpio-0 {
125 compatible = "i2c-gpio";
126 sda-gpios = <&gpio4 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
127 scl-gpios = <&gpio4 15 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
128 pinctrl-names = "default";
129 pinctrl-0 = <&i2c_gpio_0_default>;
130 #address-cells = <1>;
131 #size-cells = <0>;
132 /* TODO: this should be used by the NCP6914 Camera power management unit */
133 };
134
135 i2c-gpio-1 {
136 compatible = "i2c-gpio";
137 sda-gpios = <&gpio4 24 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
138 scl-gpios = <&gpio4 23 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
139 pinctrl-names = "default";
140 pinctrl-0 = <&i2c_gpio_1_default>;
141 #address-cells = <1>;
142 #size-cells = <0>;
Linus Walleij3c278a42020-04-30 17:02:45 +0200143 magnetometer@c {
144 compatible = "alps,hscdtd008a";
145 reg = <0x0c>;
146 avdd-supply = <&ab8500_ldo_aux1_reg>;
147 dvdd-supply = <&ab8500_ldo_aux8_reg>;
148 };
Linus Walleij2118c8f2020-03-07 20:36:27 +0100149 };
150
151 soc {
152 // External Micro SD slot
153 sdi0_per1@80126000 {
154 arm,primecell-periphid = <0x10480180>;
155 max-frequency = <100000000>;
156 bus-width = <4>;
157 cap-sd-highspeed;
158 cap-mmc-highspeed;
159 /* All direction control is used */
160 st,sig-dir-cmd;
161 st,sig-dir-dat0;
162 st,sig-dir-dat2;
163 st,sig-dir-dat31;
164 st,sig-pin-fbclk;
165 full-pwr-cycle;
166 vmmc-supply = <&ab8500_ldo_aux3_reg>;
167 vqmmc-supply = <&sd_level_translator>;
168 pinctrl-names = "default", "sleep";
169 pinctrl-0 = <&mc0_a_1_default>;
170 pinctrl-1 = <&mc0_a_1_sleep>;
171 status = "okay";
172 };
173
174 // WLAN SDIO channel
175 sdi1_per2@80118000 {
176 arm,primecell-periphid = <0x10480180>;
177 max-frequency = <50000000>;
178 bus-width = <4>;
179 non-removable;
180 cap-sd-highspeed;
181 vmmc-supply = <&wlan_en>;
182 pinctrl-names = "default", "sleep";
183 pinctrl-0 = <&mc1_a_2_default>;
184 pinctrl-1 = <&mc1_a_2_sleep>;
185 status = "okay";
186 #address-cells = <1>;
187 #size-cells = <0>;
188
189 wifi@1 {
190 compatible = "brcm,bcm4329-fmac";
191 reg = <1>;
192 /* GPIO216 WL_HOST_WAKE */
193 interrupt-parent = <&gpio6>;
194 interrupts = <24 IRQ_TYPE_EDGE_FALLING>;
195 interrupt-names = "host-wake";
196 pinctrl-names = "default";
197 pinctrl-0 = <&wlan_default_mode>;
198 };
199 };
200
201 // eMMC
202 sdi2_per3@80005000 {
203 arm,primecell-periphid = <0x10480180>;
204 max-frequency = <100000000>;
205 bus-width = <8>;
206 non-removable;
207 cap-mmc-highspeed;
208 mmc-ddr-1_8v;
209 vmmc-supply = <&ldo_3v3_reg>;
210 pinctrl-names = "default", "sleep";
211 pinctrl-0 = <&mc2_a_1_default>;
212 pinctrl-1 = <&mc2_a_1_sleep>;
213
214 status = "okay";
215 };
216
217 /* GBF (Bluetooth) UART */
218 uart@80120000 {
219 pinctrl-names = "default", "sleep";
220 pinctrl-0 = <&u0_a_1_default>;
221 pinctrl-1 = <&u0_a_1_sleep>;
222 status = "okay";
223
224 /* FIXME: not quite working yet, probably needs regulators */
225 bluetooth {
226 compatible = "brcm,bcm4330-bt";
227 shutdown-gpios = <&gpio6 30 GPIO_ACTIVE_HIGH>;
228 device-wakeup-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
229 host-wakeup-gpios = <&gpio3 1 GPIO_ACTIVE_HIGH>;
230 pinctrl-names = "default";
231 pinctrl-0 = <&bluetooth_default_mode>;
232 };
233 };
234
235 /* GPF UART */
236 uart@80121000 {
237 status = "okay";
238 pinctrl-names = "default", "sleep";
239 pinctrl-0 = <&u1rxtx_a_1_default &u1ctsrts_a_1_default>;
240 pinctrl-1 = <&u1rxtx_a_1_sleep &u1ctsrts_a_1_sleep>;
241 };
242
243 /* Debugging console UART connected to AB8505 USB */
244 uart@80007000 {
245 status = "okay";
246 pinctrl-names = "default", "sleep";
247 pinctrl-0 = <&u2rxtx_c_1_default>;
248 pinctrl-1 = <&u2rxtx_c_1_sleep>;
249 };
250
251 prcmu@80157000 {
252 ab8505 {
253 ab8500_usb {
254 pinctrl-names = "default", "sleep";
255 pinctrl-0 = <&usb_a_1_default>;
256 pinctrl-1 = <&usb_a_1_sleep>;
257 };
258
259 ab8505-regulators {
260 ab8500_ldo_aux1 {
261 /* Used for VDD for sensors */
262 regulator-name = "AUX1";
263 regulator-min-microvolt = <3000000>;
264 regulator-max-microvolt = <3300000>;
265 };
266
267 ab8500_ldo_aux2 {
268 /* Supplies the Cypress TMA140 touchscreen only with 3.3V */
269 regulator-name = "AUX2";
270 regulator-min-microvolt = <3300000>;
271 regulator-max-microvolt = <3300000>;
272 };
273
274 ab8500_ldo_aux3 {
275 /* Used for voltage for external MMC/SD card */
276 regulator-name = "AUX3";
277 regulator-min-microvolt = <1100000>;
278 regulator-max-microvolt = <3300000>;
279 };
280
281 ab8500_ldo_aux4 {
282 regulator-name = "AUX4";
283 /* Hammer to 3.0V for the display */
284 regulator-min-microvolt = <3000000>;
285 regulator-max-microvolt = <3000000>;
286 };
287
288 ab8500_ldo_aux5 {
289 regulator-name = "AUX5";
290 regulator-min-microvolt = <1050000>;
291 regulator-max-microvolt = <2790000>;
292 regulator-always-on;
293 };
294
295 ab8500_ldo_aux6 {
296 regulator-name = "AUX6";
297 /* Hammer to 1.8V for the display */
298 regulator-min-microvolt = <1800000>;
299 regulator-max-microvolt = <1800000>;
300 };
301
302 ab8500_ldo_aux8 {
303 /* Mostly VIO for sensors */
304 regulator-name = "AUX8";
305 };
306 };
307 };
308 };
309
310 /* I2C0 */
311 i2c@80004000 {
312 status = "okay";
313
314 pinctrl-names = "default", "sleep";
315 pinctrl-0 = <&i2c0_a_1_default>;
316 pinctrl-1 = <&i2c0_a_1_sleep>;
317
318 proximity@44 {
319 compatible = "sharp,gp2ap002s00f";
320 clock-frequency = <400000>;
321 reg = <0x44>;
322
323 interrupt-parent = <&gpio4>;
324 interrupts = <18 IRQ_TYPE_EDGE_FALLING>;
325 vdd-supply = <&ab8500_ldo_aux1_reg>;
326 vio-supply = <&ab8500_ldo_aux8_reg>;
327 pinctrl-names = "default";
328 pinctrl-0 = <&gp2ap002_skomer_default>;
329 sharp,proximity-far-hysteresis = /bits/ 8 <0x2f>;
330 sharp,proximity-close-hysteresis = /bits/ 8 <0x0f>;
331 };
332 };
333
334
335 /* I2C2 */
336 i2c@80128000 {
337 status = "okay";
338
339 pinctrl-names = "default", "sleep";
340 pinctrl-0 = <&i2c2_b_2_default>;
341 pinctrl-1 = <&i2c2_b_2_sleep>;
342
343 accel@18 {
344 compatible = "bosch,bma254";
345 clock-frequency = <400000>;
346 reg = <0x18>;
347
348 /* GPIO224 used as "smart alert" interrupt */
349 interrupt-parent = <&gpio7>;
350 interrupts = <0 IRQ_TYPE_EDGE_RISING>;
351
Linus Walleij537b9112020-07-19 22:16:02 +0200352 mount-matrix = "0", "-1", "0",
353 "1", "0", "0",
Linus Walleij2118c8f2020-03-07 20:36:27 +0100354 "0", "0", "1";
355 vdd-supply = <&ab8500_ldo_aux1_reg>;
356 vddio-supply = <&ab8500_ldo_aux8_reg>;
357 pinctrl-names = "default";
358 pinctrl-0 = <&bma254_skomer_default>;
359 };
360 };
361
362 /* I2C3 */
363 i2c@80110000 {
364 status = "okay";
365
366 pinctrl-names = "default", "sleep";
367 pinctrl-0 = <&i2c3_c_2_default>;
368 pinctrl-1 = <&i2c3_c_2_sleep>;
369
Linus Walleij49084712020-05-16 23:29:13 +0200370 /* Cypress CY8CTMA140 touchscreen */
371 touchscreen@20 {
372 compatible = "cypress,cy8ctma140";
373 clock-frequency = <400000>;
374 reg = <0x20>;
375
376 touchscreen-size-x = <480>;
377 touchscreen-size-y = <800>;
378 touchscreen-max-pressure = <255>;
379
380 /* GPIO218 for IRQ */
381 interrupt-parent = <&gpio6>;
382 interrupts = <26 IRQ_TYPE_EDGE_FALLING>;
383
384 /* VDD is "digital supply" nominally 1.71-3.6V */
385 vdd-supply = <&ab8500_ldo_aux2_reg>;
386 /* VCPIN is "analog supply", 2.7-3.6 V */
387 vcpin-supply = <&ab8500_ldo_aux2_reg>;
388
389 pinctrl-names = "default";
390 pinctrl-0 = <&tma140_skomer_default>;
391 };
Linus Walleij2118c8f2020-03-07 20:36:27 +0100392 };
393
394 mcde@a0350000 {
395 status = "okay";
396 pinctrl-names = "default";
397 pinctrl-0 = <&dsi_default_mode>;
398
Linus Walleijfdd41fa2020-03-26 23:25:36 +0100399 dsi-controller@a0351000 {
Linus Walleij2118c8f2020-03-07 20:36:27 +0100400 panel {
401 /* NT35510-based Hydis HVA40WV1 */
402 compatible = "hydis,hva40wv1", "novatek,nt35510";
403 reg = <0>;
404 /* v_lcd_3v0 2.3-4.8V */
405 vdd-supply = <&ab8500_ldo_aux4_reg>;
406 /* v_lcd_1v8 1.65-3.3V */
407 vddi-supply = <&ab8500_ldo_aux6_reg>;
408 /* GPIO 139 */
409 reset-gpios = <&gpio4 11 GPIO_ACTIVE_LOW>;
410 pinctrl-names = "default";
411 pinctrl-0 = <&display_default_mode>;
412 backlight = <&gpio_bl>;
413 };
414 };
415 };
416 };
417};
418
419&pinctrl {
420 /*
421 * This extends the MC0 default config to include DAT32DIR
422 * which is used by this machine. If we don't do this the
423 * SD card does not work.
424 */
425 sdi0 {
426 mc0_a_1_default {
427 default_mux {
428 function = "mc0";
429 /* This machine uses the DAT31 pin */
430 groups = "mc0_a_1", "mc0dat31dir_a_1";
431 };
432 default_cfg5 {
433 pins = "GPIO21_AB3"; /* DAT31DIR */
434 ste,config = <&out_hi>;
435 };
436 };
437 };
438
439 mcde {
440 dsi_default_mode: dsi_default {
441 default_mux1 {
442 /* Mux in VSI0 used for DSI TE */
443 function = "lcd";
444 groups = "lcdvsi0_a_1"; /* VSI0 for LCD */
445 };
446 default_cfg1 {
447 pins = "GPIO68_E1"; /* VSI0 */
448 ste,config = <&in_nopull>;
449 };
450 };
451 };
452
453 /* Two GPIO lines used by the display */
454 display {
455 display_default_mode: display_default {
456 skomer_cfg1 {
457 /*
458 * OLED DETECT or check_pba, this appears to be high
459 * on "PBA" which I guess is "prototype board A".
460 */
461 pins = "GPIO93_B7";
462 ste,config = <&gpio_in_nopull>;
463 };
464 skomer_cfg2 {
465 pins = "GPIO139_C9";
466 /*
467 * MIPI_DSI0_RESET_N resets the display, leave high
468 * (de-asserted) so we only assert reset explicitly
469 * from the display driver.
470 */
471 ste,config = <&gpio_out_hi>;
472 };
473 };
474 };
475 backlight {
476 gpio_backlight_default_mode: backlight_default {
477 skomer_cfg1 {
478 pins = "GPIO69_E2"; /* LCD_BL_CTRL */
479 ste,config = <&gpio_out_lo>;
480 };
481 };
482 };
483 /* GPIO that enables the 2.9V SD card level translator */
484 sd-level-translator {
485 sd_level_translator_default: sd_level_translator_default {
486 /* level shifter on GPIO87 */
487 skomer_cfg1 {
488 pins = "GPIO87_B3";
489 ste,config = <&gpio_out_hi>;
490 };
491 };
492 };
493 /* GPIO that enables the LDO regulator for the eMMC */
494 emmc-ldo {
495 emmc_ldo_en_default_mode: emmc_ldo_default {
496 /* LDO enable on GPIO223 */
497 skomer_cfg1 {
498 pins = "GPIO223_AH9";
499 ste,config = <&gpio_out_hi>;
500 };
501 };
502 };
503 /* GPIO keys */
504 gpio-keys {
505 gpio_keys_default_mode: gpio_keys_default {
506 skomer_cfg1 {
507 pins = "GPIO67_G2", /* VOL UP */
508 "GPIO91_B6", /* HOME */
509 "GPIO92_D6", /* VOL DOWN */
510 "GPIO204_AF23", /* MENU */
511 "GPIO205_AG23"; /* BACK */
512 ste,config = <&gpio_in_pu>;
513 };
514 };
515 };
516 /* Interrupt line for BMA254 */
517 bma254 {
518 bma254_skomer_default: bma254_skomer {
519 skomer_cfg1 {
520 pins = "GPIO224_AG9";
521 ste,config = <&gpio_in_pd>;
522 };
523 };
524 };
525 /* Interrupt line for light/proximity sensor GP2AP002 */
526 gp2ap002 {
527 gp2ap002_skomer_default: gp2ap002_skomer {
528 skomer_cfg1 {
529 pins = "GPIO146_D13";
530 ste,config = <&gpio_in_nopull>;
531 };
532 };
533 };
534 /* GPIO-based I2C bus for NCP6914 */
535 i2c-gpio-0 {
536 i2c_gpio_0_default: i2c_gpio_0 {
537 skomer_cfg1 {
538 pins = "GPIO143_D12", "GPIO144_B13";
539 ste,config = <&gpio_in_nopull>;
540 };
541 };
542 };
543 /* GPIO-based I2C bus for ALPS HSCD compass */
544 i2c-gpio-1 {
545 i2c_gpio_1_default: i2c_gpio_1 {
546 skomer_cfg1 {
547 pins = "GPIO151_B17", "GPIO152_D16";
548 ste,config = <&gpio_in_nopull>;
549 };
550 };
551 };
552 wlan {
553 wlan_default_mode: wlan_default {
554 skomer_cfg1 {
555 pins = "GPIO216_AG12";
556 ste,config = <&gpio_in_pd>;
557 };
558 };
559 wlan_en_default_mode: wlan_en_default {
560 skomer_cfg2 {
561 pins = "GPIO215_AH13";
562 ste,config = <&gpio_out_lo>;
563 };
564 };
565 };
566 bluetooth {
567 bluetooth_default_mode: bluetooth_default {
568 skomer_cfg1 {
569 pins = "GPIO199_AH23", "GPIO222_AJ9";
570 ste,config = <&gpio_out_lo>;
571 };
572 skomer_cfg2 {
573 pins = "GPIO97_D9";
574 ste,config = <&gpio_in_nopull>;
575 };
576 };
577 };
578 vibrator {
579 vibrator_default: vibrator_default {
580 skomer_cfg1 {
581 pins = "GPIO195_AG28"; /* MOT_EN */
582 ste,config = <&gpio_out_lo>;
583 };
584 };
585 };
Linus Walleij49084712020-05-16 23:29:13 +0200586 /* Interrupt line for the Cypress TMA140 touchscreen */
587 touchscreen {
588 tma140_skomer_default: tma140_skomer {
589 skomer_cfg1 {
590 pins = "GPIO218_AH11";
591 ste,config = <&gpio_in_nopull>;
592 };
593 };
594 };
Linus Walleij2118c8f2020-03-07 20:36:27 +0100595};
596
597&ab8505_gpio {
598 /* Hog a few default settings */
599 pinctrl-names = "default";
600 pinctrl-0 = <&gpio_default>;
601
602 gpio {
603 gpio_default: gpio_default {
604 skomer_mux {
605 /* Change unused pins to GPIO mode */
606 function = "gpio";
607 groups = "gpio3_a_1", /* default: SysClkReq4 */
608 "gpio14_a_1"; /* default: PWMOut1 */
609 };
610 skomer_cfg1 {
611 pins = "GPIO11_B17", "GPIO13_D17", "GPIO50_L4";
612 bias-disable;
613 };
614 };
615 };
616};