1// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2/*
3 * Device Tree Source for the RZ/V2M SoC
4 *
5 * Copyright (C) 2022 Renesas Electronics Corp.
6 */
7
8#include <dt-bindings/interrupt-controller/arm-gic.h>
9#include <dt-bindings/clock/r9a09g011-cpg.h>
10
11/ {
12	compatible = "renesas,r9a09g011";
13	#address-cells = <2>;
14	#size-cells = <2>;
15
16	/* clock can be either from exclk or crystal oscillator (XIN/XOUT) */
17	extal_clk: extal {
18		compatible = "fixed-clock";
19		#clock-cells = <0>;
20		/* This value must be overridden by the board */
21		clock-frequency = <0>;
22	};
23
24	cpus {
25		#address-cells = <1>;
26		#size-cells = <0>;
27
28		cpu-map {
29			cluster0 {
30				core0 {
31					cpu = <&cpu0>;
32				};
33			};
34		};
35
36		cpu0: cpu@0 {
37			compatible = "arm,cortex-a53";
38			reg = <0>;
39			device_type = "cpu";
40			next-level-cache = <&L2_CA53>;
41			clocks = <&cpg CPG_MOD R9A09G011_CA53_CLK>;
42		};
43
44		L2_CA53: cache-controller-0 {
45			compatible = "cache";
46			cache-unified;
47			cache-level = <2>;
48		};
49	};
50
51	soc: soc {
52		compatible = "simple-bus";
53		interrupt-parent = <&gic>;
54		#address-cells = <2>;
55		#size-cells = <2>;
56		ranges;
57
58		gic: interrupt-controller@82010000 {
59			compatible = "arm,gic-400";
60			#interrupt-cells = <3>;
61			#address-cells = <0>;
62			interrupt-controller;
63			reg = <0x0 0x82010000 0 0x1000>,
64			      <0x0 0x82020000 0 0x20000>,
65			      <0x0 0x82040000 0 0x20000>,
66			      <0x0 0x82060000 0 0x20000>;
67			interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_HIGH)>;
68			clocks = <&cpg CPG_MOD R9A09G011_GIC_CLK>;
69			clock-names = "clk";
70		};
71
72		avb: ethernet@a3300000 {
73			compatible = "renesas,etheravb-r9a09g011","renesas,etheravb-rzv2m";
74			reg = <0 0xa3300000 0 0x800>;
75			interrupts = <GIC_SPI 251 IRQ_TYPE_LEVEL_HIGH>, /* ch0: Rx0 BE */
76				     <GIC_SPI 252 IRQ_TYPE_LEVEL_HIGH>, /* ch1: Rx1 NC */
77				     <GIC_SPI 253 IRQ_TYPE_LEVEL_HIGH>,
78				     <GIC_SPI 254 IRQ_TYPE_LEVEL_HIGH>,
79				     <GIC_SPI 255 IRQ_TYPE_LEVEL_HIGH>,
80				     <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>,
81				     <GIC_SPI 257 IRQ_TYPE_LEVEL_HIGH>,
82				     <GIC_SPI 258 IRQ_TYPE_LEVEL_HIGH>,
83				     <GIC_SPI 259 IRQ_TYPE_LEVEL_HIGH>,
84				     <GIC_SPI 260 IRQ_TYPE_LEVEL_HIGH>,
85				     <GIC_SPI 261 IRQ_TYPE_LEVEL_HIGH>,
86				     <GIC_SPI 262 IRQ_TYPE_LEVEL_HIGH>,
87				     <GIC_SPI 263 IRQ_TYPE_LEVEL_HIGH>,
88				     <GIC_SPI 264 IRQ_TYPE_LEVEL_HIGH>,
89				     <GIC_SPI 265 IRQ_TYPE_LEVEL_HIGH>,
90				     <GIC_SPI 266 IRQ_TYPE_LEVEL_HIGH>,
91				     <GIC_SPI 267 IRQ_TYPE_LEVEL_HIGH>,
92				     <GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>,
93				     <GIC_SPI 269 IRQ_TYPE_LEVEL_HIGH>, /* ch18: Tx0 BE */
94				     <GIC_SPI 270 IRQ_TYPE_LEVEL_HIGH>, /* ch19: Tx1 NC */
95				     <GIC_SPI 271 IRQ_TYPE_LEVEL_HIGH>,
96				     <GIC_SPI 272 IRQ_TYPE_LEVEL_HIGH>,
97				     <GIC_SPI 273 IRQ_TYPE_LEVEL_HIGH>, /* DiA */
98				     <GIC_SPI 274 IRQ_TYPE_LEVEL_HIGH>, /* DiB */
99				     <GIC_SPI 275 IRQ_TYPE_LEVEL_HIGH>, /* Line1_A */
100				     <GIC_SPI 276 IRQ_TYPE_LEVEL_HIGH>, /* Line1_B */
101				     <GIC_SPI 277 IRQ_TYPE_LEVEL_HIGH>, /* Line2_A */
102				     <GIC_SPI 278 IRQ_TYPE_LEVEL_HIGH>, /* Line2_B */
103				     <GIC_SPI 279 IRQ_TYPE_LEVEL_HIGH>; /* Line3 MAC */
104			interrupt-names = "ch0", "ch1", "ch2", "ch3",
105					  "ch4", "ch5", "ch6", "ch7",
106					  "ch8", "ch9", "ch10", "ch11",
107					  "ch12", "ch13", "ch14", "ch15",
108					  "ch16", "ch17", "ch18", "ch19",
109					  "ch20", "ch21", "dia", "dib",
110					  "err_a", "err_b", "mgmt_a", "mgmt_b",
111					  "line3";
112			clocks = <&cpg CPG_MOD R9A09G011_ETH0_CLK_AXI>,
113				 <&cpg CPG_MOD R9A09G011_ETH0_CLK_CHI>,
114				 <&cpg CPG_MOD R9A09G011_ETH0_GPTP_EXT>;
115			clock-names = "axi", "chi", "gptp";
116			resets = <&cpg R9A09G011_ETH0_RST_HW_N>;
117			power-domains = <&cpg>;
118			#address-cells = <1>;
119			#size-cells = <0>;
120			status = "disable";
121		};
122
123		cpg: clock-controller@a3500000 {
124			compatible = "renesas,r9a09g011-cpg";
125			reg = <0 0xa3500000 0 0x1000>;
126			clocks = <&extal_clk>;
127			clock-names = "extal";
128			#clock-cells = <2>;
129			#reset-cells = <1>;
130			#power-domain-cells = <0>;
131		};
132
133		sys: system-controller@a3f03000 {
134			compatible = "renesas,r9a09g011-sys";
135			reg = <0 0xa3f03000 0 0x400>;
136		};
137
138		i2c0: i2c@a4030000 {
139			#address-cells = <1>;
140			#size-cells = <0>;
141			compatible = "renesas,r9a09g011-i2c", "renesas,rzv2m-i2c";
142			reg = <0 0xa4030000 0 0x80>;
143			interrupts = <GIC_SPI 232 IRQ_TYPE_EDGE_RISING>,
144				     <GIC_SPI 236 IRQ_TYPE_EDGE_RISING>;
145			interrupt-names = "tia", "tis";
146			clocks = <&cpg CPG_MOD R9A09G011_IIC_PCLK0>;
147			resets = <&cpg R9A09G011_IIC_GPA_PRESETN>;
148			power-domains = <&cpg>;
149			status = "disabled";
150		};
151
152		i2c2: i2c@a4030100 {
153			#address-cells = <1>;
154			#size-cells = <0>;
155			compatible = "renesas,r9a09g011-i2c", "renesas,rzv2m-i2c";
156			reg = <0 0xa4030100 0 0x80>;
157			interrupts = <GIC_SPI 234 IRQ_TYPE_EDGE_RISING>,
158				     <GIC_SPI 238 IRQ_TYPE_EDGE_RISING>;
159			interrupt-names = "tia", "tis";
160			clocks = <&cpg CPG_MOD R9A09G011_IIC_PCLK1>;
161			resets = <&cpg R9A09G011_IIC_GPB_PRESETN>;
162			power-domains = <&cpg>;
163			status = "disabled";
164		};
165
166		uart0: serial@a4040000 {
167			compatible = "renesas,r9a09g011-uart", "renesas,em-uart";
168			reg = <0 0xa4040000 0 0x80>;
169			interrupts = <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>;
170			clocks = <&cpg CPG_MOD R9A09G011_URT0_CLK>,
171				 <&cpg CPG_MOD R9A09G011_URT_PCLK>;
172			clock-names = "sclk", "pclk";
173			status = "disabled";
174		};
175
176		wdt0: watchdog@a4050000 {
177			compatible = "renesas,r9a09g011-wdt",
178				     "renesas,rzv2m-wdt";
179			reg = <0 0xa4050000 0 0x80>;
180			clocks = <&cpg CPG_MOD R9A09G011_WDT0_PCLK>,
181				 <&cpg CPG_MOD R9A09G011_WDT0_CLK>;
182			clock-names = "pclk", "oscclk";
183			interrupts = <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>;
184			resets = <&cpg R9A09G011_WDT0_PRESETN>;
185			power-domains = <&cpg>;
186			status = "disabled";
187		};
188
189		pinctrl: pinctrl@b6250000 {
190			compatible = "renesas,r9a09g011-pinctrl";
191			reg = <0 0xb6250000 0 0x800>;
192			gpio-controller;
193			#gpio-cells = <2>;
194			gpio-ranges = <&pinctrl 0 0 352>;
195			interrupts = <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>,
196				     <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>,
197				     <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>,
198				     <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>,
199				     <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>,
200				     <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>,
201				     <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>,
202				     <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>,
203				     <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>,
204				     <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>,
205				     <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>,
206				     <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>,
207				     <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>,
208				     <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>,
209				     <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>,
210				     <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>,
211				     <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>,
212				     <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>,
213				     <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>,
214				     <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>,
215				     <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>,
216				     <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>,
217				     <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>,
218				     <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>,
219				     <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>,
220				     <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>,
221				     <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>,
222				     <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>,
223				     <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>,
224				     <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
225				     <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
226				     <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>,
227				     <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
228				     <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
229				     <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
230				     <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>,
231				     <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>,
232				     <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>,
233				     <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
234			clocks = <&cpg CPG_MOD R9A09G011_PFC_PCLK>;
235			power-domains = <&cpg>;
236			resets = <&cpg R9A09G011_PFC_PRESETN>;
237		};
238	};
239
240	timer {
241		compatible = "arm,armv8-timer";
242		interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
243				      <&gic GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
244				      <&gic GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
245				      <&gic GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>;
246	};
247};
248