1*f126890aSEmmanuel Vadot// SPDX-License-Identifier: GPL-2.0
2*f126890aSEmmanuel Vadot#include "bcm283x.dtsi"
3*f126890aSEmmanuel Vadot#include "bcm2835-common.dtsi"
4*f126890aSEmmanuel Vadot
5*f126890aSEmmanuel Vadot/ {
6*f126890aSEmmanuel Vadot	compatible = "brcm,bcm2836";
7*f126890aSEmmanuel Vadot
8*f126890aSEmmanuel Vadot	soc {
9*f126890aSEmmanuel Vadot		ranges = <0x7e000000 0x3f000000 0x1000000>,
10*f126890aSEmmanuel Vadot			 <0x40000000 0x40000000 0x00001000>;
11*f126890aSEmmanuel Vadot		dma-ranges = <0xc0000000 0x00000000 0x3f000000>;
12*f126890aSEmmanuel Vadot
13*f126890aSEmmanuel Vadot		local_intc: interrupt-controller@40000000 {
14*f126890aSEmmanuel Vadot			compatible = "brcm,bcm2836-l1-intc";
15*f126890aSEmmanuel Vadot			reg = <0x40000000 0x100>;
16*f126890aSEmmanuel Vadot			interrupt-controller;
17*f126890aSEmmanuel Vadot			#interrupt-cells = <2>;
18*f126890aSEmmanuel Vadot			interrupt-parent = <&local_intc>;
19*f126890aSEmmanuel Vadot		};
20*f126890aSEmmanuel Vadot	};
21*f126890aSEmmanuel Vadot
22*f126890aSEmmanuel Vadot	arm-pmu {
23*f126890aSEmmanuel Vadot		compatible = "arm,cortex-a7-pmu";
24*f126890aSEmmanuel Vadot		interrupt-parent = <&local_intc>;
25*f126890aSEmmanuel Vadot		interrupts = <9 IRQ_TYPE_LEVEL_HIGH>;
26*f126890aSEmmanuel Vadot	};
27*f126890aSEmmanuel Vadot
28*f126890aSEmmanuel Vadot	timer {
29*f126890aSEmmanuel Vadot		compatible = "arm,armv7-timer";
30*f126890aSEmmanuel Vadot		interrupt-parent = <&local_intc>;
31*f126890aSEmmanuel Vadot		interrupts = <0 IRQ_TYPE_LEVEL_HIGH>, // PHYS_SECURE_PPI
32*f126890aSEmmanuel Vadot			     <1 IRQ_TYPE_LEVEL_HIGH>, // PHYS_NONSECURE_PPI
33*f126890aSEmmanuel Vadot			     <3 IRQ_TYPE_LEVEL_HIGH>, // VIRT_PPI
34*f126890aSEmmanuel Vadot			     <2 IRQ_TYPE_LEVEL_HIGH>; // HYP_PPI
35*f126890aSEmmanuel Vadot		always-on;
36*f126890aSEmmanuel Vadot	};
37*f126890aSEmmanuel Vadot
38*f126890aSEmmanuel Vadot	cpus: cpus {
39*f126890aSEmmanuel Vadot		#address-cells = <1>;
40*f126890aSEmmanuel Vadot		#size-cells = <0>;
41*f126890aSEmmanuel Vadot		enable-method = "brcm,bcm2836-smp";
42*f126890aSEmmanuel Vadot
43*f126890aSEmmanuel Vadot		/* Source for d/i-cache-line-size and d/i-cache-sets
44*f126890aSEmmanuel Vadot		 * https://developer.arm.com/documentation/ddi0464/f/L1-Memory-System
45*f126890aSEmmanuel Vadot		 * /About-the-L1-memory-system?lang=en
46*f126890aSEmmanuel Vadot		 *
47*f126890aSEmmanuel Vadot		 * Source for d/i-cache-size
48*f126890aSEmmanuel Vadot		 * https://forums.raspberrypi.com/viewtopic.php?t=98428
49*f126890aSEmmanuel Vadot		 */
50*f126890aSEmmanuel Vadot
51*f126890aSEmmanuel Vadot		v7_cpu0: cpu@0 {
52*f126890aSEmmanuel Vadot			device_type = "cpu";
53*f126890aSEmmanuel Vadot			compatible = "arm,cortex-a7";
54*f126890aSEmmanuel Vadot			reg = <0xf00>;
55*f126890aSEmmanuel Vadot			clock-frequency = <800000000>;
56*f126890aSEmmanuel Vadot			d-cache-size = <0x8000>;
57*f126890aSEmmanuel Vadot			d-cache-line-size = <64>;
58*f126890aSEmmanuel Vadot			d-cache-sets = <128>; // 32KiB(size)/64(line-size)=512ways/4-way set
59*f126890aSEmmanuel Vadot			i-cache-size = <0x8000>;
60*f126890aSEmmanuel Vadot			i-cache-line-size = <32>;
61*f126890aSEmmanuel Vadot			i-cache-sets = <512>; // 32KiB(size)/32(line-size)=1024ways/2-way set
62*f126890aSEmmanuel Vadot			next-level-cache = <&l2>;
63*f126890aSEmmanuel Vadot		};
64*f126890aSEmmanuel Vadot
65*f126890aSEmmanuel Vadot		v7_cpu1: cpu@1 {
66*f126890aSEmmanuel Vadot			device_type = "cpu";
67*f126890aSEmmanuel Vadot			compatible = "arm,cortex-a7";
68*f126890aSEmmanuel Vadot			reg = <0xf01>;
69*f126890aSEmmanuel Vadot			clock-frequency = <800000000>;
70*f126890aSEmmanuel Vadot			d-cache-size = <0x8000>;
71*f126890aSEmmanuel Vadot			d-cache-line-size = <64>;
72*f126890aSEmmanuel Vadot			d-cache-sets = <128>; // 32KiB(size)/64(line-size)=512ways/4-way set
73*f126890aSEmmanuel Vadot			i-cache-size = <0x8000>;
74*f126890aSEmmanuel Vadot			i-cache-line-size = <32>;
75*f126890aSEmmanuel Vadot			i-cache-sets = <512>; // 32KiB(size)/32(line-size)=1024ways/2-way set
76*f126890aSEmmanuel Vadot			next-level-cache = <&l2>;
77*f126890aSEmmanuel Vadot		};
78*f126890aSEmmanuel Vadot
79*f126890aSEmmanuel Vadot		v7_cpu2: cpu@2 {
80*f126890aSEmmanuel Vadot			device_type = "cpu";
81*f126890aSEmmanuel Vadot			compatible = "arm,cortex-a7";
82*f126890aSEmmanuel Vadot			reg = <0xf02>;
83*f126890aSEmmanuel Vadot			clock-frequency = <800000000>;
84*f126890aSEmmanuel Vadot			d-cache-size = <0x8000>;
85*f126890aSEmmanuel Vadot			d-cache-line-size = <64>;
86*f126890aSEmmanuel Vadot			d-cache-sets = <128>; // 32KiB(size)/64(line-size)=512ways/4-way set
87*f126890aSEmmanuel Vadot			i-cache-size = <0x8000>;
88*f126890aSEmmanuel Vadot			i-cache-line-size = <32>;
89*f126890aSEmmanuel Vadot			i-cache-sets = <512>; // 32KiB(size)/32(line-size)=1024ways/2-way set
90*f126890aSEmmanuel Vadot			next-level-cache = <&l2>;
91*f126890aSEmmanuel Vadot		};
92*f126890aSEmmanuel Vadot
93*f126890aSEmmanuel Vadot		v7_cpu3: cpu@3 {
94*f126890aSEmmanuel Vadot			device_type = "cpu";
95*f126890aSEmmanuel Vadot			compatible = "arm,cortex-a7";
96*f126890aSEmmanuel Vadot			reg = <0xf03>;
97*f126890aSEmmanuel Vadot			clock-frequency = <800000000>;
98*f126890aSEmmanuel Vadot			d-cache-size = <0x8000>;
99*f126890aSEmmanuel Vadot			d-cache-line-size = <64>;
100*f126890aSEmmanuel Vadot			d-cache-sets = <128>; // 32KiB(size)/64(line-size)=512ways/4-way set
101*f126890aSEmmanuel Vadot			i-cache-size = <0x8000>;
102*f126890aSEmmanuel Vadot			i-cache-line-size = <32>;
103*f126890aSEmmanuel Vadot			i-cache-sets = <512>; // 32KiB(size)/32(line-size)=1024ways/2-way set
104*f126890aSEmmanuel Vadot			next-level-cache = <&l2>;
105*f126890aSEmmanuel Vadot		};
106*f126890aSEmmanuel Vadot
107*f126890aSEmmanuel Vadot		/* Source for cache-line-size + cache-sets
108*f126890aSEmmanuel Vadot		 * https://developer.arm.com/documentation/ddi0464/f/L2-Memory-System
109*f126890aSEmmanuel Vadot		 * /About-the-L2-Memory-system?lang=en
110*f126890aSEmmanuel Vadot		 * Source for cache-size
111*f126890aSEmmanuel Vadot		 * https://forums.raspberrypi.com/viewtopic.php?t=98428
112*f126890aSEmmanuel Vadot		 */
113*f126890aSEmmanuel Vadot		l2: l2-cache0 {
114*f126890aSEmmanuel Vadot			compatible = "cache";
115*f126890aSEmmanuel Vadot			cache-unified;
116*f126890aSEmmanuel Vadot			cache-size = <0x80000>;
117*f126890aSEmmanuel Vadot			cache-line-size = <64>;
118*f126890aSEmmanuel Vadot			cache-sets = <1024>; // 512KiB(size)/64(line-size)=8192ways/8-way set
119*f126890aSEmmanuel Vadot			cache-level = <2>;
120*f126890aSEmmanuel Vadot		};
121*f126890aSEmmanuel Vadot	};
122*f126890aSEmmanuel Vadot};
123*f126890aSEmmanuel Vadot
124*f126890aSEmmanuel Vadot/* Make the BCM2835-style global interrupt controller be a child of the
125*f126890aSEmmanuel Vadot * CPU-local interrupt controller.
126*f126890aSEmmanuel Vadot */
127*f126890aSEmmanuel Vadot&intc {
128*f126890aSEmmanuel Vadot	compatible = "brcm,bcm2836-armctrl-ic";
129*f126890aSEmmanuel Vadot	reg = <0x7e00b200 0x200>;
130*f126890aSEmmanuel Vadot	interrupt-parent = <&local_intc>;
131*f126890aSEmmanuel Vadot	interrupts = <8 IRQ_TYPE_LEVEL_HIGH>;
132*f126890aSEmmanuel Vadot};
133*f126890aSEmmanuel Vadot
134*f126890aSEmmanuel Vadot&cpu_thermal {
135*f126890aSEmmanuel Vadot	coefficients = <(-538)	407000>;
136*f126890aSEmmanuel Vadot};
137*f126890aSEmmanuel Vadot
138*f126890aSEmmanuel Vadot/* enable thermal sensor with the correct compatible property set */
139*f126890aSEmmanuel Vadot&thermal {
140*f126890aSEmmanuel Vadot	compatible = "brcm,bcm2836-thermal";
141*f126890aSEmmanuel Vadot	status = "okay";
142*f126890aSEmmanuel Vadot};
143