1// SPDX-License-Identifier: GPL-2.0
2/dts-v1/;
3#include "bcm2837.dtsi"
4#include "bcm2836-rpi.dtsi"
5#include "bcm283x-rpi-usb-host.dtsi"
6#include "bcm283x-rpi-wifi-bt.dtsi"
7
8/ {
9	compatible = "raspberrypi,3-model-a-plus", "brcm,bcm2837";
10	model = "Raspberry Pi 3 Model A+";
11
12	chosen {
13		/* 8250 auxiliary UART instead of pl011 */
14		stdout-path = "serial1:115200n8";
15	};
16
17	memory@0 {
18		device_type = "memory";
19		reg = <0 0x20000000>;
20	};
21
22	leds {
23		led-act {
24			gpios = <&gpio 29 GPIO_ACTIVE_HIGH>;
25		};
26
27		led-pwr {
28			label = "PWR";
29			gpios = <&expgpio 2 GPIO_ACTIVE_LOW>;
30			default-state = "keep";
31			linux,default-trigger = "default-on";
32		};
33	};
34};
35
36&firmware {
37	expgpio: gpio {
38		compatible = "raspberrypi,firmware-gpio";
39		gpio-controller;
40		#gpio-cells = <2>;
41		gpio-line-names = "",
42				  "BT_WL_ON",
43				  "STATUS_LED_R",
44				  "",
45				  "",
46				  "CAM_GPIO0",
47				  "CAM_GPIO1",
48				  "";
49		status = "okay";
50	};
51};
52
53&gpio {
54	/*
55	 * This is mostly based on the official GPU firmware DT blob.
56	 *
57	 * Legend:
58	 * "NC" = not connected (no rail from the SoC)
59	 * "FOO" = GPIO line named "FOO" on the schematic
60	 * "FOO_N" = GPIO line named "FOO" on schematic, active low
61	 */
62	gpio-line-names = "ID_SDA",
63			  "ID_SCL",
64			  "SDA1",
65			  "SCL1",
66			  "GPIO_GCLK",
67			  "GPIO5",
68			  "GPIO6",
69			  "SPI_CE1_N",
70			  "SPI_CE0_N",
71			  "SPI_MISO",
72			  "SPI_MOSI",
73			  "SPI_SCLK",
74			  "GPIO12",
75			  "GPIO13",
76			  /* Serial port */
77			  "TXD1",
78			  "RXD1",
79			  "GPIO16",
80			  "GPIO17",
81			  "GPIO18",
82			  "GPIO19",
83			  "GPIO20",
84			  "GPIO21",
85			  "GPIO22",
86			  "GPIO23",
87			  "GPIO24",
88			  "GPIO25",
89			  "GPIO26",
90			  "GPIO27",
91			  "HDMI_HPD_N",
92			  "STATUS_LED_G",
93			  /* Used by BT module */
94			  "CTS0",
95			  "RTS0",
96			  "TXD0",
97			  "RXD0",
98			  /* Used by Wifi */
99			  "SD1_CLK",
100			  "SD1_CMD",
101			  "SD1_DATA0",
102			  "SD1_DATA1",
103			  "SD1_DATA2",
104			  "SD1_DATA3",
105			  "PWM0_OUT",
106			  "PWM1_OUT",
107			  "", /* GPIO42 */
108			  "WIFI_CLK",
109			  "SDA0",
110			  "SCL0",
111			  "SMPS_SCL",
112			  "SMPS_SDA",
113			  /* Used by SD Card */
114			  "SD_CLK_R",
115			  "SD_CMD_R",
116			  "SD_DATA0_R",
117			  "SD_DATA1_R",
118			  "SD_DATA2_R",
119			  "SD_DATA3_R";
120};
121
122&hdmi {
123	hpd-gpios = <&gpio 28 GPIO_ACTIVE_LOW>;
124	power-domains = <&power RPI_POWER_DOMAIN_HDMI>;
125	status = "okay";
126};
127
128&pwm {
129	pinctrl-names = "default";
130	pinctrl-0 = <&pwm0_gpio40 &pwm1_gpio41>;
131	status = "okay";
132};
133
134/* SDHOST is used to drive the SD card */
135&sdhost {
136	pinctrl-names = "default";
137	pinctrl-0 = <&sdhost_gpio48>;
138	status = "okay";
139	bus-width = <4>;
140};
141
142/* uart0 communicates with the BT module
143 *
144 * WL_REG_ON and BT_REG_ON of the CYW43455 Wifi/BT module are driven
145 * by a single GPIO. We can't give GPIO control to one of the drivers,
146 * otherwise the other part would get unexpectedly disturbed.
147 */
148&uart0 {
149	pinctrl-names = "default";
150	pinctrl-0 = <&uart0_ctsrts_gpio30 &uart0_gpio32 &gpclk2_gpio43>;
151};
152
153/* uart1 is mapped to the pin header */
154&uart1 {
155	pinctrl-names = "default";
156	pinctrl-0 = <&uart1_gpio14>;
157	status = "okay";
158};
159