brcm2708: update to latest patches from the RPi foundation
[openwrt/staging/wigyori.git] / target / linux / brcm2708 / patches-4.19 / 950-0667-arm-dts-First-draft-of-upstream-Pi4-DTS.patch
1 From 3183783f2a7db515671c6c612988627f946b4a36 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Tue, 11 Jun 2019 18:08:05 +0100
4 Subject: [PATCH 667/725] arm: dts: First draft of upstream Pi4 DTS
5
6 I've attempted to follow the upstream conventions in the DT commits,
7 but this is just presented here initially as a talking point.
8
9 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
10 ---
11 arch/arm/boot/dts/Makefile | 1 +
12 arch/arm/boot/dts/bcm2838-rpi-4-b.dts | 118 ++++++++++++++++++++++++++
13 arch/arm/boot/dts/bcm2838-rpi.dtsi | 25 ++++++
14 3 files changed, 144 insertions(+)
15 create mode 100644 arch/arm/boot/dts/bcm2838-rpi-4-b.dts
16 create mode 100644 arch/arm/boot/dts/bcm2838-rpi.dtsi
17
18 --- a/arch/arm/boot/dts/Makefile
19 +++ b/arch/arm/boot/dts/Makefile
20 @@ -94,6 +94,7 @@ dtb-$(CONFIG_ARCH_BCM2835) += \
21 bcm2836-rpi-2-b.dtb \
22 bcm2837-rpi-3-b.dtb \
23 bcm2837-rpi-3-b-plus.dtb \
24 + bcm2838-rpi-4-b.dtb \
25 bcm2835-rpi-zero.dtb \
26 bcm2835-rpi-zero-w.dtb
27 dtb-$(CONFIG_ARCH_BCM_5301X) += \
28 --- /dev/null
29 +++ b/arch/arm/boot/dts/bcm2838-rpi-4-b.dts
30 @@ -0,0 +1,118 @@
31 +// SPDX-License-Identifier: GPL-2.0
32 +/dts-v1/;
33 +#include "bcm2838.dtsi"
34 +#include "bcm2835-rpi.dtsi"
35 +#include "bcm2838-rpi.dtsi"
36 +
37 +/ {
38 + compatible = "raspberrypi,4-model-b", "brcm,bcm2838";
39 + model = "Raspberry Pi 4 Model B";
40 +
41 + chosen {
42 + /* 8250 auxiliary UART instead of pl011 */
43 + stdout-path = "serial1:115200n8";
44 + };
45 +
46 + memory {
47 + reg = <0 0 0x40000000>;
48 + };
49 +
50 + leds {
51 + act {
52 + gpios = <&gpio 42 GPIO_ACTIVE_HIGH>;
53 + };
54 +
55 + pwr {
56 + label = "PWR";
57 + gpios = <&expgpio 2 GPIO_ACTIVE_LOW>;
58 + };
59 + };
60 +
61 + wifi_pwrseq: wifi-pwrseq {
62 + compatible = "mmc-pwrseq-simple";
63 + reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>;
64 + };
65 +
66 + sd_io_1v8_reg: sd_io_1v8_reg {
67 + status = "okay";
68 + compatible = "regulator-gpio";
69 + vin-supply = <&vdd_5v0_reg>;
70 + regulator-name = "vdd-sd-io";
71 + regulator-min-microvolt = <1800000>;
72 + regulator-max-microvolt = <3300000>;
73 + regulator-boot-on;
74 + regulator-always-on;
75 + regulator-settling-time-us = <5000>;
76 +
77 + gpios = <&expgpio 4 GPIO_ACTIVE_HIGH>;
78 + states = <1800000 0x1
79 + 3300000 0x0>;
80 + };
81 +};
82 +
83 +&firmware {
84 + expgpio: gpio {
85 + compatible = "raspberrypi,firmware-gpio";
86 + gpio-controller;
87 + #gpio-cells = <2>;
88 + gpio-line-names = "BT_ON",
89 + "WL_ON",
90 + "PWR_LED_OFF",
91 + "GLOBAL_RESET",
92 + "VDD_SD_IO_SEL",
93 + "CAM_GPIO",
94 + "",
95 + "";
96 + status = "okay";
97 + };
98 +};
99 +
100 +&pwm1 {
101 + pinctrl-names = "default";
102 + pinctrl-0 = <&pwm0_gpio40 &pwm1_gpio41>;
103 + status = "okay";
104 +};
105 +
106 +/* SDHCI is used to control the SDIO for wireless */
107 +&sdhci {
108 + #address-cells = <1>;
109 + #size-cells = <0>;
110 + pinctrl-names = "default";
111 + pinctrl-0 = <&emmc_gpio34>;
112 + status = "okay";
113 + bus-width = <4>;
114 + non-removable;
115 + mmc-pwrseq = <&wifi_pwrseq>;
116 +
117 + brcmf: wifi@1 {
118 + reg = <1>;
119 + compatible = "brcm,bcm4329-fmac";
120 + };
121 +};
122 +
123 +/* EMMC2 is used to drive the SD card */
124 +&emmc2 {
125 + status = "okay";
126 + broken-cd;
127 + vqmmc-supply = <&sd_io_1v8_reg>;
128 +};
129 +
130 +/* uart0 communicates with the BT module */
131 +&uart0 {
132 + pinctrl-names = "default";
133 + pinctrl-0 = <&uart0_ctsrts_gpio30 &uart0_gpio32 &gpclk2_gpio43>;
134 + status = "okay";
135 +
136 + bluetooth {
137 + compatible = "brcm,bcm43438-bt";
138 + max-speed = <2000000>;
139 + shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>;
140 + };
141 +};
142 +
143 +/* uart1 is mapped to the pin header */
144 +&uart1 {
145 + pinctrl-names = "default";
146 + pinctrl-0 = <&uart1_gpio14>;
147 + status = "okay";
148 +};
149 --- /dev/null
150 +++ b/arch/arm/boot/dts/bcm2838-rpi.dtsi
151 @@ -0,0 +1,25 @@
152 +// SPDX-License-Identifier: GPL-2.0
153 +
154 +/ {
155 + soc {
156 + /delete-node/ mailbox@7e00b840;
157 + };
158 +};
159 +
160 +&scb {
161 + vchiq: mailbox@7e00b840 {
162 + compatible = "brcm,bcm2838-vchiq";
163 + reg = <0 0x7e00b840 0x3c>;
164 + interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
165 + };
166 +};
167 +
168 +&dma {
169 + /* The VPU firmware uses DMA channel 11 for VCHIQ */
170 + brcm,dma-channel-mask = <0x1f5>;
171 +};
172 +
173 +&dma40 {
174 + /* The VPU firmware DMA channel 11 for VCHIQ */
175 + brcm,dma-channel-mask = <0x7000>;
176 +};