summaryrefslogtreecommitdiff
path: root/arch/riscv/boot/dts/sophgo/cv180x.dtsi
blob: ccdb454986535069528a73da938f5f9a4320dfff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
/*
 * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org>
 * Copyright (C) 2023 Inochi Amaoto <inochiama@outlook.com>
 */

#include <dt-bindings/clock/sophgo,cv1800.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include "cv18xx-reset.h"

/ {
	#address-cells = <1>;
	#size-cells = <1>;

	osc: oscillator {
		compatible = "fixed-clock";
		clock-output-names = "osc_25m";
		#clock-cells = <0>;
	};

	soc {
		compatible = "simple-bus";
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		rst: reset-controller@3003000 {
			compatible = "sophgo,cv1800b-reset";
			reg = <0x3003000 0x1000>;
			#reset-cells = <1>;
		};

		mdio: mdio-mux@3009800 {
			compatible = "mdio-mux-mmioreg", "mdio-mux";
			reg = <0x3009800 0x4>;
			#address-cells = <1>;
			#size-cells = <0>;
			mdio-parent-bus = <&gmac0_mdio>;
			mux-mask = <0x80>;
			status = "disabled";

			internal_mdio: mdio@0 {
				#address-cells = <1>;
				#size-cells = <0>;
				reg = <0>;

				internal_ephy: phy@0 {
					compatible = "ethernet-phy-ieee802.3-c22";
					reg = <1>;
				};
			};

			external_mdio: mdio@80 {
				#address-cells = <1>;
				#size-cells = <0>;
				reg = <0x80>;
			};
		};

		gpio0: gpio@3020000 {
			compatible = "snps,dw-apb-gpio";
			reg = <0x3020000 0x1000>;
			#address-cells = <1>;
			#size-cells = <0>;
			resets = <&rst RST_GPIO0>;

			porta: gpio-controller@0 {
				compatible = "snps,dw-apb-gpio-port";
				gpio-controller;
				#gpio-cells = <2>;
				ngpios = <32>;
				reg = <0>;
				interrupt-controller;
				#interrupt-cells = <2>;
				interrupts = <SOC_PERIPHERAL_IRQ(44) IRQ_TYPE_LEVEL_HIGH>;
			};
		};

		gpio1: gpio@3021000 {
			compatible = "snps,dw-apb-gpio";
			reg = <0x3021000 0x1000>;
			#address-cells = <1>;
			#size-cells = <0>;
			resets = <&rst RST_GPIO1>;

			portb: gpio-controller@0 {
				compatible = "snps,dw-apb-gpio-port";
				gpio-controller;
				#gpio-cells = <2>;
				ngpios = <32>;
				reg = <0>;
				interrupt-controller;
				#interrupt-cells = <2>;
				interrupts = <SOC_PERIPHERAL_IRQ(45) IRQ_TYPE_LEVEL_HIGH>;
			};
		};

		gpio2: gpio@3022000 {
			compatible = "snps,dw-apb-gpio";
			reg = <0x3022000 0x1000>;
			#address-cells = <1>;
			#size-cells = <0>;
			resets = <&rst RST_GPIO2>;

			portc: gpio-controller@0 {
				compatible = "snps,dw-apb-gpio-port";
				gpio-controller;
				#gpio-cells = <2>;
				ngpios = <32>;
				reg = <0>;
				interrupt-controller;
				#interrupt-cells = <2>;
				interrupts = <SOC_PERIPHERAL_IRQ(46) IRQ_TYPE_LEVEL_HIGH>;
			};
		};

		gpio3: gpio@3023000 {
			compatible = "snps,dw-apb-gpio";
			reg = <0x3023000 0x1000>;
			#address-cells = <1>;
			#size-cells = <0>;
			resets = <&rst RST_GPIO3>;

			portd: gpio-controller@0 {
				compatible = "snps,dw-apb-gpio-port";
				gpio-controller;
				#gpio-cells = <2>;
				ngpios = <32>;
				reg = <0>;
				interrupt-controller;
				#interrupt-cells = <2>;
				interrupts = <SOC_PERIPHERAL_IRQ(47) IRQ_TYPE_LEVEL_HIGH>;
			};
		};

		saradc: adc@30f0000 {
			compatible = "sophgo,cv1800b-saradc";
			reg = <0x030f0000 0x1000>;
			clocks = <&clk CLK_SARADC>;
			interrupts = <SOC_PERIPHERAL_IRQ(84) IRQ_TYPE_LEVEL_HIGH>;
			#address-cells = <1>;
			#size-cells = <0>;
			status = "disabled";

			channel@0 {
				reg = <0>;
			};

			channel@1 {
				reg = <1>;
			};

			channel@2 {
				reg = <2>;
			};
		};

		i2c0: i2c@4000000 {
			compatible = "snps,designware-i2c";
			reg = <0x04000000 0x10000>;
			#address-cells = <1>;
			#size-cells = <0>;
			clocks = <&clk CLK_I2C>, <&clk CLK_APB_I2C0>;
			clock-names = "ref", "pclk";
			interrupts = <SOC_PERIPHERAL_IRQ(33) IRQ_TYPE_LEVEL_HIGH>;
			resets = <&rst RST_I2C0>;
			status = "disabled";
		};

		i2c1: i2c@4010000 {
			compatible = "snps,designware-i2c";
			reg = <0x04010000 0x10000>;
			#address-cells = <1>;
			#size-cells = <0>;
			clocks = <&clk CLK_I2C>, <&clk CLK_APB_I2C1>;
			clock-names = "ref", "pclk";
			interrupts = <SOC_PERIPHERAL_IRQ(34) IRQ_TYPE_LEVEL_HIGH>;
			resets = <&rst RST_I2C1>;
			status = "disabled";
		};

		i2c2: i2c@4020000 {
			compatible = "snps,designware-i2c";
			reg = <0x04020000 0x10000>;
			#address-cells = <1>;
			#size-cells = <0>;
			clocks = <&clk CLK_I2C>, <&clk CLK_APB_I2C2>;
			clock-names = "ref", "pclk";
			interrupts = <SOC_PERIPHERAL_IRQ(35) IRQ_TYPE_LEVEL_HIGH>;
			resets = <&rst RST_I2C2>;
			status = "disabled";
		};

		i2c3: i2c@4030000 {
			compatible = "snps,designware-i2c";
			reg = <0x04030000 0x10000>;
			#address-cells = <1>;
			#size-cells = <0>;
			clocks = <&clk CLK_I2C>, <&clk CLK_APB_I2C3>;
			clock-names = "ref", "pclk";
			interrupts = <SOC_PERIPHERAL_IRQ(36) IRQ_TYPE_LEVEL_HIGH>;
			resets = <&rst RST_I2C3>;
			status = "disabled";
		};

		i2c4: i2c@4040000 {
			compatible = "snps,designware-i2c";
			reg = <0x04040000 0x10000>;
			#address-cells = <1>;
			#size-cells = <0>;
			clocks = <&clk CLK_I2C>, <&clk CLK_APB_I2C4>;
			clock-names = "ref", "pclk";
			interrupts = <SOC_PERIPHERAL_IRQ(37) IRQ_TYPE_LEVEL_HIGH>;
			resets = <&rst RST_I2C4>;
			status = "disabled";
		};

		gmac0: ethernet@4070000 {
			compatible = "sophgo,cv1800b-dwmac", "snps,dwmac-3.70a";
			reg = <0x04070000 0x10000>;
			clocks = <&clk CLK_AXI4_ETH0>, <&clk CLK_ETH0_500M>;
			clock-names = "stmmaceth", "ptp_ref";
			interrupts = <SOC_PERIPHERAL_IRQ(15) IRQ_TYPE_LEVEL_HIGH>;
			interrupt-names = "macirq";
			phy-handle = <&internal_ephy>;
			phy-mode = "internal";
			resets = <&rst RST_ETH0>;
			reset-names = "stmmaceth";
			rx-fifo-depth = <8192>;
			tx-fifo-depth = <8192>;
			snps,multicast-filter-bins = <0>;
			snps,perfect-filter-entries = <1>;
			snps,aal;
			snps,txpbl = <8>;
			snps,rxpbl = <8>;
			snps,mtl-rx-config = <&gmac0_mtl_rx_setup>;
			snps,mtl-tx-config = <&gmac0_mtl_tx_setup>;
			snps,axi-config = <&gmac0_stmmac_axi_setup>;
			status = "disabled";

			gmac0_mdio: mdio {
				compatible = "snps,dwmac-mdio";
				#address-cells = <1>;
				#size-cells = <0>;
			};

			gmac0_mtl_rx_setup: rx-queues-config {
				snps,rx-queues-to-use = <1>;
				queue0 {};
			};

			gmac0_mtl_tx_setup: tx-queues-config {
				snps,tx-queues-to-use = <1>;
				queue0 {};
			};

			gmac0_stmmac_axi_setup: stmmac-axi-config {
				snps,blen = <16 8 4 0 0 0 0>;
				snps,rd_osr_lmt = <2>;
				snps,wr_osr_lmt = <1>;
			};
		};

		uart0: serial@4140000 {
			compatible = "snps,dw-apb-uart";
			reg = <0x04140000 0x100>;
			interrupts = <SOC_PERIPHERAL_IRQ(28) IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&clk CLK_UART0>, <&clk CLK_APB_UART0>;
			clock-names = "baudclk", "apb_pclk";
			reg-shift = <2>;
			reg-io-width = <4>;
			resets = <&rst RST_UART0>;
			status = "disabled";
		};

		uart1: serial@4150000 {
			compatible = "snps,dw-apb-uart";
			reg = <0x04150000 0x100>;
			interrupts = <SOC_PERIPHERAL_IRQ(29) IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&clk CLK_UART1>, <&clk CLK_APB_UART1>;
			clock-names = "baudclk", "apb_pclk";
			reg-shift = <2>;
			reg-io-width = <4>;
			resets = <&rst RST_UART1>;
			status = "disabled";
		};

		uart2: serial@4160000 {
			compatible = "snps,dw-apb-uart";
			reg = <0x04160000 0x100>;
			interrupts = <SOC_PERIPHERAL_IRQ(30) IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&clk CLK_UART2>, <&clk CLK_APB_UART2>;
			clock-names = "baudclk", "apb_pclk";
			reg-shift = <2>;
			reg-io-width = <4>;
			resets = <&rst RST_UART2>;
			status = "disabled";
		};

		uart3: serial@4170000 {
			compatible = "snps,dw-apb-uart";
			reg = <0x04170000 0x100>;
			interrupts = <SOC_PERIPHERAL_IRQ(31) IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&clk CLK_UART3>, <&clk CLK_APB_UART3>;
			clock-names = "baudclk", "apb_pclk";
			reg-shift = <2>;
			reg-io-width = <4>;
			resets = <&rst RST_UART3>;
			status = "disabled";
		};

		spi0: spi@4180000 {
			compatible = "snps,dw-apb-ssi";
			reg = <0x04180000 0x10000>;
			#address-cells = <1>;
			#size-cells = <0>;
			clocks = <&clk CLK_SPI>, <&clk CLK_APB_SPI0>;
			clock-names = "ssi_clk", "pclk";
			interrupts = <SOC_PERIPHERAL_IRQ(38) IRQ_TYPE_LEVEL_HIGH>;
			resets = <&rst RST_SPI0>;
			status = "disabled";
		};

		spi1: spi@4190000 {
			compatible = "snps,dw-apb-ssi";
			reg = <0x04190000 0x10000>;
			#address-cells = <1>;
			#size-cells = <0>;
			clocks = <&clk CLK_SPI>, <&clk CLK_APB_SPI1>;
			clock-names = "ssi_clk", "pclk";
			interrupts = <SOC_PERIPHERAL_IRQ(39) IRQ_TYPE_LEVEL_HIGH>;
			resets = <&rst RST_SPI1>;
			status = "disabled";
		};

		spi2: spi@41a0000 {
			compatible = "snps,dw-apb-ssi";
			reg = <0x041a0000 0x10000>;
			#address-cells = <1>;
			#size-cells = <0>;
			clocks = <&clk CLK_SPI>, <&clk CLK_APB_SPI2>;
			clock-names = "ssi_clk", "pclk";
			interrupts = <SOC_PERIPHERAL_IRQ(40) IRQ_TYPE_LEVEL_HIGH>;
			resets = <&rst RST_SPI2>;
			status = "disabled";
		};

		spi3: spi@41b0000 {
			compatible = "snps,dw-apb-ssi";
			reg = <0x041b0000 0x10000>;
			#address-cells = <1>;
			#size-cells = <0>;
			clocks = <&clk CLK_SPI>, <&clk CLK_APB_SPI3>;
			clock-names = "ssi_clk", "pclk";
			interrupts = <SOC_PERIPHERAL_IRQ(41) IRQ_TYPE_LEVEL_HIGH>;
			resets = <&rst RST_SPI3>;
			status = "disabled";
		};

		uart4: serial@41c0000 {
			compatible = "snps,dw-apb-uart";
			reg = <0x041c0000 0x100>;
			interrupts = <SOC_PERIPHERAL_IRQ(32) IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&clk CLK_UART4>, <&clk CLK_APB_UART4>;
			clock-names = "baudclk", "apb_pclk";
			reg-shift = <2>;
			reg-io-width = <4>;
			resets = <&rst RST_UART4>;
			status = "disabled";
		};

		sdhci0: mmc@4310000 {
			compatible = "sophgo,cv1800b-dwcmshc";
			reg = <0x4310000 0x1000>;
			interrupts = <SOC_PERIPHERAL_IRQ(20) IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&clk CLK_AXI4_SD0>,
				 <&clk CLK_SD0>;
			clock-names = "core", "bus";
			status = "disabled";
		};

		sdhci1: mmc@4320000 {
			compatible = "sophgo,cv1800b-dwcmshc";
			reg = <0x4320000 0x1000>;
			interrupts = <SOC_PERIPHERAL_IRQ(22) IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&clk CLK_AXI4_SD1>,
				 <&clk CLK_SD1>;
			clock-names = "core", "bus";
			status = "disabled";
		};

		dmac: dma-controller@4330000 {
			compatible = "snps,axi-dma-1.01a";
			reg = <0x04330000 0x1000>;
			interrupts = <SOC_PERIPHERAL_IRQ(13) IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&clk CLK_SDMA_AXI>, <&clk CLK_SDMA_AXI>;
			clock-names = "core-clk", "cfgr-clk";
			#dma-cells = <1>;
			dma-channels = <8>;
			snps,block-size = <1024 1024 1024 1024
					   1024 1024 1024 1024>;
			snps,priority = <0 1 2 3 4 5 6 7>;
			snps,dma-masters = <2>;
			snps,data-width = <2>;
			status = "disabled";
		};

		rtc@5025000 {
			compatible = "sophgo,cv1800b-rtc", "syscon";
			reg = <0x5025000 0x2000>;
			interrupts = <SOC_PERIPHERAL_IRQ(1) IRQ_TYPE_LEVEL_HIGH>,
				     <SOC_PERIPHERAL_IRQ(2) IRQ_TYPE_LEVEL_HIGH>,
				     <SOC_PERIPHERAL_IRQ(3) IRQ_TYPE_LEVEL_HIGH>;
			interrupt-names = "alarm", "longpress", "vbat";
			clocks = <&clk CLK_RTC_25M>,
				 <&clk CLK_SRC_RTC_SYS_0>;
			clock-names = "rtc", "mcu";
		};
	};
};