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