Revert "ARM: dts: bcm2711-rpi-4-b: Fix CMA size to 512M"
[platform/kernel/linux-rpi.git] / arch / arm / boot / dts / bcm2711-rpi-4-b.dts
1 // SPDX-License-Identifier: GPL-2.0
2 /dts-v1/;
3 #include "bcm2711.dtsi"
4 #include "bcm2835-rpi.dtsi"
5 #include <dt-bindings/input/input.h>
6
7 / {
8         compatible = "raspberrypi,4-model-b", "brcm,bcm2711";
9         model = "Raspberry Pi 4 Model B";
10
11         chosen {
12                 /* 8250 auxiliary UART instead of pl011 */
13                 stdout-path = "serial1:115200n8";
14         };
15
16         /* Will be filled by the bootloader */
17         memory@0 {
18                 device_type = "memory";
19                 reg = <0 0 0>;
20         };
21
22         aliases {
23                 ethernet0 = &genet;
24         };
25
26         rpi_backlight: rpi_backlight {
27                 compatible = "raspberrypi,rpi-backlight";
28                 firmware = <&firmware>;
29                 status = "okay";
30         };
31
32         rpi_ft5406: rpi_ft5406 {
33                 compatible = "rpi,rpi-ft5406";
34                 firmware = <&firmware>;
35                 status = "okay";
36         };
37
38         gpio-keys {
39                 compatible = "gpio-keys";
40
41                 key-volume-up {
42                         lable = "volume-up";
43                         linux,code = <KEY_VOLUMEUP>;
44                         gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
45                 };
46
47                 key-volume-down {
48                         lable = "volume-down";
49                         linux,code = <KEY_VOLUMEDOWN>;
50                         gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
51                 };
52
53                 key-fastforward {
54                         lable = "fastforward";
55                         linux,code = <KEY_FASTFORWARD>;
56                         gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
57                 };
58
59                 key-rewind {
60                         lable = "rewind";
61                         linux,code = <KEY_REWIND>;
62                         gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
63                 };
64
65                 key-playpause {
66                         lable = "playpause";
67                         linux,code = <KEY_PLAYPAUSE>;
68                         gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
69                 };
70         };
71
72         leds {
73                 act {
74                         gpios = <&gpio 42 GPIO_ACTIVE_HIGH>;
75                 };
76
77                 pwr {
78                         label = "PWR";
79                         gpios = <&expgpio 2 GPIO_ACTIVE_LOW>;
80                 };
81         };
82
83         wifi_pwrseq: wifi-pwrseq {
84                 compatible = "mmc-pwrseq-simple";
85                 reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>;
86         };
87
88         sd_io_1v8_reg: sd_io_1v8_reg {
89                 compatible = "regulator-gpio";
90                 regulator-name = "vdd-sd-io";
91                 regulator-min-microvolt = <1800000>;
92                 regulator-max-microvolt = <3300000>;
93                 regulator-boot-on;
94                 regulator-always-on;
95                 regulator-settling-time-us = <5000>;
96                 gpios = <&expgpio 4 GPIO_ACTIVE_HIGH>;
97                 states = <1800000 0x1
98                           3300000 0x0>;
99                 status = "okay";
100         };
101 };
102
103 &firmware {
104         expgpio: gpio {
105                 compatible = "raspberrypi,firmware-gpio";
106                 gpio-controller;
107                 #gpio-cells = <2>;
108                 gpio-line-names = "BT_ON",
109                                   "WL_ON",
110                                   "PWR_LED_OFF",
111                                   "GLOBAL_RESET",
112                                   "VDD_SD_IO_SEL",
113                                   "CAM_GPIO",
114                                   "SD_PWR_ON",
115                                   "SD_OC_N";
116                 status = "okay";
117         };
118 };
119
120 &pwm1 {
121         pinctrl-names = "default";
122         pinctrl-0 = <&pwm1_0_gpio40 &pwm1_1_gpio41>;
123         status = "okay";
124 };
125
126 /* SDHCI is used to control the SDIO for wireless */
127 &sdhci {
128         #address-cells = <1>;
129         #size-cells = <0>;
130         pinctrl-names = "default";
131         pinctrl-0 = <&emmc_gpio34>;
132         bus-width = <4>;
133         non-removable;
134         mmc-pwrseq = <&wifi_pwrseq>;
135         status = "okay";
136
137         brcmf: wifi@1 {
138                 reg = <1>;
139                 compatible = "brcm,bcm4329-fmac";
140         };
141 };
142
143 /* EMMC2 is used to drive the SD card */
144 &emmc2 {
145         vqmmc-supply = <&sd_io_1v8_reg>;
146         broken-cd;
147         status = "okay";
148 };
149
150 &genet {
151         phy-handle = <&phy1>;
152         phy-mode = "rgmii-rxid";
153         status = "okay";
154 };
155
156 &genet_mdio {
157         phy1: ethernet-phy@1 {
158                 /* No PHY interrupt */
159                 reg = <0x1>;
160         };
161 };
162
163 /* uart0 communicates with the BT module */
164 &uart0 {
165         pinctrl-names = "default";
166         pinctrl-0 = <&uart0_ctsrts_gpio30 &uart0_gpio32>;
167         uart-has-rtscts;
168         status = "okay";
169
170         bluetooth {
171                 compatible = "brcm,bcm43438-bt";
172                 max-speed = <2000000>;
173                 shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>;
174         };
175 };
176
177 /* uart1 is mapped to the pin header */
178 &uart1 {
179         pinctrl-names = "default";
180         pinctrl-0 = <&uart1_gpio14>;
181         status = "okay";
182 };
183
184 &vchiq {
185         interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
186 };
187
188 &vc4 {
189         status = "okay";
190 };
191
192 &pixelvalve0 {
193         status = "okay";
194 };
195
196 &pixelvalve1 {
197         status = "okay";
198 };
199
200 &pixelvalve2 {
201         status = "okay";
202 };
203
204 &pixelvalve3 {
205         status = "okay";
206 };
207
208 &pixelvalve4 {
209         status = "okay";
210 };
211
212 &hdmi0 {
213         status = "okay";
214 };
215
216 &ddc0 {
217         status = "okay";
218 };
219
220 &hdmi1 {
221         status = "okay";
222 };
223
224 &ddc1 {
225         status = "okay";
226 };
227
228 // =============================================
229 // Downstream rpi- changes
230
231 #include "bcm270x.dtsi"
232 #include "bcm271x-rpi-bt.dtsi"
233
234 / {
235         soc {
236                 /delete-node/ pixelvalve@7e807000;
237                 /delete-node/ hdmi@7e902000;
238         };
239 };
240
241 #include "bcm2711-rpi.dtsi"
242 #include "bcm283x-rpi-csi1-2lane.dtsi"
243 #include "bcm283x-rpi-i2c0mux_0_44.dtsi"
244
245 /delete-node/ &emmc2;
246
247 / {
248         chosen {
249                 bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_headphones=1";
250         };
251
252         aliases {
253                 serial0 = &uart1;
254                 serial1 = &uart0;
255                 mmc0 = &emmc2;
256                 mmc1 = &mmcnr;
257                 mmc2 = &sdhost;
258                 /delete-property/ i2c2;
259                 i2c3 = &i2c3;
260                 i2c4 = &i2c4;
261                 i2c5 = &i2c5;
262                 i2c6 = &i2c6;
263                 /delete-property/ ethernet;
264                 /delete-property/ intc;
265                 pcie0 = &pcie0;
266                 emmc2bus = &emmc2bus;
267         };
268
269         emmc2bus: emmc2bus {
270                 compatible = "simple-bus";
271                 #address-cells = <2>;
272                 #size-cells = <1>;
273
274                 ranges = <0x0 0x7e000000  0x0 0xfe000000  0x01800000>;
275                 dma-ranges = <0x0 0xc0000000  0x0 0x00000000  0x40000000>;
276
277                 emmc2: emmc2@7e340000 {
278                         compatible = "brcm,bcm2711-emmc2";
279                         status = "okay";
280                         interrupts = <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>;
281                         clocks = <&clocks BCM2711_CLOCK_EMMC2>;
282                         reg = <0x0 0x7e340000 0x100>;
283                         vqmmc-supply = <&sd_io_1v8_reg>;
284                 };
285         };
286
287         /delete-node/ wifi-pwrseq;
288 };
289
290 &mmcnr {
291         #address-cells = <1>;
292         #size-cells = <0>;
293         pinctrl-names = "default";
294         pinctrl-0 = <&sdio_pins>;
295         bus-width = <4>;
296         status = "okay";
297         brcmf: wifi@1 {
298                 reg = <1>;
299                 compatible = "brcm,bcm4329-fmac";
300                 brcm,feature-disable = <0x2000>; /* BIT[13] : sup-wpa */
301         };
302 };
303
304 &uart0 {
305         pinctrl-0 = <&uart0_pins &bt_pins &uart0_ctsrts_gpio30>;
306         status = "okay";
307 };
308
309 &uart1 {
310         pinctrl-0 = <&uart1_pins>;
311 };
312
313 &spi0 {
314         pinctrl-names = "default";
315         pinctrl-0 = <&spi0_pins &spi0_cs_pins>;
316         cs-gpios = <&gpio 8 1>, <&gpio 7 1>;
317         status = "okay";
318
319         spidev0: spidev@0{
320                 compatible = "spidev";
321                 reg = <0>;      /* CE0 */
322                 #address-cells = <1>;
323                 #size-cells = <0>;
324                 spi-max-frequency = <125000000>;
325         };
326
327         spidev1: spidev@1{
328                 compatible = "spidev";
329                 reg = <1>;      /* CE1 */
330                 #address-cells = <1>;
331                 #size-cells = <0>;
332                 spi-max-frequency = <125000000>;
333         };
334 };
335
336 &gpio {
337         spi0_pins: spi0_pins {
338                 brcm,pins = <9 10 11>;
339                 brcm,function = <BCM2835_FSEL_ALT0>;
340         };
341
342         spi0_cs_pins: spi0_cs_pins {
343                 brcm,pins = <8 7>;
344                 brcm,function = <BCM2835_FSEL_GPIO_OUT>;
345         };
346
347         spi3_pins: spi3_pins {
348                 brcm,pins = <1 2 3>;
349                 brcm,function = <BCM2835_FSEL_ALT3>;
350         };
351
352         spi3_cs_pins: spi3_cs_pins {
353                 brcm,pins = <0 24>;
354                 brcm,function = <BCM2835_FSEL_GPIO_OUT>;
355         };
356
357         spi4_pins: spi4_pins {
358                 brcm,pins = <5 6 7>;
359                 brcm,function = <BCM2835_FSEL_ALT3>;
360         };
361
362         spi4_cs_pins: spi4_cs_pins {
363                 brcm,pins = <4 25>;
364                 brcm,function = <BCM2835_FSEL_GPIO_OUT>;
365         };
366
367         spi5_pins: spi5_pins {
368                 brcm,pins = <13 14 15>;
369                 brcm,function = <BCM2835_FSEL_ALT3>;
370         };
371
372         spi5_cs_pins: spi5_cs_pins {
373                 brcm,pins = <12 26>;
374                 brcm,function = <BCM2835_FSEL_GPIO_OUT>;
375         };
376
377         spi6_pins: spi6_pins {
378                 brcm,pins = <19 20 21>;
379                 brcm,function = <BCM2835_FSEL_ALT3>;
380         };
381
382         spi6_cs_pins: spi6_cs_pins {
383                 brcm,pins = <18 27>;
384                 brcm,function = <BCM2835_FSEL_GPIO_OUT>;
385         };
386
387         i2c0_pins: i2c0 {
388                 brcm,pins = <0 1>;
389                 brcm,function = <BCM2835_FSEL_ALT0>;
390                 brcm,pull = <BCM2835_PUD_UP>;
391         };
392
393         i2c1_pins: i2c1 {
394                 brcm,pins = <2 3>;
395                 brcm,function = <BCM2835_FSEL_ALT0>;
396                 brcm,pull = <BCM2835_PUD_UP>;
397         };
398
399         i2c3_pins: i2c3 {
400                 brcm,pins = <4 5>;
401                 brcm,function = <BCM2835_FSEL_ALT5>;
402                 brcm,pull = <BCM2835_PUD_UP>;
403         };
404
405         i2c4_pins: i2c4 {
406                 brcm,pins = <8 9>;
407                 brcm,function = <BCM2835_FSEL_ALT5>;
408                 brcm,pull = <BCM2835_PUD_UP>;
409         };
410
411         i2c5_pins: i2c5 {
412                 brcm,pins = <12 13>;
413                 brcm,function = <BCM2835_FSEL_ALT5>;
414                 brcm,pull = <BCM2835_PUD_UP>;
415         };
416
417         i2c6_pins: i2c6 {
418                 brcm,pins = <22 23>;
419                 brcm,function = <BCM2835_FSEL_ALT5>;
420                 brcm,pull = <BCM2835_PUD_UP>;
421         };
422
423         i2s_pins: i2s {
424                 brcm,pins = <18 19 20 21>;
425                 brcm,function = <BCM2835_FSEL_ALT0>;
426         };
427
428         sdio_pins: sdio_pins {
429                 brcm,pins =     <34 35 36 37 38 39>;
430                 brcm,function = <BCM2835_FSEL_ALT3>; // alt3 = SD1
431                 brcm,pull =     <0 2 2 2 2 2>;
432         };
433
434         bt_pins: bt_pins {
435                 brcm,pins = "-"; // non-empty to keep btuart happy, //4 = 0
436                                  // to fool pinctrl
437                 brcm,function = <0>;
438                 brcm,pull = <2>;
439         };
440
441         uart0_pins: uart0_pins {
442                 brcm,pins = <32 33>;
443                 brcm,function = <BCM2835_FSEL_ALT3>;
444                 brcm,pull = <0 2>;
445         };
446
447         uart1_pins: uart1_pins {
448                 brcm,pins;
449                 brcm,function;
450                 brcm,pull;
451         };
452
453         uart2_pins: uart2_pins {
454                 brcm,pins = <0 1>;
455                 brcm,function = <BCM2835_FSEL_ALT4>;
456                 brcm,pull = <0 2>;
457         };
458
459         uart3_pins: uart3_pins {
460                 brcm,pins = <4 5>;
461                 brcm,function = <BCM2835_FSEL_ALT4>;
462                 brcm,pull = <0 2>;
463         };
464
465         uart4_pins: uart4_pins {
466                 brcm,pins = <8 9>;
467                 brcm,function = <BCM2835_FSEL_ALT4>;
468                 brcm,pull = <0 2>;
469         };
470
471         uart5_pins: uart5_pins {
472                 brcm,pins = <12 13>;
473                 brcm,function = <BCM2835_FSEL_ALT4>;
474                 brcm,pull = <0 2>;
475         };
476
477         /* Needs to describe gpio settings at config.txt */
478         key_volume_up: key_volume_up {
479                 brcm,pins = <16>;
480                 brcm,function = <1>; /* BCM2835_FSEL_GPIO_IN */
481                 brcm,pull = <2>; /* BCM2835_PUD_UP */
482         };
483
484         key_volume_down: key_volume_down {
485                 brcm,pins = <13>;
486                 brcm,function = <1>;
487                 brcm,pull = <2>;
488         };
489
490         key_fastforward: key_fastforward {
491                 brcm,pins = <6>;
492                 brcm,function = <1>;
493                 brcm,pull = <2>;
494         };
495
496         key_rewind: key_rewind {
497                 brcm,pins = <12>;
498                 brcm,function = <1>;
499                 brcm,pull = <2>;
500         };
501
502         key_playpause: key_playpause {
503                 brcm,pins = <25>;
504                 brcm,function = <1>;
505                 brcm,pull = <2>;
506         };
507 };
508
509 &i2c0if {
510         clock-frequency = <100000>;
511 };
512
513 &i2c1 {
514         pinctrl-names = "default";
515         pinctrl-0 = <&i2c1_pins>;
516         clock-frequency = <100000>;
517         status = "okay";
518
519         #address-cells = <1>;
520         #size-cells = <0>;
521
522         ac108_a: ac108@3b{
523                 compatible = "x-power,ac108_0";
524                 reg = <0x3b>;
525                 #sound-dai-cells = <0>;
526                 data-protocol = <0>;
527         };
528 };
529
530 &i2s {
531         pinctrl-names = "default";
532         pinctrl-0 = <&i2s_pins>;
533
534         #sound-dai-cells = <0>;
535         status = "okay";
536 };
537
538 &sound {
539         compatible = "seeed-voicecard";
540         seeed-voice-card,format = "dsp_a";
541         seeed-voice-card,name = "seeed-4mic-voicecard";
542         status = "okay";
543
544         seeed-voice-card,bitclock-master = <&codec_dai>;
545         seeed-voice-card,frame-master = <&codec_dai>;
546         seeed-voice-card,channels-playback-override = <4>;
547         seeed-voice-card,channels-capture-override  = <4>;
548
549         cpu_dai: seeed-voice-card,cpu {
550                 sound-dai = <&i2s>;
551                 dai-tdm-slot-num     = <2>;
552                 dai-tdm-slot-width   = <32>;
553                 dai-tdm-slot-tx-mask = <1 1 0 0>;
554                 dai-tdm-slot-rx-mask = <1 1 0 0>;
555         };
556         codec_dai: seeed-voice-card,codec {
557                 sound-dai = <&ac108_a>;
558                 system-clock-frequency = <24000000>;
559         };
560 };
561
562 / {
563         __overrides__ {
564                 /delete-property/ i2c2_baudrate;
565                 /delete-property/ i2c2_iknowwhatimdoing;
566         };
567 };
568
569 &firmwarekms {
570         compatible = "raspberrypi,rpi-firmware-kms-2711";
571 };
572
573 // =============================================
574 // Board specific stuff here
575
576 / {
577         sd_vcc_reg: sd_vcc_reg {
578                 compatible = "regulator-fixed";
579                 regulator-name = "vcc-sd";
580                 regulator-min-microvolt = <3300000>;
581                 regulator-max-microvolt = <3300000>;
582                 regulator-boot-on;
583                 enable-active-high;
584                 gpio = <&expgpio 6 GPIO_ACTIVE_HIGH>;
585         };
586 };
587
588 &sdhost {
589         status = "disabled";
590 };
591
592 &emmc2 {
593         vmmc-supply = <&sd_vcc_reg>;
594         non-removable;
595 };
596
597 &phy1 {
598         led-modes = <0x00 0x08>; /* link/activity link */
599 };
600
601 &gpio {
602         audio_pins: audio_pins {
603                 brcm,pins = <40 41>;
604                 brcm,function = <4>;
605         };
606 };
607
608 &leds {
609         act_led: act {
610                 label = "led0";
611                 linux,default-trigger = "mmc0";
612                 gpios = <&gpio 42 GPIO_ACTIVE_HIGH>;
613         };
614
615         pwr_led: pwr {
616                 label = "led1";
617                 linux,default-trigger = "default-on";
618                 gpios = <&expgpio 2 GPIO_ACTIVE_LOW>;
619         };
620 };
621
622 &pwm1 {
623         status = "disabled";
624 };
625
626 &audio {
627         pinctrl-names = "default";
628         pinctrl-0 = <&audio_pins>;
629         status = "okay";
630 };
631
632 &usb {
633         compatible = "brcm,bcm2835-usb";
634         dr_mode = "otg";
635         g-np-tx-fifo-size = <32>;
636         g-rx-fifo-size = <558>;
637         g-tx-fifo-size = <512 512 512 512 512 256 256>;
638         status = "okay";
639         g-extcon-always-on;
640 };
641
642 &vc4 {
643         status = "okay";
644 };
645
646 &pixelvalve0 {
647         status = "okay";
648 };
649
650 &pixelvalve1 {
651         status = "okay";
652 };
653
654 &pixelvalve2 {
655         status = "okay";
656 };
657
658 &pixelvalve3 {
659         status = "okay";
660 };
661
662 &pixelvalve4 {
663         status = "okay";
664 };
665
666 &hdmi0 {
667         status = "okay";
668 };
669
670 &ddc0 {
671         status = "okay";
672 };
673
674 &hdmi1 {
675         status = "okay";
676 };
677
678 &ddc1 {
679         status = "okay";
680 };
681
682 &hvs {
683         status = "okay";
684 };
685
686 &v3d {
687         status = "okay";
688 };
689
690 &txp {
691         status = "okay";
692 };
693
694 &fb {
695         status = "disabled";
696 };
697
698 &firmwarekms {
699         status = "disabled";
700 };
701
702 &vec {
703         status = "disabled";
704 };
705
706 &cma {
707         size = <0x10000000>; /* 256MB */
708 };
709
710 / {
711         __overrides__ {
712                 act_led_gpio = <&act_led>,"gpios:4";
713                 act_led_activelow = <&act_led>,"gpios:8";
714                 act_led_trigger = <&act_led>,"linux,default-trigger";
715
716                 pwr_led_gpio = <&pwr_led>,"gpios:4";
717                 pwr_led_activelow = <&pwr_led>,"gpios:8";
718                 pwr_led_trigger = <&pwr_led>,"linux,default-trigger";
719
720                 eth_led0 = <&phy1>,"led-modes:0";
721                 eth_led1 = <&phy1>,"led-modes:4";
722
723                 spi_dma4 = <&spi0>, "dmas:0=", <&dma40>,
724                            <&spi0>, "dmas:8=", <&dma40>;
725         };
726 };