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