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