1 // SPDX-License-Identifier: GPL-2.0
3 #include "bcm2711.dtsi"
4 #include "bcm2835-rpi.dtsi"
5 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/reset/raspberrypi,firmware-reset.h>
10 compatible = "raspberrypi,4-model-b", "brcm,bcm2711";
11 model = "Raspberry Pi 4 Model B";
14 /* 8250 auxiliary UART instead of pl011 */
15 stdout-path = "serial1:115200n8";
18 /* Will be filled by the bootloader */
20 device_type = "memory";
31 rpi_backlight: rpi_backlight {
32 compatible = "raspberrypi,rpi-backlight";
33 firmware = <&firmware>;
37 rpi_ft5406: rpi_ft5406 {
38 compatible = "rpi,rpi-ft5406";
39 firmware = <&firmware>;
44 compatible = "gpio-keys";
48 linux,code = <KEY_VOLUMEUP>;
49 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
53 lable = "volume-down";
54 linux,code = <KEY_VOLUMEDOWN>;
55 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
59 lable = "fastforward";
60 linux,code = <KEY_FASTFORWARD>;
61 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
66 linux,code = <KEY_REWIND>;
67 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
72 linux,code = <KEY_PLAYPAUSE>;
73 gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
79 gpios = <&gpio 42 GPIO_ACTIVE_HIGH>;
84 gpios = <&expgpio 2 GPIO_ACTIVE_LOW>;
85 default-state = "keep";
86 linux,default-trigger = "default-on";
90 wifi_pwrseq: wifi-pwrseq {
91 compatible = "mmc-pwrseq-simple";
92 reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>;
95 sd_io_1v8_reg: sd_io_1v8_reg {
96 compatible = "regulator-gpio";
97 regulator-name = "vdd-sd-io";
98 regulator-min-microvolt = <1800000>;
99 regulator-max-microvolt = <3300000>;
102 regulator-settling-time-us = <5000>;
103 gpios = <&expgpio 4 GPIO_ACTIVE_HIGH>;
104 states = <1800000 0x1>,
109 sd_vcc_reg: sd_vcc_reg {
110 compatible = "regulator-fixed";
111 regulator-name = "vcc-sd";
112 regulator-min-microvolt = <3300000>;
113 regulator-max-microvolt = <3300000>;
116 gpio = <&expgpio 6 GPIO_ACTIVE_HIGH>;
129 firmware_clocks: clocks {
130 compatible = "raspberrypi,firmware-clocks";
135 compatible = "raspberrypi,firmware-gpio";
138 gpio-line-names = "BT_ON",
150 compatible = "raspberrypi,firmware-reset";
157 * Parts taken from rpi_SCH_4b_4p0_reduced.pdf and
158 * the official GPU firmware DT blob.
161 * "FOO" = GPIO line named "FOO" on the schematic
162 * "FOO_N" = GPIO line named "FOO" on schematic, active low
164 gpio-line-names = "ID_SDA",
195 /* Used by BT module */
207 /* Shared with SPI flash */
229 clocks = <&firmware_clocks 13>, <&firmware_clocks 14>, <&dvp 0>, <&clk_27MHz>;
230 clock-names = "hdmi", "bvb", "audio", "cec";
231 wifi-2.4ghz-coexistence;
236 clocks = <&firmware_clocks 13>, <&firmware_clocks 14>, <&dvp 1>, <&clk_27MHz>;
237 clock-names = "hdmi", "bvb", "audio", "cec";
238 wifi-2.4ghz-coexistence;
243 clocks = <&firmware_clocks 4>;
263 pinctrl-names = "default";
264 pinctrl-0 = <&pwm1_0_gpio40 &pwm1_1_gpio41>;
270 * RPi4's co-processor will copy the board's bootloader configuration
271 * into memory for the OS to consume. It'll also update this node with
272 * its placement information.
275 compatible = "raspberrypi,bootloader-config", "nvmem-rmem";
276 #address-cells = <1>;
284 /* SDHCI is used to control the SDIO for wireless */
286 #address-cells = <1>;
288 pinctrl-names = "default";
289 pinctrl-0 = <&emmc_gpio34>;
292 mmc-pwrseq = <&wifi_pwrseq>;
297 compatible = "brcm,bcm4329-fmac";
301 /* EMMC2 is used to drive the SD card */
303 vqmmc-supply = <&sd_io_1v8_reg>;
304 vmmc-supply = <&sd_vcc_reg>;
310 phy-handle = <&phy1>;
311 phy-mode = "rgmii-rxid";
316 phy1: ethernet-phy@1 {
317 /* No PHY interrupt */
325 #address-cells = <3>;
333 resets = <&reset RASPBERRYPI_FIRMWARE_RESET_ID_USB>;
338 /* uart0 communicates with the BT module */
340 pinctrl-names = "default";
341 pinctrl-0 = <&uart0_ctsrts_gpio30 &uart0_pins &bt_pins>;
346 compatible = "brcm,bcm43438-bt";
347 max-speed = <2000000>;
348 shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>;
352 /* uart1 is mapped to the pin header */
354 pinctrl-names = "default";
355 pinctrl-0 = <&uart1_gpio14>;
360 interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
371 // =============================================
372 // Downstream rpi- changes
376 #include "bcm270x.dtsi"
377 #include "bcm271x-rpi-bt.dtsi"
381 /delete-node/ pixelvalve@7e807000;
382 /delete-node/ hdmi@7e902000;
386 #include "bcm2711-rpi.dtsi"
387 #include "bcm283x-rpi-csi1-2lane.dtsi"
388 #include "bcm283x-rpi-i2c0mux_0_44.dtsi"
392 bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1";
411 /delete-property/ intc;
414 /delete-node/ wifi-pwrseq;
418 pinctrl-names = "default";
419 pinctrl-0 = <&sdio_pins>;
425 pinctrl-0 = <&uart0_pins &bt_pins>;
430 pinctrl-0 = <&uart1_pins>;
434 pinctrl-names = "default";
435 pinctrl-0 = <&spi0_pins &spi0_cs_pins>;
436 cs-gpios = <&gpio 8 1>, <&gpio 7 1>;
440 compatible = "spidev";
442 #address-cells = <1>;
444 spi-max-frequency = <125000000>;
448 compatible = "spidev";
450 #address-cells = <1>;
452 spi-max-frequency = <125000000>;
457 spi0_pins: spi0_pins {
458 brcm,pins = <9 10 11>;
459 brcm,function = <BCM2835_FSEL_ALT0>;
462 spi0_cs_pins: spi0_cs_pins {
464 brcm,function = <BCM2835_FSEL_GPIO_OUT>;
467 spi3_pins: spi3_pins {
469 brcm,function = <BCM2835_FSEL_ALT3>;
472 spi3_cs_pins: spi3_cs_pins {
474 brcm,function = <BCM2835_FSEL_GPIO_OUT>;
477 spi4_pins: spi4_pins {
479 brcm,function = <BCM2835_FSEL_ALT3>;
482 spi4_cs_pins: spi4_cs_pins {
484 brcm,function = <BCM2835_FSEL_GPIO_OUT>;
487 spi5_pins: spi5_pins {
488 brcm,pins = <13 14 15>;
489 brcm,function = <BCM2835_FSEL_ALT3>;
492 spi5_cs_pins: spi5_cs_pins {
494 brcm,function = <BCM2835_FSEL_GPIO_OUT>;
497 spi6_pins: spi6_pins {
498 brcm,pins = <19 20 21>;
499 brcm,function = <BCM2835_FSEL_ALT3>;
502 spi6_cs_pins: spi6_cs_pins {
504 brcm,function = <BCM2835_FSEL_GPIO_OUT>;
509 brcm,function = <BCM2835_FSEL_ALT0>;
510 brcm,pull = <BCM2835_PUD_UP>;
515 brcm,function = <BCM2835_FSEL_ALT0>;
516 brcm,pull = <BCM2835_PUD_UP>;
521 brcm,function = <BCM2835_FSEL_ALT5>;
522 brcm,pull = <BCM2835_PUD_UP>;
527 brcm,function = <BCM2835_FSEL_ALT5>;
528 brcm,pull = <BCM2835_PUD_UP>;
533 brcm,function = <BCM2835_FSEL_ALT5>;
534 brcm,pull = <BCM2835_PUD_UP>;
539 brcm,function = <BCM2835_FSEL_ALT5>;
540 brcm,pull = <BCM2835_PUD_UP>;
544 brcm,pins = <18 19 20 21>;
545 brcm,function = <BCM2835_FSEL_ALT0>;
548 sdio_pins: sdio_pins {
549 brcm,pins = <34 35 36 37 38 39>;
550 brcm,function = <BCM2835_FSEL_ALT3>; // alt3 = SD1
551 brcm,pull = <0 2 2 2 2 2>;
555 brcm,pins = "-"; // non-empty to keep btuart happy, //4 = 0
561 uart0_pins: uart0_pins {
563 brcm,function = <BCM2835_FSEL_ALT3>;
567 uart1_pins: uart1_pins {
573 uart2_pins: uart2_pins {
575 brcm,function = <BCM2835_FSEL_ALT4>;
579 uart3_pins: uart3_pins {
581 brcm,function = <BCM2835_FSEL_ALT4>;
585 uart4_pins: uart4_pins {
587 brcm,function = <BCM2835_FSEL_ALT4>;
591 uart5_pins: uart5_pins {
593 brcm,function = <BCM2835_FSEL_ALT4>;
597 /* Needs to describe gpio settings at config.txt */
598 key_volume_up: key_volume_up {
600 brcm,function = <1>; /* BCM2835_FSEL_GPIO_IN */
601 brcm,pull = <2>; /* BCM2835_PUD_UP */
604 key_volume_down: key_volume_down {
610 key_fastforward: key_fastforward {
616 key_rewind: key_rewind {
622 key_playpause: key_playpause {
630 clock-frequency = <100000>;
634 pinctrl-names = "default";
635 pinctrl-0 = <&i2c1_pins>;
636 clock-frequency = <100000>;
639 #address-cells = <1>;
643 compatible = "x-power,ac108_0";
645 #sound-dai-cells = <0>;
651 pinctrl-names = "default";
652 pinctrl-0 = <&i2s_pins>;
654 #sound-dai-cells = <0>;
659 compatible = "seeed-voicecard";
660 seeed-voice-card,format = "dsp_a";
661 seeed-voice-card,name = "seeed-4mic-voicecard";
664 seeed-voice-card,bitclock-master = <&codec_dai>;
665 seeed-voice-card,frame-master = <&codec_dai>;
666 seeed-voice-card,channels-playback-override = <4>;
667 seeed-voice-card,channels-capture-override = <4>;
669 cpu_dai: seeed-voice-card,cpu {
671 dai-tdm-slot-num = <2>;
672 dai-tdm-slot-width = <32>;
673 dai-tdm-slot-tx-mask = <1 1 0 0>;
674 dai-tdm-slot-rx-mask = <1 1 0 0>;
676 codec_dai: seeed-voice-card,codec {
677 sound-dai = <&ac108_a>;
678 system-clock-frequency = <24000000>;
682 // =============================================
683 // Board specific stuff here
690 led-modes = <0x00 0x08>; /* link/activity link */
694 audio_pins: audio_pins {
703 linux,default-trigger = "mmc0";
704 gpios = <&gpio 42 GPIO_ACTIVE_HIGH>;
709 linux,default-trigger = "default-on";
710 gpios = <&expgpio 2 GPIO_ACTIVE_LOW>;
719 pinctrl-names = "default";
720 pinctrl-0 = <&audio_pins>;
725 gpio = <&expgpio 5 GPIO_ACTIVE_HIGH>;
728 cam0_reg: &cam_dummy_reg {
732 compatible = "brcm,bcm2835-usb";
734 g-np-tx-fifo-size = <32>;
735 g-rx-fifo-size = <558>;
736 g-tx-fifo-size = <512 512 512 512 512 256 256>;
743 act_led_gpio = <&act_led>,"gpios:4";
744 act_led_activelow = <&act_led>,"gpios:8";
745 act_led_trigger = <&act_led>,"linux,default-trigger";
747 pwr_led_gpio = <&pwr_led>,"gpios:4";
748 pwr_led_activelow = <&pwr_led>,"gpios:8";
749 pwr_led_trigger = <&pwr_led>,"linux,default-trigger";
751 eth_led0 = <&phy1>,"led-modes:0";
752 eth_led1 = <&phy1>,"led-modes:4";
754 sd_poll_once = <&emmc2>, "non-removable?";
755 spi_dma4 = <&spi0>, "dmas:0=", <&dma40>,
756 <&spi0>, "dmas:8=", <&dma40>;