1// SPDX-License-Identifier: GPL-2.0 2/dts-v1/; 3#include "bcm2711.dtsi" 4#include "bcm2711-rpi.dtsi" 5#include "bcm283x-rpi-led-deprecated.dtsi" 6#include "bcm283x-rpi-usb-peripheral.dtsi" 7#include "bcm283x-rpi-wifi-bt.dtsi" 8 9/ { 10 compatible = "raspberrypi,4-model-b", "brcm,bcm2711"; 11 model = "Raspberry Pi 4 Model B"; 12 13 chosen { 14 /* 8250 auxiliary UART instead of pl011 */ 15 stdout-path = "serial1:115200n8"; 16 }; 17 18 cam1_reg: regulator-cam1 { 19 compatible = "regulator-fixed"; 20 regulator-name = "cam1-reg"; 21 enable-active-high; 22 gpio = <&expgpio 5 GPIO_ACTIVE_HIGH>; 23 }; 24 25 sd_io_1v8_reg: regulator-sd-io-1v8 { 26 compatible = "regulator-gpio"; 27 regulator-name = "vdd-sd-io"; 28 regulator-min-microvolt = <1800000>; 29 regulator-max-microvolt = <3300000>; 30 regulator-boot-on; 31 regulator-always-on; 32 regulator-settling-time-us = <5000>; 33 gpios = <&expgpio 4 GPIO_ACTIVE_HIGH>; 34 states = <1800000 0x1>, 35 <3300000 0x0>; 36 status = "okay"; 37 }; 38 39 sd_vcc_reg: regulator-sd-vcc { 40 compatible = "regulator-fixed"; 41 regulator-name = "vcc-sd"; 42 regulator-min-microvolt = <3300000>; 43 regulator-max-microvolt = <3300000>; 44 regulator-boot-on; 45 enable-active-high; 46 gpio = <&expgpio 6 GPIO_ACTIVE_HIGH>; 47 }; 48}; 49 50&bt { 51 shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>; 52}; 53 54&ddc0 { 55 status = "okay"; 56}; 57 58&ddc1 { 59 status = "okay"; 60}; 61 62&expgpio { 63 gpio-line-names = "BT_ON", /* 0 */ 64 "WL_ON", 65 "PWR_LED_OFF", 66 "GLOBAL_RESET", 67 "VDD_SD_IO_SEL", 68 "CAM_GPIO", /* 5 */ 69 "SD_PWR_ON", 70 ""; 71}; 72 73&gpio { 74 /* 75 * Parts taken from rpi_SCH_4b_4p0_reduced.pdf and 76 * the official GPU firmware DT blob. 77 * 78 * Legend: 79 * "FOO" = GPIO line named "FOO" on the schematic 80 * "FOO_N" = GPIO line named "FOO" on schematic, active low 81 */ 82 gpio-line-names = "ID_SDA", /* 0 */ 83 "ID_SCL", 84 "SDA1", 85 "SCL1", 86 "GPIO_GCLK", 87 "GPIO5", /* 5 */ 88 "GPIO6", 89 "SPI_CE1_N", 90 "SPI_CE0_N", 91 "SPI_MISO", 92 "SPI_MOSI", /* 10 */ 93 "SPI_SCLK", 94 "GPIO12", 95 "GPIO13", 96 /* Serial port */ 97 "TXD1", 98 "RXD1", /* 15 */ 99 "GPIO16", 100 "GPIO17", 101 "GPIO18", 102 "GPIO19", 103 "GPIO20", /* 20 */ 104 "GPIO21", 105 "GPIO22", 106 "GPIO23", 107 "GPIO24", 108 "GPIO25", /* 25 */ 109 "GPIO26", 110 "GPIO27", 111 "RGMII_MDIO", 112 "RGMIO_MDC", 113 /* Used by BT module */ 114 "CTS0", /* 30 */ 115 "RTS0", 116 "TXD0", 117 "RXD0", 118 /* Used by Wifi */ 119 "SD1_CLK", 120 "SD1_CMD", /* 35 */ 121 "SD1_DATA0", 122 "SD1_DATA1", 123 "SD1_DATA2", 124 "SD1_DATA3", 125 /* Shared with SPI flash */ 126 "PWM0_MISO", /* 40 */ 127 "PWM1_MOSI", 128 "STATUS_LED_G_CLK", 129 "SPIFLASH_CE_N", 130 "SDA0", 131 "SCL0", /* 45 */ 132 "RGMII_RXCLK", 133 "RGMII_RXCTL", 134 "RGMII_RXD0", 135 "RGMII_RXD1", 136 "RGMII_RXD2", /* 50 */ 137 "RGMII_RXD3", 138 "RGMII_TXCLK", 139 "RGMII_TXCTL", 140 "RGMII_TXD0", 141 "RGMII_TXD1", /* 55 */ 142 "RGMII_TXD2", 143 "RGMII_TXD3"; 144}; 145 146&hdmi0 { 147 status = "okay"; 148}; 149 150&hdmi1 { 151 status = "okay"; 152}; 153 154&led_act { 155 gpios = <&gpio 42 GPIO_ACTIVE_HIGH>; 156}; 157 158&leds { 159 led_pwr: led-pwr { 160 label = "PWR"; 161 gpios = <&expgpio 2 GPIO_ACTIVE_LOW>; 162 default-state = "keep"; 163 linux,default-trigger = "default-on"; 164 }; 165}; 166 167&pixelvalve0 { 168 status = "okay"; 169}; 170 171&pixelvalve1 { 172 status = "okay"; 173}; 174 175&pixelvalve2 { 176 status = "okay"; 177}; 178 179&pixelvalve4 { 180 status = "okay"; 181}; 182 183&pwm1 { 184 pinctrl-names = "default"; 185 pinctrl-0 = <&pwm1_0_gpio40 &pwm1_1_gpio41>; 186 status = "okay"; 187}; 188 189/* EMMC2 is used to drive the SD card */ 190&emmc2 { 191 vqmmc-supply = <&sd_io_1v8_reg>; 192 vmmc-supply = <&sd_vcc_reg>; 193 broken-cd; 194 status = "okay"; 195}; 196 197&genet { 198 phy-handle = <&phy1>; 199 phy-mode = "rgmii-rxid"; 200 status = "okay"; 201}; 202 203&genet_mdio { 204 phy1: ethernet-phy@1 { 205 /* No PHY interrupt */ 206 reg = <0x1>; 207 }; 208}; 209 210&pcie0 { 211 pci@0,0 { 212 device_type = "pci"; 213 #address-cells = <3>; 214 #size-cells = <2>; 215 ranges; 216 217 reg = <0 0 0 0 0>; 218 219 usb@0,0 { 220 reg = <0 0 0 0 0>; 221 resets = <&reset RASPBERRYPI_FIRMWARE_RESET_ID_USB>; 222 }; 223 }; 224}; 225 226/* uart0 communicates with the BT module */ 227&uart0 { 228 pinctrl-names = "default"; 229 pinctrl-0 = <&uart0_ctsrts_gpio30 &uart0_gpio32>; 230 uart-has-rtscts; 231}; 232 233/* uart1 is mapped to the pin header */ 234&uart1 { 235 pinctrl-names = "default"; 236 pinctrl-0 = <&uart1_gpio14>; 237 status = "okay"; 238}; 239 240&vc4 { 241 status = "okay"; 242}; 243 244&vec { 245 status = "disabled"; 246}; 247 248&wifi_pwrseq { 249 reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>; 250}; 251