6f38349396d2f1c51f617f4eac4e0790ec9e594b
[librecmc/librecmc.git] / target / linux / brcm2708 / patches-4.4 / 0161-BCM270X_DT-Add-Pi3-support.patch
1 From 4aa902b37606ca425a2d1dedd400347b11a0e61d Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Thu, 21 Jan 2016 17:57:49 +0000
4 Subject: [PATCH 161/232] BCM270X_DT: Add Pi3 support
5
6 ---
7  arch/arm/boot/dts/Makefile            |   1 +
8  arch/arm/boot/dts/bcm2710-rpi-3-b.dts | 192 ++++++++++++++++++++++++++++++++++
9  arch/arm/boot/dts/bcm2710.dtsi        | 102 ++++++++++++++++++
10  3 files changed, 295 insertions(+)
11  create mode 100644 arch/arm/boot/dts/bcm2710-rpi-3-b.dts
12  create mode 100644 arch/arm/boot/dts/bcm2710.dtsi
13
14 --- a/arch/arm/boot/dts/Makefile
15 +++ b/arch/arm/boot/dts/Makefile
16 @@ -5,6 +5,7 @@ dtb-$(CONFIG_ARCH_BCM2708) += bcm2708-rp
17  dtb-$(CONFIG_ARCH_BCM2708) += bcm2708-rpi-cm.dtb
18  dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-cm.dtb
19  dtb-$(CONFIG_ARCH_BCM2709) += bcm2709-rpi-2-b.dtb
20 +dtb-$(CONFIG_ARCH_BCM2709) += bcm2710-rpi-3-b.dtb
21  
22  # Raspberry Pi
23  ifeq ($(CONFIG_ARCH_BCM2708),y)
24 --- /dev/null
25 +++ b/arch/arm/boot/dts/bcm2710-rpi-3-b.dts
26 @@ -0,0 +1,192 @@
27 +/dts-v1/;
28 +
29 +#include "bcm2710.dtsi"
30 +
31 +/ {
32 +       compatible = "brcm,bcm2710","brcm,bcm2709";
33 +       model = "Raspberry Pi 3 Model B";
34 +};
35 +
36 +&gpio {
37 +       sdhost_pins: sdhost_pins {
38 +               brcm,pins = <48 49 50 51 52 53>;
39 +               brcm,function = <4>; /* alt0 */
40 +       };
41 +
42 +       spi0_pins: spi0_pins {
43 +               brcm,pins = <9 10 11>;
44 +               brcm,function = <4>; /* alt0 */
45 +       };
46 +
47 +       spi0_cs_pins: spi0_cs_pins {
48 +               brcm,pins = <8 7>;
49 +               brcm,function = <1>; /* output */
50 +       };
51 +
52 +       i2c0_pins: i2c0 {
53 +               brcm,pins = <0 1>;
54 +               brcm,function = <4>;
55 +       };
56 +
57 +       i2c1_pins: i2c1 {
58 +               brcm,pins = <2 3>;
59 +               brcm,function = <4>;
60 +       };
61 +
62 +       i2s_pins: i2s {
63 +               brcm,pins = <18 19 20 21>;
64 +               brcm,function = <4>; /* alt0 */
65 +       };
66 +
67 +       sdio_pins: sdio_pins {
68 +               brcm,pins =     <34 35 36 37 38 39>;
69 +               brcm,function = <7>; // alt3 = SD1
70 +               brcm,pull =     <0 2 2 2 2 2>;
71 +       };
72 +
73 +       bt_pins: bt_pins {
74 +               brcm,pins =     <28 29 30 31 43>;
75 +               brcm,function = <6 6 6 6 4>;   /* alt2:PCM alt0:GPCLK2 */
76 +               brcm,pull =     <0 0 0 0 0>;
77 +       };
78 +
79 +       uart0_pins: uart0_pins {
80 +               brcm,pins = <32 33>;
81 +               brcm,function = <7>; /* alt3=UART0 */
82 +               brcm,pull = <0 0>;
83 +       };
84 +
85 +       uart1_pins: uart1_pins {
86 +               brcm,pins = <14 15>;
87 +               brcm,function = <2>; /* alt5=UART1 */
88 +               brcm,pull = <0 0>;
89 +       };
90 +};
91 +
92 +&sdhost {
93 +       pinctrl-names = "default";
94 +       pinctrl-0 = <&sdhost_pins>;
95 +       bus-width = <4>;
96 +       status = "okay";
97 +};
98 +
99 +&mmc {
100 +       pinctrl-names = "default";
101 +       pinctrl-0 = <&sdio_pins>;
102 +       non-removable;
103 +       bus-width = <4>;
104 +       status = "okay";
105 +       brcm,overclock-50 = <0>;
106 +};
107 +
108 +&soc {
109 +       virtgpio: virtgpio {
110 +               compatible = "brcm,bcm2835-virtgpio";
111 +               gpio-controller;
112 +               #gpio-cells = <2>;
113 +               firmware = <&firmware>;
114 +               status = "okay";
115 +       };
116 +};
117 +
118 +&fb {
119 +       status = "okay";
120 +};
121 +
122 +&uart0 {
123 +       pinctrl-names = "default";
124 +       pinctrl-0 = <&uart0_pins &bt_pins>;
125 +       status = "okay";
126 +};
127 +
128 +&uart1 {
129 +       pinctrl-names = "default";
130 +       pinctrl-0 = <&uart1_pins>;
131 +       status = "okay";
132 +};
133 +
134 +&spi0 {
135 +       pinctrl-names = "default";
136 +       pinctrl-0 = <&spi0_pins &spi0_cs_pins>;
137 +       cs-gpios = <&gpio 8 1>, <&gpio 7 1>;
138 +
139 +       spidev@0{
140 +               compatible = "spidev";
141 +               reg = <0>;      /* CE0 */
142 +               #address-cells = <1>;
143 +               #size-cells = <0>;
144 +               spi-max-frequency = <500000>;
145 +       };
146 +
147 +       spidev@1{
148 +               compatible = "spidev";
149 +               reg = <1>;      /* CE1 */
150 +               #address-cells = <1>;
151 +               #size-cells = <0>;
152 +               spi-max-frequency = <500000>;
153 +       };
154 +};
155 +
156 +&i2c0 {
157 +       pinctrl-names = "default";
158 +       pinctrl-0 = <&i2c0_pins>;
159 +       clock-frequency = <100000>;
160 +};
161 +
162 +&i2c1 {
163 +       pinctrl-names = "default";
164 +       pinctrl-0 = <&i2c1_pins>;
165 +       clock-frequency = <100000>;
166 +};
167 +
168 +&i2c2 {
169 +       clock-frequency = <100000>;
170 +};
171 +
172 +&i2s {
173 +       #sound-dai-cells = <0>;
174 +       pinctrl-names = "default";
175 +       pinctrl-0 = <&i2s_pins>;
176 +};
177 +
178 +&random {
179 +       status = "okay";
180 +};
181 +
182 +&leds {
183 +       act_led: act {
184 +               label = "led0";
185 +               linux,default-trigger = "mmc0";
186 +               gpios = <&virtgpio 0 0>;
187 +       };
188 +};
189 +
190 +/ {
191 +       chosen {
192 +               bootargs = "8250.nr_uarts=1";
193 +       };
194 +};
195 +
196 +/ {
197 +       __overrides__ {
198 +               uart0 = <&uart0>,"status";
199 +               uart0_clkrate = <&clk_uart0>,"clock-frequency:0";
200 +               i2s = <&i2s>,"status";
201 +               spi = <&spi0>,"status";
202 +               i2c0 = <&i2c0>,"status";
203 +               i2c1 = <&i2c1>,"status";
204 +               i2c2_iknowwhatimdoing = <&i2c2>,"status";
205 +               i2c0_baudrate = <&i2c0>,"clock-frequency:0";
206 +               i2c1_baudrate = <&i2c1>,"clock-frequency:0";
207 +               i2c2_baudrate = <&i2c2>,"clock-frequency:0";
208 +               core_freq = <&clk_core>,"clock-frequency:0";
209 +
210 +               act_led_gpio = <&act_led>,"gpios:4";
211 +               act_led_activelow = <&act_led>,"gpios:8";
212 +               act_led_trigger = <&act_led>,"linux,default-trigger";
213 +
214 +               audio = <&audio>,"status";
215 +               watchdog = <&watchdog>,"status";
216 +               random = <&random>,"status";
217 +       };
218 +};
219 --- /dev/null
220 +++ b/arch/arm/boot/dts/bcm2710.dtsi
221 @@ -0,0 +1,102 @@
222 +#include "bcm2708_common.dtsi"
223 +
224 +/ {
225 +       compatible = "brcm,bcm2710","brcm,bcm2709";
226 +       model = "BCM2710";
227 +
228 +       chosen {
229 +               /* No padding required - the boot loader can do that. */
230 +               bootargs = "";
231 +       };
232 +
233 +       soc {
234 +               ranges = <0x7e000000 0x3f000000 0x01000000>,
235 +                        <0x40000000 0x40000000 0x00040000>;
236 +
237 +               local_intc: local_intc {
238 +                       compatible = "brcm,bcm2836-l1-intc";
239 +                       reg = <0x40000000 0x100>;
240 +                       interrupt-controller;
241 +                       #interrupt-cells = <1>;
242 +                       interrupt-parent = <&local_intc>;
243 +               };
244 +
245 +               arm-pmu {
246 +                       compatible = "arm,cortex-a7-pmu";
247 +                       interrupt-parent = <&local_intc>;
248 +                       interrupts = <9>;
249 +               };
250 +
251 +               gpiomem {
252 +                       compatible = "brcm,bcm2835-gpiomem";
253 +                       reg = <0x7e200000 0x1000>;
254 +                       status = "okay";
255 +               };
256 +
257 +               timer {
258 +                       compatible = "arm,armv7-timer";
259 +                       clock-frequency = <19200000>;
260 +                       interrupt-parent = <&local_intc>;
261 +                       interrupts = <0>, // PHYS_SECURE_PPI
262 +                                    <1>, // PHYS_NONSECURE_PPI
263 +                                    <3>, // VIRT_PPI
264 +                                    <2>; // HYP_PPI
265 +                       always-on;
266 +               };
267 +
268 +               syscon@40000000 {
269 +                       compatible = "brcm,bcm2836-arm-local", "syscon";
270 +                       reg = <0x40000000 0x100>;
271 +               };
272 +       };
273 +
274 +       cpus: cpus {
275 +               #address-cells = <1>;
276 +               #size-cells = <0>;
277 +
278 +               v7_cpu0: cpu@0 {
279 +                       device_type = "cpu";
280 +                       compatible = "arm,cortex-a7";
281 +                       reg = <0x000>;
282 +                       clock-frequency = <800000000>;
283 +               };
284 +
285 +               v7_cpu1: cpu@1 {
286 +                       device_type = "cpu";
287 +                       compatible = "arm,cortex-a7";
288 +                       reg = <0x001>;
289 +                       clock-frequency = <800000000>;
290 +               };
291 +
292 +               v7_cpu2: cpu@2 {
293 +                       device_type = "cpu";
294 +                       compatible = "arm,cortex-a7";
295 +                       reg = <0x002>;
296 +                       clock-frequency = <800000000>;
297 +               };
298 +
299 +               v7_cpu3: cpu@3 {
300 +                       device_type = "cpu";
301 +                       compatible = "arm,cortex-a7";
302 +                       reg = <0x003>;
303 +                       clock-frequency = <800000000>;
304 +               };
305 +       };
306 +
307 +       __overrides__ {
308 +               arm_freq = <&v7_cpu0>, "clock-frequency:0",
309 +                      <&v7_cpu1>, "clock-frequency:0",
310 +                      <&v7_cpu2>, "clock-frequency:0",
311 +                      <&v7_cpu3>, "clock-frequency:0";
312 +       };
313 +};
314 +
315 +&watchdog {
316 +       status = "okay";
317 +};
318 +
319 +&intc {
320 +        compatible = "brcm,bcm2836-armctrl-ic";
321 +        interrupt-parent = <&local_intc>;
322 +        interrupts = <8>;
323 +};