ARM: dts: bcm2711-rpi-4-b: Add support for touchscreen touch
[platform/kernel/linux-rpi.git] / arch / arm / boot / dts / bcm2711-rpi-4-b.dts
1 /dts-v1/;
2
3 #include "bcm2711.dtsi"
4 #include "bcm2711-rpi.dtsi"
5 #include "bcm283x-rpi-csi1-2lane.dtsi"
6 #include <dt-bindings/input/input.h>
7
8 / {
9         compatible = "raspberrypi,4-model-b", "brcm,bcm2711";
10         model = "Raspberry Pi 4 Model B";
11
12         memory@0 {
13                 device_type = "memory";
14                 reg = <0x0 0x0 0x0>;
15         };
16
17         chosen {
18                 bootargs = "coherent_pool=1M 8250.nr_uarts=1 cma=64M";
19         };
20
21         aliases {
22                 serial0 = &uart1;
23                 serial1 = &uart0;
24                 mmc0 = &emmc2;
25                 mmc1 = &mmcnr;
26                 mmc2 = &sdhost;
27                 i2c3 = &i2c3;
28                 i2c4 = &i2c4;
29                 i2c5 = &i2c5;
30                 i2c6 = &i2c6;
31                 /delete-property/ ethernet;
32                 /delete-property/ intc;
33                 ethernet0 = &genet;
34         };
35
36         rpi_ft5406: rpi_ft5406 {
37                 compatible = "rpi,rpi-ft5406";
38                 firmware = <&firmware>;
39                 status = "okay";
40         };
41
42         gpio-keys {
43                 compatible = "gpio-keys";
44
45                 key-volume-up {
46                         lable = "volume-up";
47                         linux,code = <KEY_VOLUMEUP>;
48                         gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
49                 };
50
51                 key-volume-down {
52                         lable = "volume-down";
53                         linux,code = <KEY_VOLUMEDOWN>;
54                         gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
55                 };
56
57                 key-fastforward {
58                         lable = "fastforward";
59                         linux,code = <KEY_FASTFORWARD>;
60                         gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
61                 };
62
63                 key-rewind {
64                         lable = "rewind";
65                         linux,code = <KEY_REWIND>;
66                         gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
67                 };
68
69                 key-playpause {
70                         lable = "playpause";
71                         linux,code = <KEY_PLAYPAUSE>;
72                         gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
73                 };
74         };
75 };
76
77 &soc {
78         virtgpio: virtgpio {
79                 compatible = "brcm,bcm2835-virtgpio";
80                 gpio-controller;
81                 #gpio-cells = <2>;
82                 firmware = <&firmware>;
83                 status = "okay";
84         };
85 };
86
87 &mmcnr {
88         pinctrl-names = "default";
89         pinctrl-0 = <&sdio_pins>;
90         bus-width = <4>;
91         status = "okay";
92 };
93
94 &firmware {
95         expgpio: gpio {
96                 compatible = "raspberrypi,firmware-gpio";
97                 gpio-controller;
98                 #gpio-cells = <2>;
99                 gpio-line-names = "BT_ON",
100                                   "WL_ON",
101                                   "PWR_LED_OFF",
102                                   "GLOBAL_RESET",
103                                   "VDD_SD_IO_SEL",
104                                   "CAM_GPIO",
105                                   "",
106                                   "";
107                 status = "okay";
108         };
109 };
110
111 &uart0 {
112         pinctrl-names = "default";
113         pinctrl-0 = <&uart0_ctsrts_gpio30 &uart0_pins &bt_pins>;
114         status = "okay";
115 };
116
117 &uart1 {
118         pinctrl-names = "default";
119         pinctrl-0 = <&uart1_pins>;
120         status = "okay";
121 };
122
123 &spi0 {
124         pinctrl-names = "default";
125         pinctrl-0 = <&spi0_pins &spi0_cs_pins>;
126         cs-gpios = <&gpio 8 1>, <&gpio 7 1>;
127         status = "okay";
128
129         spidev0: spidev@0{
130                 compatible = "spidev";
131                 reg = <0>;      /* CE0 */
132                 #address-cells = <1>;
133                 #size-cells = <0>;
134                 spi-max-frequency = <125000000>;
135         };
136
137         spidev1: spidev@1{
138                 compatible = "spidev";
139                 reg = <1>;      /* CE1 */
140                 #address-cells = <1>;
141                 #size-cells = <0>;
142                 spi-max-frequency = <125000000>;
143         };
144 };
145
146 // =============================================
147 // Board specific stuff here
148
149 / {
150
151         sd_io_1v8_reg: sd_io_1v8_reg {
152                 status = "okay";
153                 compatible = "regulator-gpio";
154                 vin-supply = <&vdd_5v0_reg>;
155                 regulator-name = "vdd-sd-io";
156                 regulator-min-microvolt = <1800000>;
157                 regulator-max-microvolt = <3300000>;
158                 regulator-boot-on;
159                 regulator-always-on;
160                 regulator-settling-time-us = <5000>;
161
162                 gpios = <&expgpio 4 GPIO_ACTIVE_HIGH>;
163                 states = <1800000 0x1
164                           3300000 0x0>;
165         };
166 };
167
168 &sdhost {
169         status = "disabled";
170 };
171
172 &emmc2 {
173         status = "okay";
174         broken-cd;
175         vqmmc-supply = <&sd_io_1v8_reg>;
176 };
177
178 &leds {
179         act_led: act {
180                 label = "led0";
181                 linux,default-trigger = "mmc0";
182                 gpios = <&gpio 42 GPIO_ACTIVE_HIGH>;
183         };
184
185         pwr_led: pwr {
186                 label = "led1";
187                 linux,default-trigger = "default-on";
188                 gpios = <&expgpio 2 GPIO_ACTIVE_LOW>;
189         };
190 };
191
192 &audio {
193         pinctrl-names = "default";
194         pinctrl-0 = <&audio_pins>;
195         status = "okay";
196 };
197
198 &sdhost_gpio48 {
199         brcm,pins = <22 23 24 25 26 27>;
200         brcm,function = <BCM2835_FSEL_ALT0>;
201 };
202
203 &gpio {
204         spi0_pins: spi0_pins {
205                 brcm,pins = <9 10 11>;
206                 brcm,function = <BCM2835_FSEL_ALT0>;
207         };
208
209         spi0_cs_pins: spi0_cs_pins {
210                 brcm,pins = <8 7>;
211                 brcm,function = <BCM2835_FSEL_GPIO_OUT>;
212         };
213
214         spi3_pins: spi3_pins {
215                 brcm,pins = <1 2 3>;
216                 brcm,function = <BCM2835_FSEL_ALT3>;
217         };
218
219         spi3_cs_pins: spi3_cs_pins {
220                 brcm,pins = <0 24>;
221                 brcm,function = <BCM2835_FSEL_GPIO_OUT>;
222         };
223
224         spi4_pins: spi4_pins {
225                 brcm,pins = <5 6 7>;
226                 brcm,function = <BCM2835_FSEL_ALT3>;
227         };
228
229         spi4_cs_pins: spi4_cs_pins {
230                 brcm,pins = <4 25>;
231                 brcm,function = <BCM2835_FSEL_GPIO_OUT>;
232         };
233
234         spi5_pins: spi5_pins {
235                 brcm,pins = <13 14 15>;
236                 brcm,function = <BCM2835_FSEL_ALT3>;
237         };
238
239         spi5_cs_pins: spi5_cs_pins {
240                 brcm,pins = <12 26>;
241                 brcm,function = <BCM2835_FSEL_GPIO_OUT>;
242         };
243
244         spi6_pins: spi6_pins {
245                 brcm,pins = <19 20 21>;
246                 brcm,function = <BCM2835_FSEL_ALT3>;
247         };
248
249         spi6_cs_pins: spi6_cs_pins {
250                 brcm,pins = <18 27>;
251                 brcm,function = <BCM2835_FSEL_GPIO_OUT>;
252         };
253
254         i2c0_pins: i2c0 {
255                 brcm,pins = <0 1>;
256                 brcm,function = <BCM2835_FSEL_ALT0>;
257                 brcm,pull = <BCM2835_PUD_UP>;
258         };
259
260         i2c1_pins: i2c1 {
261                 brcm,pins = <2 3>;
262                 brcm,function = <BCM2835_FSEL_ALT0>;
263                 brcm,pull = <BCM2835_PUD_UP>;
264         };
265
266         i2c3_pins: i2c3 {
267                 brcm,pins = <4 5>;
268                 brcm,function = <BCM2835_FSEL_ALT5>;
269                 brcm,pull = <BCM2835_PUD_UP>;
270         };
271
272         i2c4_pins: i2c4 {
273                 brcm,pins = <8 9>;
274                 brcm,function = <BCM2835_FSEL_ALT5>;
275                 brcm,pull = <BCM2835_PUD_UP>;
276         };
277
278         i2c5_pins: i2c5 {
279                 brcm,pins = <12 13>;
280                 brcm,function = <BCM2835_FSEL_ALT5>;
281                 brcm,pull = <BCM2835_PUD_UP>;
282         };
283
284         i2c6_pins: i2c6 {
285                 brcm,pins = <22 23>;
286                 brcm,function = <BCM2835_FSEL_ALT5>;
287                 brcm,pull = <BCM2835_PUD_UP>;
288         };
289
290         i2s_pins: i2s {
291                 brcm,pins = <18 19 20 21>;
292                 brcm,function = <BCM2835_FSEL_ALT0>;
293         };
294
295         sdio_pins: sdio_pins {
296                 brcm,pins =     <34 35 36 37 38 39>;
297                 brcm,function = <BCM2835_FSEL_ALT3>; // alt3 = SD1
298                 brcm,pull =     <0 2 2 2 2 2>;
299         };
300
301         bt_pins: bt_pins {
302                 brcm,pins = "-"; // non-empty to keep btuart happy, //4 = 0
303                                  // to fool pinctrl
304                 brcm,function = <0>;
305                 brcm,pull = <2>;
306         };
307
308         uart0_pins: uart0_pins {
309                 brcm,pins = <32 33>;
310                 brcm,function = <BCM2835_FSEL_ALT3>;
311                 brcm,pull = <0 2>;
312         };
313
314         uart1_pins: uart1_pins {
315                 brcm,pins;
316                 brcm,function;
317                 brcm,pull;
318         };
319
320         uart2_pins: uart2_pins {
321                 brcm,pins = <0 1>;
322                 brcm,function = <BCM2835_FSEL_ALT4>;
323                 brcm,pull = <0 2>;
324         };
325
326         uart3_pins: uart3_pins {
327                 brcm,pins = <4 5>;
328                 brcm,function = <BCM2835_FSEL_ALT4>;
329                 brcm,pull = <0 2>;
330         };
331
332         uart4_pins: uart4_pins {
333                 brcm,pins = <8 9>;
334                 brcm,function = <BCM2835_FSEL_ALT4>;
335                 brcm,pull = <0 2>;
336         };
337
338         uart5_pins: uart5_pins {
339                 brcm,pins = <12 13>;
340                 brcm,function = <BCM2835_FSEL_ALT4>;
341                 brcm,pull = <0 2>;
342         };
343
344         audio_pins: audio_pins {
345                 brcm,pins = <40 41>;
346                 brcm,function = <4>;
347         };
348
349         /* Needs to describe gpio settings at config.txt */
350         key_volume_up: key_volume_up {
351                 brcm,pins = <16>;
352                 brcm,function = <1>; /* BCM2835_FSEL_GPIO_IN */
353                 brcm,pull = <2>; /* BCM2835_PUD_UP */
354         };
355
356         key_volume_down: key_volume_down {
357                 brcm,pins = <13>;
358                 brcm,function = <1>;
359                 brcm,pull = <2>;
360         };
361
362         key_fastforward: key_fastforward {
363                 brcm,pins = <6>;
364                 brcm,function = <1>;
365                 brcm,pull = <2>;
366         };
367
368         key_rewind: key_rewind {
369                 brcm,pins = <12>;
370                 brcm,function = <1>;
371                 brcm,pull = <2>;
372         };
373
374         key_playpause: key_playpause {
375                 brcm,pins = <25>;
376                 brcm,function = <1>;
377                 brcm,pull = <2>;
378         };
379 };
380
381 &i2c0 {
382         pinctrl-names = "default";
383         pinctrl-0 = <&i2c0_pins>;
384         clock-frequency = <100000>;
385 };
386
387 &i2c1 {
388         pinctrl-names = "default";
389         pinctrl-0 = <&i2c1_pins>;
390         clock-frequency = <100000>;
391         status = "okay";
392
393         #address-cells = <1>;
394         #size-cells = <0>;
395
396         ac108_a: ac108@3b{
397                 compatible = "x-power,ac108_0";
398                 reg = <0x3b>;
399                 #sound-dai-cells = <0>;
400                 data-protocol = <0>;
401         };
402 };
403
404 &i2c2 {
405         clock-frequency = <100000>;
406         status = "okay";
407 };
408
409 &fb {
410         status = "disabled";
411 };
412
413 &firmwarekms {
414         status = "okay";
415 };
416
417 &v3d {
418         status = "okay";
419 };
420
421 &vc4 {
422         status = "okay";
423 };
424
425 &i2s {
426         pinctrl-names = "default";
427         pinctrl-0 = <&i2s_pins>;
428
429         #sound-dai-cells = <0>;
430         status = "okay";
431 };
432
433 &sound {
434         compatible = "seeed-voicecard";
435         seeed-voice-card,format = "dsp_a";
436         seeed-voice-card,name = "seeed-4mic-voicecard";
437         status = "okay";
438
439         seeed-voice-card,bitclock-master = <&codec_dai>;
440         seeed-voice-card,frame-master = <&codec_dai>;
441         seeed-voice-card,channels-playback-override = <4>;
442         seeed-voice-card,channels-capture-override  = <4>;
443
444         cpu_dai: seeed-voice-card,cpu {
445                 sound-dai = <&i2s>;
446                 dai-tdm-slot-num     = <2>;
447                 dai-tdm-slot-width   = <32>;
448                 dai-tdm-slot-tx-mask = <1 1 0 0>;
449                 dai-tdm-slot-rx-mask = <1 1 0 0>;
450         };
451         codec_dai: seeed-voice-card,codec {
452                 sound-dai = <&ac108_a>;
453                 system-clock-frequency = <24000000>;
454         };
455 };
456
457 / {
458         __overrides__ {
459                 act_led_gpio = <&act_led>,"gpios:4";
460                 act_led_activelow = <&act_led>,"gpios:8";
461                 act_led_trigger = <&act_led>,"linux,default-trigger";
462
463                 pwr_led_gpio = <&pwr_led>,"gpios:4";
464                 pwr_led_activelow = <&pwr_led>,"gpios:8";
465                 pwr_led_trigger = <&pwr_led>,"linux,default-trigger";
466         };
467 };