1 // SPDX-License-Identifier: GPL-2.0
3 #include "bcm2711.dtsi"
4 #include "bcm2711-rpi.dtsi"
5 //#include "bcm283x-rpi-usb-peripheral.dtsi"
6 #include <dt-bindings/input/input.h>
9 compatible = "raspberrypi,4-model-b", "brcm,bcm2711";
10 model = "Raspberry Pi 4 Model B";
13 /* 8250 auxiliary UART instead of pl011 */
14 stdout-path = "serial1:115200n8";
18 compatible = "gpio-keys";
22 linux,code = <KEY_VOLUMEUP>;
23 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
27 lable = "volume-down";
28 linux,code = <KEY_VOLUMEDOWN>;
29 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
33 lable = "fastforward";
34 linux,code = <KEY_FASTFORWARD>;
35 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
40 linux,code = <KEY_REWIND>;
41 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
46 linux,code = <KEY_PLAYPAUSE>;
47 gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
53 gpios = <&gpio 42 GPIO_ACTIVE_HIGH>;
58 gpios = <&expgpio 2 GPIO_ACTIVE_LOW>;
59 default-state = "keep";
60 linux,default-trigger = "default-on";
64 wifi_pwrseq: wifi-pwrseq {
65 compatible = "mmc-pwrseq-simple";
66 reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>;
69 sd_io_1v8_reg: sd_io_1v8_reg {
70 compatible = "regulator-gpio";
71 regulator-name = "vdd-sd-io";
72 regulator-min-microvolt = <1800000>;
73 regulator-max-microvolt = <3300000>;
76 regulator-settling-time-us = <5000>;
77 gpios = <&expgpio 4 GPIO_ACTIVE_HIGH>;
78 states = <1800000 0x1>,
83 sd_vcc_reg: sd_vcc_reg {
84 compatible = "regulator-fixed";
85 regulator-name = "vcc-sd";
86 regulator-min-microvolt = <3300000>;
87 regulator-max-microvolt = <3300000>;
90 gpio = <&expgpio 6 GPIO_ACTIVE_HIGH>;
103 gpio-line-names = "BT_ON",
115 * Parts taken from rpi_SCH_4b_4p0_reduced.pdf and
116 * the official GPU firmware DT blob.
119 * "FOO" = GPIO line named "FOO" on the schematic
120 * "FOO_N" = GPIO line named "FOO" on schematic, active low
122 gpio-line-names = "ID_SDA",
153 /* Used by BT module */
165 /* Shared with SPI flash */
211 pinctrl-names = "default";
212 pinctrl-0 = <&pwm1_0_gpio40 &pwm1_1_gpio41>;
216 /* SDHCI is used to control the SDIO for wireless */
218 #address-cells = <1>;
220 pinctrl-names = "default";
221 pinctrl-0 = <&emmc_gpio34>;
224 mmc-pwrseq = <&wifi_pwrseq>;
229 compatible = "brcm,bcm4329-fmac";
233 /* EMMC2 is used to drive the SD card */
235 vqmmc-supply = <&sd_io_1v8_reg>;
236 vmmc-supply = <&sd_vcc_reg>;
243 phy-handle = <&phy1>;
244 phy-mode = "rgmii-rxid";
249 phy1: ethernet-phy@1 {
250 /* No PHY interrupt */
258 #address-cells = <3>;
266 resets = <&reset RASPBERRYPI_FIRMWARE_RESET_ID_USB>;
271 /* uart0 communicates with the BT module */
273 pinctrl-names = "default";
274 pinctrl-0 = <&uart0_ctsrts_gpio30 &uart0_gpio32>;
279 compatible = "brcm,bcm43438-bt";
280 max-speed = <2000000>;
281 shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>;
285 /* uart1 is mapped to the pin header */
287 pinctrl-names = "default";
288 pinctrl-0 = <&uart1_gpio14>;
300 // =============================================
301 // Downstream rpi- changes
305 #include "bcm270x.dtsi"
306 #include "bcm271x-rpi-bt.dtsi"
310 /delete-node/ pixelvalve@7e807000;
311 /delete-node/ hdmi@7e902000;
315 #include "bcm2711-rpi-ds.dtsi"
316 #include "bcm283x-rpi-csi1-2lane.dtsi"
317 #include "bcm283x-rpi-i2c0mux_0_44.dtsi"
321 bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1";
340 /delete-property/ intc;
343 /delete-node/ wifi-pwrseq;
347 #address-cells = <1>;
349 pinctrl-names = "default";
350 pinctrl-0 = <&sdio_pins>;
355 compatible = "brcm,bcm4329-fmac";
356 brcm,feature-disable = <0x2000>; /* BIT[13] : sup-wpa */
361 pinctrl-0 = <&uart0_pins &bt_pins &uart0_ctsrts_gpio30>;
366 pinctrl-0 = <&uart1_pins>;
370 pinctrl-names = "default";
371 pinctrl-0 = <&uart2_pins>;
376 pinctrl-names = "default";
377 pinctrl-0 = <&spi0_pins &spi0_cs_pins>;
378 cs-gpios = <&gpio 8 1>, <&gpio 7 1>;
382 compatible = "spidev";
384 #address-cells = <1>;
386 spi-max-frequency = <125000000>;
390 compatible = "spidev";
392 #address-cells = <1>;
394 spi-max-frequency = <125000000>;
399 spi0_pins: spi0_pins {
400 brcm,pins = <9 10 11>;
401 brcm,function = <BCM2835_FSEL_ALT0>;
404 spi0_cs_pins: spi0_cs_pins {
406 brcm,function = <BCM2835_FSEL_GPIO_OUT>;
409 spi3_pins: spi3_pins {
411 brcm,function = <BCM2835_FSEL_ALT3>;
414 spi3_cs_pins: spi3_cs_pins {
416 brcm,function = <BCM2835_FSEL_GPIO_OUT>;
419 spi4_pins: spi4_pins {
421 brcm,function = <BCM2835_FSEL_ALT3>;
424 spi4_cs_pins: spi4_cs_pins {
426 brcm,function = <BCM2835_FSEL_GPIO_OUT>;
429 spi5_pins: spi5_pins {
430 brcm,pins = <13 14 15>;
431 brcm,function = <BCM2835_FSEL_ALT3>;
434 spi5_cs_pins: spi5_cs_pins {
436 brcm,function = <BCM2835_FSEL_GPIO_OUT>;
439 spi6_pins: spi6_pins {
440 brcm,pins = <19 20 21>;
441 brcm,function = <BCM2835_FSEL_ALT3>;
444 spi6_cs_pins: spi6_cs_pins {
446 brcm,function = <BCM2835_FSEL_GPIO_OUT>;
451 brcm,function = <BCM2835_FSEL_ALT0>;
452 brcm,pull = <BCM2835_PUD_UP>;
457 brcm,function = <BCM2835_FSEL_ALT0>;
458 brcm,pull = <BCM2835_PUD_UP>;
463 brcm,function = <BCM2835_FSEL_ALT5>;
464 brcm,pull = <BCM2835_PUD_UP>;
469 brcm,function = <BCM2835_FSEL_ALT5>;
470 brcm,pull = <BCM2835_PUD_UP>;
475 brcm,function = <BCM2835_FSEL_ALT5>;
476 brcm,pull = <BCM2835_PUD_UP>;
481 brcm,function = <BCM2835_FSEL_ALT5>;
482 brcm,pull = <BCM2835_PUD_UP>;
486 brcm,pins = <18 19 20 21>;
487 brcm,function = <BCM2835_FSEL_ALT0>;
490 sdio_pins: sdio_pins {
491 brcm,pins = <34 35 36 37 38 39>;
492 brcm,function = <BCM2835_FSEL_ALT3>; // alt3 = SD1
493 brcm,pull = <0 2 2 2 2 2>;
497 brcm,pins = "-"; // non-empty to keep btuart happy, //4 = 0
503 uart0_pins: uart0_pins {
505 brcm,function = <BCM2835_FSEL_ALT3>;
509 uart1_pins: uart1_pins {
515 uart2_pins: uart2_pins {
517 brcm,function = <BCM2835_FSEL_ALT4>;
521 uart3_pins: uart3_pins {
523 brcm,function = <BCM2835_FSEL_ALT4>;
527 uart4_pins: uart4_pins {
529 brcm,function = <BCM2835_FSEL_ALT4>;
533 uart5_pins: uart5_pins {
535 brcm,function = <BCM2835_FSEL_ALT4>;
539 /* Needs to describe gpio settings at config.txt */
540 key_volume_up: key_volume_up {
542 brcm,function = <1>; /* BCM2835_FSEL_GPIO_IN */
543 brcm,pull = <2>; /* BCM2835_PUD_UP */
546 key_volume_down: key_volume_down {
552 key_fastforward: key_fastforward {
558 key_rewind: key_rewind {
564 key_playpause: key_playpause {
572 clock-frequency = <100000>;
576 pinctrl-names = "default";
577 pinctrl-0 = <&i2c1_pins>;
578 clock-frequency = <100000>;
581 #address-cells = <1>;
585 compatible = "x-power,ac108_0";
587 #sound-dai-cells = <0>;
593 pinctrl-names = "default";
594 pinctrl-0 = <&i2s_pins>;
596 #sound-dai-cells = <0>;
601 compatible = "seeed-voicecard";
602 seeed-voice-card,format = "dsp_a";
603 seeed-voice-card,name = "seeed-4mic-voicecard";
606 seeed-voice-card,bitclock-master = <&codec_dai>;
607 seeed-voice-card,frame-master = <&codec_dai>;
608 seeed-voice-card,channels-playback-override = <4>;
609 seeed-voice-card,channels-capture-override = <4>;
611 cpu_dai: seeed-voice-card,cpu {
613 dai-tdm-slot-num = <2>;
614 dai-tdm-slot-width = <32>;
615 dai-tdm-slot-tx-mask = <1 1 0 0>;
616 dai-tdm-slot-rx-mask = <1 1 0 0>;
618 codec_dai: seeed-voice-card,codec {
619 sound-dai = <&ac108_a>;
620 system-clock-frequency = <24000000>;
624 // =============================================
625 // Board specific stuff here
632 led-modes = <0x00 0x08>; /* link/activity link */
636 audio_pins: audio_pins {
645 linux,default-trigger = "mmc0";
646 gpios = <&gpio 42 GPIO_ACTIVE_HIGH>;
651 linux,default-trigger = "default-on";
652 gpios = <&expgpio 2 GPIO_ACTIVE_LOW>;
661 pinctrl-names = "default";
662 pinctrl-0 = <&audio_pins>;
667 gpio = <&expgpio 5 GPIO_ACTIVE_HIGH>;
670 cam0_reg: &cam_dummy_reg {
674 size = <0x19000000>; /* 400MB (256 + 128 + 16) */
679 act_led_gpio = <&act_led>,"gpios:4";
680 act_led_activelow = <&act_led>,"gpios:8";
681 act_led_trigger = <&act_led>,"linux,default-trigger";
683 pwr_led_gpio = <&pwr_led>,"gpios:4";
684 pwr_led_activelow = <&pwr_led>,"gpios:8";
685 pwr_led_trigger = <&pwr_led>,"linux,default-trigger";
687 eth_led0 = <&phy1>,"led-modes:0";
688 eth_led1 = <&phy1>,"led-modes:4";
690 sd_poll_once = <&emmc2>, "non-removable?";
691 spi_dma4 = <&spi0>, "dmas:0=", <&dma40>,
692 <&spi0>, "dmas:8=", <&dma40>;