Merge tag 'media/v5.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
[linux-2.6-microblaze.git] / arch / arm / boot / dts / ste-ux500-samsung-golden.dts
1 // SPDX-License-Identifier: GPL-2.0-only
2 /dts-v1/;
3
4 #include "ste-db8500.dtsi"
5 #include "ste-ab8505.dtsi"
6 #include "ste-dbx5x0-pinctrl.dtsi"
7 #include <dt-bindings/gpio/gpio.h>
8 #include <dt-bindings/input/input.h>
9 #include <dt-bindings/interrupt-controller/irq.h>
10
11 /*
12  * Note: This device tree cannot be booted directly with the Samsung bootloader.
13  * You need an intermediate, device-tree compatible bootloader
14  * that locks the L2 cache. Otherwise the kernel will crash after decompression.
15  *
16  * There is a port of (mainline) U-Boot, see
17  * https://wiki.postmarketos.org/wiki/ST-Ericsson_NovaThor_U8500#U-Boot
18  */
19 / {
20         model = "Samsung Galaxy S III mini (GT-I8190)";
21         compatible = "samsung,golden", "st-ericsson,u8500";
22
23         chosen {
24                 stdout-path = &serial2;
25         };
26
27         i2c-gpio-1 {
28                 compatible = "i2c-gpio";
29                 sda-gpios = <&gpio4 24 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
30                 scl-gpios = <&gpio4 23 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
31
32                 pinctrl-names = "default";
33                 pinctrl-0 = <&i2c_gpio_1_default>;
34
35                 #address-cells = <1>;
36                 #size-cells = <0>;
37
38                 magnetometer@c {
39                         compatible = "alps,hscdtd008a";
40                         reg = <0x0c>;
41
42                         avdd-supply = <&ab8500_ldo_aux1_reg>;
43                         dvdd-supply = <&ab8500_ldo_aux8_reg>;
44                 };
45         };
46
47         soc {
48                 /* External Micro SD card slot */
49                 sdi0_per1@80126000 {
50                         status = "okay";
51
52                         arm,primecell-periphid = <0x10480180>;
53                         max-frequency = <100000000>;
54                         bus-width = <4>;
55
56                         non-removable;
57                         /*
58                          * Unfortunately, there is no way to enable the UHS
59                          * modes due to a limitation of the SD level translator:
60                          * It will either translate to 2.9V or disconnect the
61                          * DATA lines, so switching to 1.8V signal voltage fails.
62                          */
63                         cap-sd-highspeed;
64                         cap-mmc-highspeed;
65                         st,sig-pin-fbclk;
66                         full-pwr-cycle;
67
68                         vmmc-supply = <&ab8500_ldo_aux3_reg>;
69                         vqmmc-supply = <&sd_level_translator>;
70
71                         pinctrl-names = "default", "sleep";
72                         pinctrl-0 = <&mc0_a_2_default>;
73                         pinctrl-1 = <&mc0_a_2_sleep>;
74                 };
75
76                 /* WLAN SDIO */
77                 sdi1_per2@80118000 {
78                         status = "okay";
79
80                         arm,primecell-periphid = <0x10480180>;
81                         max-frequency = <50000000>;
82                         bus-width = <4>;
83
84                         non-removable;
85                         cap-sd-highspeed;
86
87                         vmmc-supply = <&wl_reg_on>;
88
89                         pinctrl-names = "default", "sleep";
90                         pinctrl-0 = <&mc1_a_2_default>;
91                         pinctrl-1 = <&mc1_a_2_sleep>;
92
93                         #address-cells = <1>;
94                         #size-cells = <0>;
95
96                         wifi@1 {
97                                 compatible = "brcm,bcm4329-fmac";
98                                 reg = <1>;
99
100                                 /* GPIO216 (WLAN_HOST_WAKE) */
101                                 interrupt-parent = <&gpio6>;
102                                 interrupts = <24 IRQ_TYPE_EDGE_FALLING>;
103                                 interrupt-names = "host-wake";
104
105                                 pinctrl-names = "default";
106                                 pinctrl-0 = <&wlan_default>;
107                         };
108                 };
109
110                 /* eMMC */
111                 sdi2_per3@80005000 {
112                         status = "okay";
113
114                         arm,primecell-periphid = <0x10480180>;
115                         max-frequency = <100000000>;
116                         bus-width = <8>;
117
118                         non-removable;
119                         cap-mmc-highspeed;
120                         mmc-ddr-1_8v;
121
122                         vmmc-supply = <&vmem_3v3>;
123
124                         pinctrl-names = "default", "sleep";
125                         pinctrl-0 = <&mc2_a_1_default>;
126                         pinctrl-1 = <&mc2_a_1_sleep>;
127                 };
128
129                 /* BT UART */
130                 uart@80120000 {
131                         status = "okay";
132
133                         pinctrl-names = "default", "sleep";
134                         pinctrl-0 = <&u0_a_1_default>;
135                         pinctrl-1 = <&u0_a_1_sleep>;
136
137                         bluetooth {
138                                 compatible = "brcm,bcm4330-bt";
139                                 /* GPIO222 (BT_VREG_ON) */
140                                 shutdown-gpios = <&gpio6 30 GPIO_ACTIVE_HIGH>;
141                                 /* GPIO199 (BT_WAKE) */
142                                 device-wakeup-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
143                                 /* GPIO97 (BT_HOST_WAKE) */
144                                 host-wakeup-gpios = <&gpio3 1 GPIO_ACTIVE_HIGH>;
145
146                                 pinctrl-names = "default";
147                                 pinctrl-0 = <&bluetooth_default>;
148                         };
149                 };
150
151                 /* GPF UART */
152                 uart@80121000 {
153                         status = "okay";
154
155                         pinctrl-names = "default", "sleep";
156                         pinctrl-0 = <&u1rxtx_a_1_default &u1ctsrts_a_1_default>;
157                         pinctrl-1 = <&u1rxtx_a_1_sleep &u1ctsrts_a_1_sleep>;
158                 };
159
160                 /* Debugging console UART */
161                 uart@80007000 {
162                         status = "okay";
163
164                         pinctrl-names = "default", "sleep";
165                         pinctrl-0 = <&u2rxtx_c_1_default>;
166                         pinctrl-1 = <&u2rxtx_c_1_sleep>;
167                 };
168
169                 i2c@80004000 {
170                         status = "okay";
171
172                         pinctrl-names = "default", "sleep";
173                         pinctrl-0 = <&i2c0_a_1_default>;
174                         pinctrl-1 = <&i2c0_a_1_sleep>;
175
176                         proximity@44 {
177                                 compatible = "sharp,gp2ap002s00f";
178                                 reg = <0x44>;
179
180                                 /* GPIO146 (PS_INT) */
181                                 interrupt-parent = <&gpio4>;
182                                 interrupts = <18 IRQ_TYPE_EDGE_FALLING>;
183
184                                 vdd-supply = <&ab8500_ldo_aux1_reg>;
185                                 vio-supply = <&ab8500_ldo_aux8_reg>;
186
187                                 pinctrl-names = "default";
188                                 pinctrl-0 = <&proximity_default>;
189
190                                 sharp,proximity-far-hysteresis = <0x40>;
191                                 sharp,proximity-close-hysteresis = <0x0f>;
192                         };
193                 };
194
195                 i2c@80128000 {
196                         status = "okay";
197
198                         pinctrl-names = "default", "sleep";
199                         pinctrl-0 = <&i2c2_b_2_default>;
200                         pinctrl-1 = <&i2c2_b_2_sleep>;
201
202                         imu@68 {
203                                 compatible = "invensense,mpu6050";
204                                 reg = <0x68>;
205
206                                 /* GPIO206 (ACC_INT) */
207                                 interrupt-parent = <&gpio6>;
208                                 interrupts = <14 IRQ_TYPE_EDGE_RISING>;
209
210                                 mount-matrix = "0", "1", "0",
211                                               "-1", "0", "0",
212                                                "0", "0", "1";
213
214                                 vdd-supply = <&ab8500_ldo_aux1_reg>;
215                                 vddio-supply = <&ab8500_ldo_aux8_reg>;
216
217                                 pinctrl-names = "default";
218                                 pinctrl-0 = <&imu_default>;
219                         };
220                 };
221
222                 i2c@80110000 {
223                         status = "okay";
224
225                         pinctrl-names = "default", "sleep";
226                         pinctrl-0 = <&i2c3_c_2_default>;
227                         pinctrl-1 = <&i2c3_c_2_sleep>;
228
229                         touchscreen@4a {
230                                 compatible = "atmel,maxtouch";
231                                 reg = <0x4a>;
232
233                                 /* GPIO218 (TSP_INT_1V8) */
234                                 interrupt-parent = <&gpio6>;
235                                 interrupts = <26 IRQ_TYPE_EDGE_FALLING>;
236
237                                 pinctrl-names = "default";
238                                 pinctrl-0 = <&tsp_default>;
239                         };
240                 };
241
242                 prcmu@80157000 {
243                         ab8505 {
244                                 ab8500_usb {
245                                         pinctrl-names = "default", "sleep";
246                                         pinctrl-0 = <&usb_a_1_default>;
247                                         pinctrl-1 = <&usb_a_1_sleep>;
248                                 };
249
250                                 ab8505-regulators {
251                                         ab8500_ldo_aux1 {
252                                                 regulator-name = "sensor_3v";
253                                                 regulator-min-microvolt = <3000000>;
254                                                 regulator-max-microvolt = <3000000>;
255                                         };
256
257                                         ab8500_ldo_aux2 {
258                                                 regulator-name = "vreg_tsp_a3v3";
259                                                 regulator-min-microvolt = <3300000>;
260                                                 regulator-max-microvolt = <3300000>;
261                                                 regulator-always-on; /* FIXME */
262                                         };
263
264                                         ab8500_ldo_aux3 {
265                                                 regulator-name = "vdd_tf_2v91";
266                                         };
267
268                                         ab8500_ldo_aux4 {
269                                                 regulator-name = "key_led_3.3v";
270                                                 regulator-min-microvolt = <3300000>;
271                                                 regulator-max-microvolt = <3300000>;
272                                         };
273
274                                         ab8500_ldo_aux5 {
275                                                 regulator-name = "vreg_tsp_1v8";
276                                                 regulator-min-microvolt = <1800000>;
277                                                 regulator-max-microvolt = <1800000>;
278                                                 regulator-always-on; /* FIXME */
279                                         };
280
281                                         ab8500_ldo_aux6 {
282                                                 regulator-name = "touch_key_2.2v";
283                                                 regulator-min-microvolt = <2200000>;
284                                                 regulator-max-microvolt = <2200000>;
285                                         };
286
287                                         ab8500_ldo_aux8 {
288                                                 regulator-name = "sensor_1v8";
289                                         };
290                                 };
291                         };
292                 };
293         };
294
295         gpio-keys {
296                 compatible = "gpio-keys";
297
298                 pinctrl-names = "default";
299                 pinctrl-0 = <&gpio_keys_default>;
300
301                 label = "GPIO Buttons";
302
303                 volume-up {
304                         label = "Volume Up";
305                         /* GPIO67 (VOL_UP) */
306                         gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
307                         linux,code = <KEY_VOLUMEUP>;
308                 };
309
310                 volume-down {
311                         label = "Volume Down";
312                         /* GPIO92 (VOL_DOWN) */
313                         gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
314                         linux,code = <KEY_VOLUMEDOWN>;
315                 };
316
317                 home {
318                         label = "Home";
319                         /* GPIO91 (HOME_KEY) */
320                         gpios = <&gpio2 27 GPIO_ACTIVE_LOW>;
321                         linux,code = <KEY_HOMEPAGE>;
322                 };
323         };
324
325         vibrator {
326                 compatible = "gpio-vibrator";
327                 /* GPIO195 (MOT_EN) */
328                 enable-gpios = <&gpio6 3 GPIO_ACTIVE_HIGH>;
329
330                 pinctrl-names = "default";
331                 pinctrl-0 = <&vibrator_default>;
332         };
333
334         /* External LDO for eMMC */
335         vmem_3v3: regulator-vmem {
336                 compatible = "regulator-fixed";
337
338                 regulator-name = "vmem_3v3";
339                 regulator-min-microvolt = <3300000>;
340                 regulator-max-microvolt = <3300000>;
341                 regulator-boot-on;
342
343                 startup-delay-us = <200>;
344
345                 /* GPIO223 (MEM_LDO_EN) */
346                 gpio = <&gpio6 31 GPIO_ACTIVE_HIGH>;
347                 enable-active-high;
348
349                 pinctrl-names = "default";
350                 pinctrl-0 = <&mem_ldo_default>;
351         };
352
353         /* TI TXS0206-29 level translator for 2.9 V */
354         sd_level_translator: regulator-sd-level-translator {
355                 compatible = "regulator-fixed";
356
357                 regulator-name = "sd-level-translator";
358                 regulator-min-microvolt = <2900000>;
359                 regulator-max-microvolt = <2900000>;
360
361                 startup-delay-us = <200>;
362
363                 /* GPIO87 (TXS0206-29_EN) */
364                 gpios = <&gpio2 23 GPIO_ACTIVE_HIGH>;
365                 enable-active-high;
366
367                 pinctrl-names = "default";
368                 pinctrl-0 = <&sd_level_translator_default>;
369         };
370
371         /*
372          * WL_REG_ON takes WLAN out of reset and enables the internal regulators.
373          * The voltage specified here is only used to determine the OCR mask,
374          * the BCM chip is actually connected directly to VBAT.
375          */
376         wl_reg_on: regulator-wl-reg-on {
377                 compatible = "regulator-fixed";
378
379                 regulator-name = "wl-reg-on";
380                 regulator-min-microvolt = <3000000>;
381                 regulator-max-microvolt = <3000000>;
382
383                 startup-delay-us = <100000>;
384
385                 /* GPIO215 (WLAN_EN) */
386                 gpio = <&gpio6 23 GPIO_ACTIVE_HIGH>;
387                 enable-active-high;
388
389                 pinctrl-names = "default";
390                 pinctrl-0 = <&wlan_en_default>;
391         };
392 };
393
394 &pinctrl {
395         gpio-keys {
396                 gpio_keys_default: gpio_keys_default {
397                         golden_cfg1 {
398                                 pins = "GPIO67",        /* VOL_UP */
399                                        "GPIO91",        /* HOME_KEY */
400                                        "GPIO92";        /* VOL_DOWN */
401                                 ste,config = <&gpio_in_pu>;
402                         };
403                 };
404         };
405
406         i2c-gpio-1 {
407                 i2c_gpio_1_default: i2c_gpio_1 {
408                         golden_cfg1 {
409                                 pins = "GPIO151",       /* COMP_SCL */
410                                        "GPIO152";       /* COMP_SDA */
411                                 ste,config = <&gpio_in_nopull>;
412                         };
413                 };
414         };
415
416         sdi0 {
417                 sd_level_translator_default: sd_level_translator_default {
418                         golden_cfg1 {
419                                 pins = "GPIO87_B3";     /* TXS0206-29_EN */
420                                 ste,config = <&gpio_out_lo>;
421                         };
422                 };
423         };
424
425         sdi2 {
426                 mem_ldo_default: mem_ldo_default {
427                         golden_cfg1 {
428                                 pins = "GPIO223_AH9";   /* MEM_LDO_EN */
429                                 ste,config = <&gpio_out_hi>;
430                         };
431                 };
432         };
433
434         proximity {
435                 proximity_default: proximity_default {
436                         golden_cfg1 {
437                                 pins = "GPIO146_D13";   /* PS_INT */
438                                 ste,config = <&gpio_in_nopull>;
439                         };
440                 };
441         };
442
443         imu {
444                 imu_default: imu_default {
445                         golden_cfg1 {
446                                 pins = "GPIO206_AG24";  /* ACC_INT */
447                                 ste,config = <&gpio_in_pd>;
448                         };
449                 };
450         };
451
452         tsp {
453                 tsp_default: tsp_default {
454                         golden_cfg1 {
455                                 pins = "GPIO218_AH11";  /* TSP_INT_1V8 */
456                                 ste,config = <&gpio_in_nopull>;
457                         };
458                 };
459         };
460
461         wlan {
462                 wlan_default: wlan_default {
463                         golden_cfg1 {
464                                 pins = "GPIO216_AG12";  /* WLAN_HOST_WAKE */
465                                 ste,config = <&gpio_in_pd>;
466                         };
467                 };
468
469                 wlan_en_default: wlan_en_default {
470                         golden_cfg1 {
471                                 pins = "GPIO215_AH13";  /* WLAN_EN */
472                                 ste,config = <&gpio_out_lo>;
473                         };
474                 };
475         };
476
477         bluetooth {
478                 bluetooth_default: bluetooth_default {
479                         golden_cfg1 {
480                                 pins = "GPIO199_AH23",  /* BT_WAKE */
481                                        "GPIO222_AJ9";   /* BT_VREG_ON */
482                                 ste,config = <&gpio_out_lo>;
483                         };
484                         golden_cfg2 {
485                                 pins = "GPIO97_D9";     /* BT_HOST_WAKE */
486                                 ste,config = <&gpio_in_nopull>;
487                         };
488                 };
489         };
490
491         vibrator {
492                 vibrator_default: vibrator_default {
493                         golden_cfg1 {
494                                 pins = "GPIO195_AG28";  /* MOT_EN */
495                                 ste,config = <&gpio_out_lo>;
496                         };
497                 };
498         };
499 };
500
501 &ab8505_gpio {
502         /* Hog a few default settings */
503         pinctrl-names = "default";
504         pinctrl-0 = <&gpio_default>;
505
506         gpio {
507                 gpio_default: gpio_default {
508                         golden_mux {
509                                 /* Change unused pins to GPIO mode */
510                                 function = "gpio";
511                                 groups = "gpio3_a_1",   /* default: SysClkReq4 */
512                                          "gpio14_a_1";  /* default: PWMOut1 */
513                         };
514                         golden_cfg1 {
515                                 pins = "GPIO11_B17", "GPIO13_D17", "GPIO50_L4";
516                                 bias-disable;
517                         };
518                 };
519         };
520 };