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